如何在 Maven 中显示插件的依赖性?

How to show dependency of a plugin in Maven?

我想查看 mavenplugin 的传递依赖项,因此我明确了只有一个插件且没有其他工件依赖项的项目以查看此插件依赖项。所以我写

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-xjc-plugin</artifactId>
                <version>2.6.1</version>
                <configuration>
                    <extensions>
                        <extension>org.apache.cxf.xjcplugins:cxf-xjc-dv:2.3.0</extension>
                    </extensions>
                </configuration>

            </plugin>

        </plugins>
</build>
...

和运行

       mvn dependency:tree

输出为:

[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------------------------------------------------
[INFO] Building Sample project  2.0.3-SNAPSHOT
[INFO] ----------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ delete ---
INFO] sample:test:jar:2.0.3-SNAPSHOT
INFO] ------------------------------------------------------------------------
INFO] BUILD SUCCESS

如何查看org.apache.cxf依赖树?

最好的办法是使用目标 resolve-pluginsmaven-dependency-plugin。像这样:

mvn dependency:resolve-plugins