How to include maven dependencies in a jar file?
This question already has an answer here:
Take a look at this question: How can I create an executable JAR with dependencies using Maven?
I think that @Rocky Inde's answer is what you are looking for (using eclipse):
1) Just right-click on your project folder (in Eclipse) and select Export
2) Then select Java -> Runnable Jar
3) You will be asked to choose the location of the jar file
4) Finally, select the class that has the Main method that you want to run and choose Package dependencies with the Jar file and click Finish
然后,您需要在您的pom.xml中包含阴影插件,并且mvn package
会生成阴影罐(胖罐),该链接提供有关阴影插件的信息
I think that this question is duplicated:
If you want to do it with the console and Maven you could take a look into this thread: the link that @Tarik mentions
If you want to use Eclipse, take a look into this one: How to create a jar with external libraries included in eclipse?
链接地址: http://www.djcxy.com/p/29624.html上一篇: 如何将pom项目打包为可运行jar