One of the requirement in my project was to create an entry of last SCM Revision number in web application property file every time a release build is done. So that we can show this while user logged in as support and also add this in logging for tracking purpose. We achieved the same using svn-revision-number-maven-plugin.
Add svn revision number maven plugin in your project plugin Management section of pom (in case of parent child maven modules add this in parent pom file)
POM File Svn Revision Number Maven Plugin Configuration
POM.xml
<pluginmanagement>
<plugins>
....
....
....
<plugin>
<groupid>
com.google.code.maven-svn-revision-number-plugin
</groupid>
<artifactid>svn-revision-number-maven-plugin</artifactid>
<version>1.13</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<entries>
<entry>
<prefix>prefix</prefix>
</entry>
</entries>
</configuration>
<dependencies>
<dependency>
<groupid>org.tmatesoft.svnkit</groupid>
<artifactid>svnkit</artifactid>
<version>1.7.11</version>
</dependency>
</dependencies>
</plugin>
....
....
....
</plugins>
</pluginmanagement>
view raw pom.xml hosted with ❤ by GitHub
In case of parent child relation add following in the child project POM
Child Project Pom.xml
<plugin>
<groupId>com.google.code.maven-svn-revision-number-plugin</groupId>
<artifactId>svn-revision-number-maven-plugin</artifactId>
</plugin>
view raw child-pom.xml hosted with ❤ by GitHub
Web Project Property File
build.properties
build.path=${prefix.path}
build.revision.number=${prefix.revision}
build.committed.revision.number=${prefix.committedRevision}
build.committed.date=${prefix.committedDate}
Final result will be some thing like this
result.properties
build.path=branches/1.0.0/xyz-project
build.revision.number=16523
build.committed.revision.number=16521
build.committed.date=2014-05-02 17:57:02 +0530 (Fri, 02 May 2014)