Monday, March 12, 2012

Making jar with dependency jars incorporated with maven

I want to start my program from the clear console. Here is the code, which has to be placed in pom.xml:


Where you have to put the build section in your pom.xml? Here is link to the structure of pom.xml file.

To generate an assembly, run:

mvn assembly:assembly

The generated .jar file is placed in target folder.

Running the program is also so easy, for example:

java -jar target\xxx-2.0-SNAPSHOT-jar-with-dependencies.jar > certpath.txt 2>&1

No comments:

Post a Comment