Passing properties to Maven based build
2 answers
We are successfully passing the RTC buildLabel property in our Maven builds.
In the .pom, we define:
<properties>
<buildNumber>1.0-SNAPSHOT</buildNumber>
</properties>
also
<version>${buildNumber}</version>
(Note: the "N" in buildNumber tag is a capital "N", it just doesn't display that way)
In the build definition for our release builds, on the "goals" in the Maven tab, we add:
-DbuildNumber=1.0-${buildLabel}
Without the parameter, the developers still run SNAPSHOT buiilds, using 1.0-SNAPSHOT. Our release builds are created with the RTC build label as: MyBuild-1.0-20130402-1000.jar
What doesn't work for us was adding the property in the Properties section, as this doesn't seem to work like it did running ANT builds.