I'm running maven builds from TeamCity and making use of build.vcs.number to write the Subversion revision into my manifest. In any Maven build with Subversion as the VCS, TeamCity adds
-Dbuild.vcs.number=1234
to the maven command line, where 1234 is the latest revision in the branch being built.
Then in my pom.xml, I have
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<build>${build.vcs.number}</build>
</manifestEntries>
</archive>
</configuration>
</plugin>
This all works fine until I run Maven release:perform (also from TeamCity), at which point ${build.vcs.number} becomes null, even though I can see in the TeamCity build log that this property was passed in at the command line.
The maven-release-plugin documentation implies that Maven runs a forked process at some point during the perform goal - is this why I have the problem?
Is there a way I can ensure this particular property gets passed through to that forked process?