【发布时间】:2019-02-19 18:11:55
【问题描述】:
我创建了一个 jenkins 作业,我将 ReleaseNumber 作为参数传递,我希望在每个 pom.xml 文件(根和子 pom)中更新此 ReleaseNumber,因为我将这些战争上传到 nexus 存储库,相同版本号码不会被 nexus 接受。 我也想更新子 pom 版本和父 pom 版本。 我正在使用 maven 3.5
我正在使用这个我认为它不起作用的命令
mvn org.codehaus.mojo:versions-maven-plugin:2.5:set -DnewVersion-${ReleaseNumber}
这是我父母 pom 的样子
<modelVersion>4.0.0</modelVersion>
<groupId>com.test.test</groupId>
<artifactId>Wars</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
这是我的孩子 pom 的样子
<parent>
<groupId>com.test.test</groupId>
<artifactId>TestWar</artifactId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.test.test.testwar</groupId>
<artifactId>TestWar</artifactId>
<version>1.0.0</version>
<packaging>war</packaging>
<name>testWar</name>
提前致谢
【问题讨论】:
-
“我认为它不起作用”是什么意思?
-
@JFMeier 我的意思是这个命令没有更新我的 pom 版本号
-
@suneel 它在日志中写入了什么?有什么错误吗?
-
@JFMeier 它没有给出任何错误,只是一些警告,因为它没有更新所有子 pom 中的版本,所以它无法找到父 pom 然后它给出错误