Reputation: 1225
I want to see the dependency tree of a project without actually downloading those dependencies.
I have a project whose build fails because there is some dependency which is not present in central repo, however it is not a direct dependency and I am not aware which one of my dependencies refers to it.
Now when I run mvn dependency:tree
command, it builds the project and hence fails.
One way to do it is keep a dummy jar in local repo with the same name. It will not try to download the dependency and generate the entire tree. However is there any other way to do this ?
Upvotes: 6
Views: 5632
Reputation: 10049
Maybe Maven dependency:analyze-only
mvn dependency:analyze-only
Analyzes the dependencies of this project and determines which are: used and declared; used and undeclared; unused and declared. This goal is intended to be used in the build lifecycle, thus it assumes that the test-compile phase has been executed - use the
dependency:analyze
goal instead when running standalone.
mvn dependency:resolve
Upvotes: 1
Reputation: 546
If you are using eclipse there is a "Maven POM Editor", which shows not only the maven XML, but also a dependency hierarchy view. A working build is not necessary for it, just a correct POM XML file.
It should get installed, when you install the eclipse m2e plugin. The update site is http://download.eclipse.org/technology/m2e/releases.
Upvotes: 3