Skip to content

Instantly share code, notes, and snippets.

@cinsk
Created October 24, 2013 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cinsk/7132186 to your computer and use it in GitHub Desktop.
Save cinsk/7132186 to your computer and use it in GitHub Desktop.
Maven project to embed GIT commit information into the output (.jar or .war) file
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<dependencies>
<dependency>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.1.5</version>
</dependency>
<!-- ... -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.1.5</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>src/main/resources/git.properties</generateGitPropertiesFilename>
</configuration>
</plugin>
<!-- ... -->
</plugins>
</build>
<!-- ... -->
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment