Created
May 16, 2013 16:24
-
-
Save leonelag/5593003 to your computer and use it in GitHub Desktop.
Snippet of Maven POM file that creates a file named REV in your project, before packaging.
The contents of the file are the following env variables: SVN_REVISION BUILD_NUMBER BUILD_ID BUILD_TAG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-antrun-plugin</artifactId> | |
<version>1.7</version> | |
<executions> | |
<execution> | |
<phase>prepare-package</phase> | |
<configuration> | |
<target> | |
<echo file="${project.build.directory}/${project.build.finalName}/rev">Svn-Revision: ${env.SVN_REVISION}${line.separator}Build-Number: ${env.BUILD_NUMBER}${line.separator}Build-Id: ${env.BUILD_ID}${line.separator}Build-Tag: ${env.BUILD_TAG}</echo> | |
</target> | |
</configuration> | |
<goals><goal>run</goal></goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment