我正面临Jenkins Artifactory插件的问题 . 我正在使用Jenkins Artifactory插件 - 发布管理功能来执行我的项目发布 . 我的项目pom有一些我想使用 mvn versions plugin ( versions:update-properties
)更新的快照属性 . 我在我的项目配置中添加了一个shell脚本(参见下文),以便在发布之前更新pom文件 .
如果我将作业作为常规构建运行并按预期更新属性,则构建工作正常 .
但是,当我使用 Artifactory Release Staging 选项运行构建时,即使在运行预步骤之前插件也在验证poms的快照,并且(正确地)失败并且出现错误
[RELEASE] ERROR: Snapshot detected in file '/jenkins/workspace/connector/pom.xml': a.b.c:shared-modules:${modules.version}
作业在发布准备状态之后运行前期步骤 .
pom文件片段
<groupId>a.b.c</groupId>
<artifactId>connector</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version> <!-- will be replaced by release plugin-->
<properties>
<modules.version>1.0-SNAPSHOT</modules.version> <!-- update with mvn versions plugin prior to release-->
<commons-logging.version>1.2</commons-logging.version>
<commons-collections.version>3.2.2</commons-collections.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>a.b.c</groupId>
<artifactId>shared-modules</artifactId>
<version>${modules.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependencies>
</dependencyManagement>
Shell脚本(作为作业中的前一步添加)
#!/bin/bash -e
mvn -f connector/pom.xml versions:update-properties -Dincludes=a.b.c:*
mvn -f connector/pom.xml versions:commit
不确定这是Artifactory插件的问题还是我做错了什么 .
我正在寻找一种在Jenkins Artifactory Plug-in构建期间更新一些属性的方法
任何帮助将不胜感激