How can I view transitive dependencies of a Maven pom.xml file?

On the CLI, use mvn dependency:tree
(Here are some additional Usage notes)

When running dependency:tree on multi-module maven project, use mvn compile dependency:tree instead1.

Otherwise, the POM Editor in M2Eclipse (Maven integration for Eclipse) is very good, and it includes a hierarchical dependency view.

1If you don’t compile, you might get error Failed to execute goal on project baseproject: Could not resolve dependencies for project Could not find artifact. This might happen because dependency:tree command doesn’t build projects and doesn’t resolve dependencies, and your projects are not installed in maven repository.

Leave a Comment