简体   繁体   中英

netbeans builds Maven projects jar file without dependent jar files

Could anyone would be so kind and explain how to make a single jar file with all maven dependencies in Netbeans Maven Java Application? In Eclipse user can Export to Runnable jar file and select Package required libraries into generated JAR, so all dependencies within project comes in created jar file. In Netbeans there is no such option. I have checked other answers, but the only thing i understand is that I have to add code to Build.xml file which is not even in the project.

The last time I had to do this I used the Maven Shade Plugin . It allows you to create a single JAR file and also handles dependency clashes.

A simpler solution (which doesn't handle dependency clashes) is to use the Maven Assembly Plugin .

Note that these are pure Maven solutions which should work in any IDE.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM