3

Possible Duplicate:
Ant - how to get all files' name in a specific folder

I created a jar file for my project using ant. My project has some external libraries. How can i add these external library files to the executable jar.
I added the Class-path attribute in Manifest with the external jars. But it doesn't works.
How can i add the external Libraries.
Thanks in advance.

Community
  • 1
  • 1
ѕтƒ
  • 3,547
  • 10
  • 47
  • 78

1 Answers1

4

Like so:

<jar destfile="${jar.file}" 
    basedir="${build.dir}" 
    manifest="${manifest.file}">
    <fileset dir="${classes.dir}" includes="**/*.class" />
    <zipgroupfileset dir="${lib.dir}" includes="**/*.jar" />
</jar>

Maybe this can also help:

http://code.google.com/p/jarjar/

And also reading this:

http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html

Yves_T
  • 1,170
  • 2
  • 10
  • 16