I am using the following maven pom.xml snippet to read a property called BUILD_NUMBER from a file jenkins/version.properties.
<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 also has an environment variable called $BUILD_NUMBER. I have child pom.xmls which try and use the $BUILD_NUMBER, and it keeps picking up the Jenkins environment variable value for $BUILD_NUMBER instead of the one from jenkins/version.properties. I am just wondering if maven puts values it reads from files into the environment? If so, it looks as though Jenkins is over writing this value...