In Maven 2, how do I know from which dependency comes a transitive dependency?

怎甘沉沦 提交于 2019-11-29 18:54:46

To add to @David Crow, here's a dependency:tree example from the Maven site:

mvn dependency:tree -Dincludes=velocity:velocity

might output

[INFO] [dependency:tree]
[INFO] org.apache.maven.plugins:maven-dependency-plugin:maven-plugin:2.0-alpha-5-SNAPSHOT
[INFO] \- org.apache.maven.doxia:doxia-site-renderer:jar:1.0-alpha-8:compile
[INFO]    \- org.codehaus.plexus:plexus-velocity:jar:1.1.3:compile
[INFO]       \- velocity:velocity:jar:1.4:compile

Using the Maven Dependency Plugin:

mvn dependency:tree

If you use eclipse and the m2eclipse plugin (http://m2eclipse.sonatype.org) then there is a graphical version of dependency tree where you can filter by scope etc.

You can have many reports by

mvn site

One of them is the dependency report.

If you run maven with "-x" switch, it will print out plenty of diagnostics, I guess the relevant dependency path can be picked up from there.

The dependency information is also included in the Project Information/Dependencies report if you have maven generate a site for the project, using mvn site.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!