如何检查 Jar 文件之间的依赖关系? [英] How To Check Dependencies Between Jar Files?

查看:55
本文介绍了如何检查 Jar 文件之间的依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近接受了用 JSF 编写的 Web 系统的支持和编程.代码有点混乱和冗余,是的,​​不存在文档.

I recently have taken the support and programming of a web system written in JSF. The code is kind of messy and redundant, and yes, no documentation exists.

系统有40多个jar库,其中大部分是由于旧版本和测试造成的冗余.要删除一个 jar,我必须检查它是否未在代码中导入,因此我搜索了 jar 导入路径的代码(我使用的是 IntelliJ IDE),确保它未被使用,然后将其删除.

The system has over 40 jar libraries, and most of them are redundant due to old versions and testing. To remove one jar, I must check that it's not imported in the code, so I searched the code for the jar import path (I'm using IntelliJ IDE), made sure that it's not used, and removed it.

但是,在编译代码后,在测试过程中出现了一些运行时错误.我发现我删除了一些其他现有 jar 使用的 jar.

However, after compiling the code, a number of run-time errors occurred during testing. I figured out that I removed some jars which are used by other existing jars.

问题,在删除一个 jar 之前,我如何确保它不被另一个 jar/java 类使用?

The problem, how do I make sure before removing a jar that it's not used by another jar/java class?

尽管 jars 有编译类,但编译后的类确实具有所需库的导入路径.但我不能用 IntelliJ 搜索它们(不在 jars 文件中搜索).

Despite that jars have compiled classes, the compiled classes do have the import path of required libraries. But I can't search them with IntelliJ (does not search inside jars files).

我现在所做的唯一方法是每次取出 jar 时测试系统,看看是否可以使它崩溃!由于要测试的功能数量庞大,这完全不是一种简单的方法.

The only way that I'm doing now is to test the system every time I remove a jar and see if I can crash it! This is totally not an easy way due to the huge number of features to be tested.

我希望有一个工具可以让我提交多个 java 文件/jar,并显示它们之间的依赖关系.

I wish that there is a tool where I can submit a number of java files/jars, and it displays the dependencies between them.

推荐答案

我知道 JBoss 项目中有一个名为 JBoss TattleTale 的工具,可能值得一看:

I know that there was a tool coming out of the JBoss project called JBoss TattleTale, might be worth taking a look:

http://www.jboss.org/tattletale

这篇关于如何检查 Jar 文件之间的依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆