用Maven生成一个包含所有依赖jar包的可执行的jar包

网上有很多用Maven生成可运行jar的例子,但是大多都是将依赖的jar单独放在一个目录下,或者将依赖unpack后一起打在jar包中。找了很久终于在stackoverflow上找到一位牛人提供的解决方案:
[quote]
create an executable jar with dependencies using Maven:

using plugin - onejar-maven-plugin. Example below (mvn package build jar):


org.dstovall
onejar-maven-plugin
1.3.0



com.company.MainClass


one-jar





You need to add repository for that plugin:



onejar-maven-plugin.googlecode.com
http://onejar-maven-plugin.googlecode.com/svn/mavenrepo



[/quote]

你可能感兴趣的:(maven)