问题
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