简体   繁体   English

Java库依赖项

[英]Java libraries dependencies

What is the easiest way to see the libraries dependencies in Java project (eclipse)? 在Java项目(eclipse)中查看库依赖项的最简单方法是什么?
I am using Spring MVC and Hibernate so right now there are a lot of jar files and I even do not remember which one of them are responsible for what. 我正在使用Spring MVC和Hibernate,所以现在有很多jar文件,我甚至不记得哪一个负责什么。

See them how? 看他们怎么样?

If you're using maven, use the dependency plugin's dependency:tree to get a hierarchical representation of what depends on what. 如果您正在使用maven,请使用依赖项插件的 dependency:tree来获取依赖于什么的层次结构表示。

If you're not, ew; 如果你不是,那么; manual management of transitive dependencies sucks! 传递依赖的手动管理很糟糕! You can use something like Dependency Finder or JDepend to provide similar info. 您可以使用Dependency FinderJDepend之类的东西来提供类似的信息。

Not sure if this is what you mean, but to start with you can right-click the project (in Eclipse) and look at Properties -> Java Build Path . 不确定这是不是你的意思,但是首先你可以右键单击项目(在Eclipse中)并查看Properties - > Java Build Path The Libraries tab should list what libraries you're using on your build path. Libraries选项卡应列出您在构建路径中使用的库。 (But you probably knew that.) (但你可能知道这一点。)

If it's a simple standalone project, you could of course always remove a library and see what interesting new errors pop up ;-) 如果它是一个简单的独立项目,你当然可以随时删除一个库,看看弹出了哪些有趣的新错误;-)

For more complicated projects with interdependencies, it can take quite a bit of fiddling to get all your dependencies right. 对于具有相互依赖性的更复杂的项目,可能需要花费很多时间才能使所有依赖项正确。 I generally recommend setting up a "core" project which holds (and exports) most of your third-party JARs (better yet, use user libraries , and putting that project on the build path of your other projects. 我通常建议设置一个“核心”项目,它保存(并导出)大多数第三方JAR(更好的是,使用用户库 ,并将该项目放在其他项目的构建路径上。

Edit after reading your comment: Ah, gotcha... you might be interested in the Plug-in Dependency Visualisation incubator project then - haven't used it myself but it sounds like it could do what you're after. 阅读你的评论后编辑:啊,有问题......你可能对Plug-in Dependency Visualization孵化器项目感兴趣 - 我自己没有使用它,但听起来它可以做你想要的事情。 Hope that helps! 希望有所帮助!

看看tattletale。

http://www.jboss.org/tattletale

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

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