views:

227

answers:

1

Using Maven 1.x with just the bundled/standard plugins, what configuration is necessary to build an executable Jar?

Answers should cover:

  • including dependencies in target Jar
  • proper classpath configuration to make dependency Jars accessible
+1  A: 

Well the easiest way is to simply set the maven.jar.mainclass property to the main class you'd like to use.

As far as setting up the manifest classpath you can use maven.jar.manifest.classpath.add=true to have maven automatically update the classpath based on the dependencies described in the project.xml.

Disclaimer: It's been a long time since I've used Maven 1 and I did not test any of this out, but I'm pretty sure this will get you started in the right direction. For more information check out the jar plugin docs.

Mike Deck