开发者

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

A common Maven debugging technique is 开发者_StackOverflow社区to use mvn dependency:tree to view the graph of project dependencies.

However, this list shows the project dependencies, not the plugin dependency tree for each plugin. Is there some way to do this from a project?


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 are using any IDE like IDEA IntelliJ or Eclipse:

  • You can add this below plugin in your pom.xml
  • Once done, On the Maven window (on the right of IDE), you will find a new plugin called as Dependencies
  • Expand that and you will see the dependency:tree goal, double click on it and run it, you should see the full dependency tree

Plugin to be added in POM:

<build>
    <plugins>
        <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜