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).
1) Use maven dependency plugin
Create a simple project with
pom.xmlonly. Add your dependency and run:(Version for multi-module Maven project:
mvn compile dependency:tree)Unfortunately dependency mojo must use
pom.xmlor you get following error:2) Find
pom.xmlof your artifact in maven central repositoryDependencies are described In
pom.xmlof your artifact. Find it using maven infrastructure.Go to https://central.sonatype.com and enter your
groupIdandartifactId.Or you can go to https://repo1.maven.org/maven2/ and navigate first using plugins
groupId, later usingartifactIdand finally using its version.For example see org.springframework:spring-core
3) Use maven dependency plugin against your artifact
Part of dependency artifact is a
pom.xml. That specifies it’s dependency. And you can executemvn dependency:treeon this pom.