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
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.
Dependencies are described In pom.xml of your artifact. Find it using maven infrastructure.
Go to http://search.maven.org/ and enter your groupId and artifactId.
Or you can go to http://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 on this pom.