更新时间:2022-12-13 11:26:26
在 CLI 上,使用 mvn 依赖:树
(这里有一些额外的使用说明)
On the CLI, use mvn dependency:tree
(Here are some additional Usage notes)
在多模块maven项目上运行dependency:tree
时,使用mvn compile dependency:tree
代替1.
When running dependency:tree
on multi-module maven project, use mvn compile dependency:tree
instead1.
另外,M2Eclipse(Eclipse的Maven集成)中的POM编辑器非常好,它包括一个分层依赖视图.
Otherwise, the POM Editor in M2Eclipse (Maven integration for Eclipse) is very good, and it includes a hierarchical dependency view.
1如果你不编译,你可能会得到错误 Failed to execute goal on project baseproject: could not resolve dependencies for project com.company:childproject:jar:1.0.0:找不到工件
.这可能是因为 dependency:tree
命令没有构建项目并且没有解析依赖关系,并且您的项目没有安装在 maven 存储库中.
1If you don't compile, you might get error Failed to execute goal on project baseproject: Could not resolve dependencies for project com.company:childproject:jar:1.0.0: Could not find artifact
. This might happen because dependency:tree
command doesn't build projects and doesn't resolve dependencies, and your projects are not installed in maven repository.