How can you display the Maven dependency tree for * plugins * in your project?

A common Maven debugging technique is to use mvn dependency: tree to view the project dependency graph.

However, this list shows the project dependencies, not the plug-in dependency tree for each plug-in. Is there any way to do this from a project?

+109
java plugins maven
Aug 16 2018-11-11T00:
source share
2 answers

Output through mvn -X will print information indirectly. There is currently no other way to get the Maven plugin dependencies.

Update You can use the following command to get the list of plugin dependencies ( target-plugin target from the dependency plugin):

mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:resolve-plugins 

Shorter version (and itโ€™s a bad habit to specify plugin versions)

 mvn dependency:resolve-plugins 
+90
Aug 16 2018-11-11T00:
source share
โ€” -

If you use any IDE, for example IDEA IntelliJ or Eclipse:

  • You can add this plugin below to your pom.xml
  • After that, in the Maven window (to the right of the IDE) you will find a new plugin called dependencies
  • Expand it and you will see the dependency: target tree, double click and run it, you should see the full dependency tree

POM to add to POM:

 <build> <plugins> <plugin> <artifactId>maven-dependency-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> 
0
Aug 07 '19 at 17:42
source share



All Articles