dependency:tree
can be used to see the dependency tree for a given project. But what I need is to see the dependency tree for a 3rd party artifact.
I guess I can create an empty project, but I'm looking for something easier (I need to do this for several artifacts).
Create a simple project with pom.xml
only. Add your dependency and run:
mvn dependency:tree
(Version for multi-module Maven project: mvn compile dependency:tree
)
Unfortunately dependency mojo must use pom.xml
or you get following error:
Cannot execute mojo: tree. It requires a project with an existing
pom.xml
, but the build is not using one.
pom.xml
of your artifact in maven central repositoryDependencies are described In pom.xml
of your artifact. Find it using maven infrastructure.
Go to https://central.sonatype.com and enter your groupId
and artifactId
.
Or you can go to https://repo1.maven.org/maven2/ and navigate first using plugins groupId
, later using artifactId
and finally using its version.
For example see org.springframework:spring-core
Part of dependency artifact is a pom.xml
. That specifies it's dependency. And you can execute mvn dependency:tree -f <your-pom-filename>
on this pom.