我的 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
(or includesList
) 来更新 only 的版本x
(并保留y
并z
手动更新)。
我做了以下事情:
.
.
<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
我试图通过仅使用一项似乎仅用于命令行的项目来简化它,如此excludes
处所述:excludesList
.
.
<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>
.
.
尽管我使用的方式与此处使用的方式相同,但它不起作用。我不确定我使用的不是正确的位。
我也尝试添加-Dexcludes=y_groupId:y_artifactId*
到命令中,但它似乎也不起作用。
注意:以上是简化版,我有很多模块,我不想编辑我的命令,我需要在 pom.xml 中做所有事情。