[英]What is the supported way to change version on deploy for artifactory maven jenkins plugin
Im using the maven jfrog plugin: https://jenkins.io/doc/pipeline/steps/artifactory/#rtmavendeployer-set-maven-deployer我正在使用 maven jfrog 插件: https://jenkins.io/doc/pipeline/steps/artifactory/#rtmavendeployer-set-maven-deployer
I want to change the version of the artifact on deploy so it has the feature branch name in it我想在部署时更改工件的版本,以便其中包含功能分支名称
I tried to run the set version goal.我试图运行设定的版本目标。 it succeeds but just totally ignores the version
它成功了,但完全忽略了版本
rtMavenRun (
pom: "pom.xml",
goals: 'versions:set -DnewVersion=1.2.3-SNAPSHOT clean install',
resolverId: 'resolver-unique-id',
deployerId: 'deployer-unique-id'
)
The problem is the following: You call the goal versions:set
and the phases clean
and install
in one Maven run.问题如下:您将目标
versions:set
和阶段clean
并install
在一次 Maven 运行中。 Before the first goal runs, Maven has already resolved the version for all goals/phases that are run.在第一个目标运行之前,Maven 已经解决了所有运行的目标/阶段的版本。 Therefore, you change the version in the POM, but as Maven has already read it, you will not be able to see it during this run.
因此,您更改了 POM 中的版本,但由于 Maven 已经读取它,因此在此运行期间您将无法看到它。
What are possible solutions?有哪些可能的解决方案?
versions:set
first and then clean install
in a separate Maven run.versions:set
,然后在单独的 Maven 运行中进行全新clean install
。${revision}
in the definition of <version>
and then set this property on the command line.<version>
的定义中使用属性${revision}
,然后在命令行上设置此属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.