【发布时间】:2014-10-28 07:45:40
【问题描述】:
我正在尝试使用 maven pom.xml 使用以下代码读取 Jenkins 编号。问题是,构建失败并出现我在下面指定的错误。我参考了JenkinsBuilding a software project给出的官方文档。如果我尝试使用任何文本而不是${BUILD_NUMBER},它会打印在控制台中,而不是变量。
POM 配置文件参考:
<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<build.number>${BUILD_NUMBER}</build.number>
</properties>
</profile>
</profiles>
POM 系统属性:
<systemPropertyVariables>
<buildnumber>${build.number}</buildnumber>
</systemPropertyVariables>
如果我做错了什么,请告诉我。
【问题讨论】:
-
试试
${env.BUILD_NUMBER}