检查类用于编译&执行(运行时)
我是一个非常大的项目,其中成千上万的课程使用了100台第三方罐子。
我需要找出项目中每个类别使用的罐子的列表以及执行过程中,即运行时。
我该如何实现?很难手动检查很多类,因此我更喜欢一些Eclipse/Intellij Idea插件,这些插件可以为我提供一个报告或任何类型的脚本,这些脚本可以创建类使用的类与JARS的列表。
谢谢。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用Intellij Idea来做到这一点。这真的很简单。
从主菜单中,选择代码 - >分析代码 - > Dependencies
Then select Whole Project and press Analyse
Finaly a window open at the bottom of IDEA and on the right side you can see all dependency used in the project.
All you have to do is navigate in your project (left part) and click on the class for which you want to know the dependency used ;)
PS: You can also Analyse only one classe to see all她使用的依赖性,由Usong定制范围(只需选择您的课程)
You can do that with IntelliJ IDEA. It's really simple.
From the main menu, select Code -> Analyze Code -> Dependencies
Then select Whole Project and press Analyse
Finaly a window open at the bottom of IDEA and on the right side you can see all dependency used in the project.
All you have to do is navigate in your project (left part) and click on the class for which you want to know the dependency used ;)
PS: You can also Analyse only one classe to see all the dependency she used, by usong the custom scope (just select your classes)
我建议您在Java命令执行中添加
-verbose:class
。这将散发出运行时加载的任何类,并从中加载罐子。与Intellij的代码分析工具不同,此方法还将适用于使用反射加载的类。I suggest you add
-verbose:class
to your java command execution. This will emit any class being loaded during runtime, and the jar it was loaded from. Unlike the code analysis tool from IntelliJ, this method will also work for classes loaded using reflection.