Skip to content

Instantly share code, notes, and snippets.

@britter
Created December 23, 2015 12:40
Show Gist options
  • Save britter/54178dce353f2a8320c8 to your computer and use it in GitHub Desktop.
Save britter/54178dce353f2a8320c8 to your computer and use it in GitHub Desktop.
Extracting a git commit hash using the buildnumber-maven-plugin in conjunction with resource filtering
<scm>
<url>https://github.com/britter/spring-boot-heroku-demo</url>
</scm>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>messages.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>messages.properties</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment