简体   繁体   中英

How to remove useless libraries from Java Netbeans

I am making a Java Swing project and it includes like 80-90 libraries. I am not using most of them but I added them as they came in a pack. eg I have added all lib files from javamail, though I know that I am only using SMTP. Is there any way to find out which libraries I am not using???. Is there a safe way to remove these libraries without causing a conflict? I am using Netbeans IDE. Please help.

That means management of library dependencies. There is the ant/ivy combo , but I use the maven build infrastructure.

Create a new maven project in NetBeans, add all sources (to src/main/java), and then start adding dependencies (appears in the project explorer).

Transitive dependencies are dealt with.

This is ideal, as also library versions are maintained.

Mind: maven first loads the libraries with their metadata in a local "repository", per default .m2 in the user directory.

I can only recommend maven.

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