【发布时间】:2014-07-30 16:11:20
【问题描述】:
我正在使用以下 maven pom.xml sn-p 从文件 jenkins/version.properties 中读取名为 BUILD_NUMBER 的属性。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${project.parent.basedir}/jenkins/version.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
Jenkins 还有一个名为 $BUILD_NUMBER 的环境变量。我有子 pom.xmls 尝试使用 $BUILD_NUMBER,并且它不断获取 $BUILD_NUMBER 的 Jenkins 环境变量值,而不是来自 jenkins/version.properties 的值。我只是想知道 Maven 是否将从文件中读取的值放入环境中?如果是这样,看起来 Jenkins 已经写完了这个值……
【问题讨论】: