excludesList parameter usage in versions:update-properties

こ雲淡風輕ζ 提交于 2019-12-24 08:25:20

问题


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>
.
.

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

I have done the following:

.
.
<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>
.
.

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

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.

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

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.


回答1:


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>
.
.


来源:https://stackoverflow.com/questions/42954730/excludeslist-parameter-usage-in-versionsupdate-properties

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!