Maven Versions Plugin是否也从类路径中读取规则?

问题描述 投票:2回答:1

Maven Versions Plugin支持defintion of rulesversions:display-plugin-updatesversions:display-dependency-updates定制目标的版本解析过程。规则文件的位置可以由rulesUri指定,其背后的功能由Maven Wagon提供。

因此,我想知道是否也支持在Jar中提供规则集?我想为多个项目设置一个规则集。

maven versions-maven-plugin maven-versions-plugin
1个回答
0
投票

我的版本已经发布了2.5版的Versions Maven Plugin

因此,可以创建版本规则文件并将其放在类路径上。

下面的示例显示了如何引用名为rules.xml的规则文件,该文件在类路径的jar中提供:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>versions-maven-plugin</artifactId>
    <version>2.7</version>
    <executions>
        <execution>
            <id>default-cli</id>
            <configuration>
                <rulesUri>classpath:///rules.xml</rulesUri>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>                                
            <groupId>your.organisation</groupId>
            <artifactId>rulesspec</artifactId>
            <version>1234</version>
        </dependency>
    </dependencies>
</plugin>

请记住,提供的URI必须以classpath://开头。

© www.soinside.com 2019 - 2024. All rights reserved.