本文介绍了版本中的excludesList参数用法:update-properties的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的pom中有以下内容:

I have the following in my pom:

.
.
<properties>
    <x.version>1.1</x.version>
    <y.version>1.2</y.version>
    <z.version>1.3</z.version>
</properties>
.
.
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>versions-maven-plugin</artifactId>
</plugin>
.
.

我想使用exludesList(或includesList)来仅更新x的版本(并保持yz手动更新).

I want to use exludesList (or includesList) to update the version of only x (and keep y and z to be updated manually).

我已完成以下操作:

.
.
<properties>
    <x.version>1.1</x.version>
    <y.version>1.2</y.version>
    <z.version>1.3</z.version>
    <versions.excludesList>
        y_groupId:y_artifactId*,
        z_groupId:z_artifactId*
    </versions.excludesList>
</properties>
.
.
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>versions-maven-plugin</artifactId>
    <configuration>
        <excludesList>
            ${versions.excludesList}
        </excludesList>
    </configuration>
</plugin>
.
.

,我正在运行以下命令(它将更新所有内容):mvn -U versions:update-properties -e scm:diff -e "-Dmessage=updated version numbers" scm:checkin

and I am running the following command (which update everything):mvn -U versions:update-properties -e scm:diff -e "-Dmessage=updated version numbers" scm:checkin

我试图通过仅使用一个带有excludes的项来简化它,因为excludesList似乎仅用于命令行,如所述此处:

I have tried to simplify it by using only one item with excludes as excludesList seems to be for command line only as mentioned here :

    .
.
<properties>
    <x.version>1.1</x.version>
    <y.version>1.2</y.version>
    <z.version>1.3</z.version>
</properties>
.
.
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>versions-maven-plugin</artifactId>
    <configuration>
        <excludes>
            <exclude>y_groupId:y_artifactId*</exclude>
        </excludes>
    </configuration>
</plugin>
.
.

尽管我使用的方式与此处.我不确定我没有使用哪一点.

And it's not working although I am using it the same way it used in here.I am not sure what bit I am not using right.

我还尝试将-Dexcludes=y_groupId:y_artifactId*添加到命令中,但它似乎也不起作用.

I have also tried to add -Dexcludes=y_groupId:y_artifactId* to the command and it doesn't seem to be working either.

注意:上面是简化版本,我有很多模块,我不想编辑命令,我需要在pom中做所有事情.

note: the above is a simplified version, I got a lot of modules, I don't want to edit my command, I need to do everything in the pom.

推荐答案

就像添加版本一样简单:

as easy as adding the version:

.
.
<properties>
    <x.version>1.1</x.version>
    <y.version>1.2</y.version>
    <z.version>1.3</z.version>
</properties>
.
.
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>versions-maven-plugin</artifactId>
    <version>2.3</version>
    <configuration>
        <excludes>
            <exclude>y_groupId:y_artifactId*</exclude>
        </excludes>
    </configuration>
</plugin>
.
.

这篇关于版本中的excludesList参数用法:update-properties的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 23:23