I\'m using mvn package
to create a runnable jar with all dependencies packed inside, which runs fine.
But I\'d prefer to have all external dependencies packed i
Use the maven-dependencies-plugin
to specify an output directory for the copy-dependencies
execution.
org.apache.maven.plugins
maven-dependency-plugin
2.5.1
copy-dependencies
package
copy-dependencies
${project.build.directory}/lib/
Update:
To let the jar know where to find the lib
folder, you can specify this as a Class-Path
value in the manifest
using the maven-jar-plugin
org.apache.maven.plugins
maven-jar-plugin
true
lib/
foo.bar.MainClass
Hope this helps.