如何在eclipse中查找项目依赖项?eclipse 如何构建类路径?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7310314/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:57:05  来源:igfitidea点击:

How to find project dependencies in eclipse? how eclipse builds the class path?

eclipse

提问by mice

There is a project that in some way other project indirectly depends on. I'm trying to find the path of dependencies or the dependencies graph in eclipse but can't find a way.

有一个项目以某种方式间接依赖于其他项目。我试图在 eclipse 中找到依赖关系的路径或依赖关系图,但找不到方法。

any way to do that ?

有什么办法吗?

回答by Michael Borgwardt

Right-click the project, then select "Properties", then "Java Build Path". The tabs "Projects" and "Libraries" list what the project depends on. Note that the "Order and Export" tab alllows you to have indirect dependencies.

右键单击该项目,然后选择“属性”,然后选择“Java 构建路径”。“项目”和“库”选项卡列出了项目所依赖的内容。请注意,“订购和导出”选项卡允许您拥有间接依赖关系。

All the information here is saved in a file named .classpathin the project; if you want to find specific dependencies in a large workspace, then doing a text search over these files would be the fastest solution.

这里的所有信息都保存在.classpath项目中命名的文件中;如果您想在大型工作区中查找特定的依赖项,那么对这些文件进行文本搜索将是最快的解决方案。

回答by Rik

Install the Eclipse Project Dependencies Viewer (https://code.google.com/p/epdv/). It'll give you a nice diagram of your project dependencies.

安装 Eclipse 项目依赖项查看器 ( https://code.google.com/p/epdv/)。它会给你一个很好的项目依赖关系图。

回答by Rai

There is command based option as well. Go to the root folder of your project(you will see pom file in there) On your command prompt type "mvn dependency:tree", this should print all the dependency your project has on your console.

还有基于命令的选项。转到您项目的根文件夹(您将在其中看到 pom 文件)在您的命令提示符下键入“mvn dependency:tree”,这应该会在您的控制台上打印您的项目的所有依赖项。

You can redirect console output to a file, in case dependency tree is too big to fit in console; it is always easy to review this in a file.

您可以将控制台输出重定向到文件,以防依赖树太大而无法放入控制台;在文件中查看它总是很容易的。