java - How do I combine multiple Jar files into one deliverable Jar? -


i have been researching trying find way combine multiple jar files on jar deliverable.

in directory have ant file named jar_gen.xml consists of following code in entirety

<target name="combine-jars">     <jar destfile="out.jar">         <zipgroupfileset dir="lib" includes="*.jar"/>     </jar> </target> 

in same directory have directory named lib contains of jar files flatten.

i have been running ant script with

ant -buildfile jar_gen.xml 

making sure running same directory jar_gen.xml file in.

i getting no output ant script , have not idea why. can please me fix script may flatten of jars , continue constructing deliverable package.

note

i have no main class eclipse runnable jar not work me

i have little experience running ant scripts complete answers helpful.

is directory structure set correctly?

i created quick test using script , appears work, given have set in directory structure as

project_root_dir - build.xml - lib   - a.jar   - b.jar 

and build.xml looks like:

<?xml version="1.0" encoding="utf-8" standalone="no"?> <project name="test">     <target name="combine-jars">         <jar destfile="out.jar">             <zipgroupfileset dir="lib" includes="*.jar"/>         </jar>     </target> </project> 

when go project_root_dir , run "ant combine-jars", out.jar contains contents of both a.jar , b.jar.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -