How to get the Maven Dependency Tree of a Project. We can run mvn dependency:tree command in the terminal to print the project dependency tree. For our example, I will be using the Mockito Tutorial project. You can download the project from the GitHub repository.
A project's dependency tree can be filtered to locate specific dependencies. For example, to find out why Velocity is being used by the Maven Dependency Plugin, we can execute the following in the project's directory: mvn dependency:tree -Dincludes=velocity:velocity.
A tree-based API for resolution of Maven project dependencies. Component entry point is DependencyGraphBuilder , which will delegate to appropriate implementation for either Maven 2, Maven 3.0. x or Maven 3.1. x.
The output via mvn -X will printout the information indirectly. Currently there is no other option to get the dependencies of a Maven-Plugin.
Update You can use the following command to get a list of plugin dependencies (resolve-plugin goal from dependencies plugin):
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:resolve-plugins
The shorter version is (and it is a bad habit to specify plugin versions)
mvn dependency:resolve-plugins
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With