简体   繁体   English

如何从Java Netbeans中删除无用的库

[英]How to remove useless libraries from Java Netbeans

I am making a Java Swing project and it includes like 80-90 libraries. 我正在制作一个Java Swing项目,它包括80-90个库。 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. 例如,我已经添加了javamail中的所有lib文件,但我知道我只使用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. 我正在使用Netbeans IDE。 Please help. 请帮忙。

That means management of library dependencies. 这意味着管理库依赖项。 There is the ant/ivy combo , but I use the maven build infrastructure. 蚂蚁/常春藤组合 ,但我使用maven构建基础设施。

Create a new maven project in NetBeans, add all sources (to src/main/java), and then start adding dependencies (appears in the project explorer). 在NetBeans中创建一个新的maven项目,添加所有源(到src / main / java),然后开始添加依赖项 (显示在项目资源管理器中)。

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. 介意:maven首先将库中的元数据加载到本地“存储库”中,默认情况下在用户目录中为.m2。

I can only recommend maven. 我只能推荐maven。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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