TeamCity

Published: Sunday, 15 December 2013

Teamcity is a commercial Continuous Integration build tool. You can use it for free for up to 20 build configurations. This is enough for small projects. It is easier to setup than Jenkins, which is free.

Adding build time properties

Using maven

Create the file src/main/resources/build.properties.

Add a property in here such as build.number. You can find a list of these at TeamCity 8 Predefined Build Parameters.

build.number=${build.number}

In the pom.xml, turn filtering to true when copying resources.

<build>
  <resources>
    <resource>
      <directory>${basedir}/src/main/resources</directory>
      <filtering>true</filtering>
    </resource>
  </resources>
</build>

The final copy of build.properties will contain the real build number in the placeholder.

Webapp filtered properties

See notes on the mvn war plugin.