分析 Java 项目中的 JAR 依赖项
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4326407/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Analyze JAR dependencies in a Java project
提问by Rob H
I'm looking for a tool that will show me a graph of JAR dependencies in my Java project based on static analysis of the compiled byte code. Specifically, I'm trying to figure out if there are unused JARs that I can eliminate, but I'd also just like to get a better understanding of the dependencies that exist. I'm not using Maven.
我正在寻找一种工具,该工具将根据对已编译字节码的静态分析向我显示 Java 项目中的 JAR 依赖关系图。具体来说,我想弄清楚是否有可以消除的未使用 JAR,但我也想更好地了解存在的依赖关系。我没有使用 Maven。
Dependency Findercomes close, but it deals in packages rather than JARs and there doesn't seem to be any way to query it for JARs that have no dependents. Any recommendations? Free and open source preferred. Thanks!
Dependency Finder非常接近,但它处理的是包而不是 JAR,并且似乎没有任何方法可以查询没有依赖项的 JAR。有什么建议吗?免费和开源的首选。谢谢!
采纳答案by Rob H
JBoss Tattletaledoes exactly what I need.
JBoss Tattletale正是我所需要的。
回答by David J. Liszewski
See also JarAnalyzerwhich claims to:
另见JarAnalyzer声称:
... traverse through a directory, parse each of the jar files in that directory, and identify the dependencies between the jar files.
...遍历一个目录,解析该目录中的每个 jar 文件,并确定 jar 文件之间的依赖关系。
回答by Martín
You can try this tool that displays the public resources of a library and calculates a ratio of usage between two Jars: http://trimatek.org/deep
你可以试试这个工具,它显示图书馆的公共资源并计算两个 Jars 之间的使用比率:http: //trimatek.org/deep
回答by AlexR
Take a look on JDepend.
看看JDepend。
JDepend traverses Java class file directories and generates design quality metrics for each Java package. JDepend allows you to automatically measure the quality of a design in terms of its extensibility, reusability, and maintainability to manage package dependencies effectively.
JDepend 遍历 Java 类文件目录并为每个 Java 包生成设计质量指标。JDepend 允许您在可扩展性、可重用性和可维护性方面自动衡量设计的质量,以有效管理包依赖性。
回答by aksarben
Or Maven. Elcipse plugin shows it very nicely. Even shows dependencies on the dependencies.
或者马文。Elcipse 插件很好地展示了它。甚至显示对依赖项的依赖项。
回答by Dane
You can use JArchitectis a static analysis tool to improve java code quality and it's free for opensource contributors and universities
您可以使用JArchitect是一个静态分析工具来提高 Java 代码质量,它对开源贡献者和大学免费