简体   繁体   English

如何在Versions Maven插件中隐藏继承的依赖项?

[英]How to hide inherited dependencies in Versions Maven Plugin?

I'm trying to use Versions Maven Plugin , together with spring-boot . 我正在尝试使用Versions Maven Pluginspring-boot

Problem: when running versions:display-dependency-updates to autoecheck for latest dependencies, I'm not only getting the updates defined in my pom.xml , but also all inherited dependencies from spring-boot-starter-parent . 问题:当运行versions:display-dependency-updates to autoecheck for latest dependencies时,我不仅获得了我的pom.xml定义的更新,还获得了spring-boot-starter-parent所有继承的依赖spring-boot-starter-parent

Question: how can I prevent inheritance and just show the self-defined dependencies? 问题:如何防止继承并显示自定义依赖项?

<project>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.0.RELEASE</version>
    </parent>


    <properties>
    <cxf.version>3.0.0</cxf.version>
    </properties>

    <dependencies>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>${cxf.version}</version>
    </dependency>
    </dependencies>
</project>

At best, the plugin would inform me of updates similar to: 充其量,插件会告诉我类似的更新:

spring-boot-starter-parent.....2.0.0 -> 2.0.3
cxf-rt-frontend-jaxws..........3.0.0 -> 3.2.6

But instead, I'm getting output an all dependencies inherited from the spring parent. 但相反,我得到输出从spring父级继承的所有依赖项。

You can use the versions:display-property-updates goal instead. 您可以使用以下versions:display-property-updates目标。 This goal only considers the dependency versions that are given as properties, so it will not show the transitive dependencies. 此目标仅考虑作为属性提供的依赖项版本,因此它不会显示传递依赖项。 You'll have to add a few more version properties to your pom, but that's not a bad thing in general. 你必须在你的pom中添加一些版本属性,但这一般不是坏事。

The documentation for the versions:display-dependency-updates goal does not include a flag to exclude transitive dependencies. versions:display-dependency-updates的文档versions:display-dependency-updates目标不包括用于排除传递依赖项的标志。 So I assume it's not possible using that goal. 所以我认为不可能使用这个目标。 I couldn't find any relevant open issues on issues.apache.org either, so it doesn't seem to be on the roadmap. 我在issues.apache.org上找不到任何相关的公开问题,所以它似乎不在路线图上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM