Last active
August 16, 2016 05:50
-
-
Save jmini/8ae1c8d6a9aae63e6f6e81b31162d179 to your computer and use it in GitHub Desktop.
Load the GIT commit id and reuse it in your maven build
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>example</groupId> | |
<artifactId>sample-pom</artifactId> | |
<version>0.1</version> | |
<packaging>pom</packaging> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>pl.project13.maven</groupId> | |
<artifactId>git-commit-id-plugin</artifactId> | |
<version>2.2.1</version> | |
<executions> | |
<execution> | |
<id>get-the-git-infos</id> | |
<goals> | |
<goal>revision</goal> | |
</goals> | |
</execution> | |
</executions> | |
<configuration> | |
<skipPoms>false</skipPoms> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>com.github.ekryd.echo-maven-plugin</groupId> | |
<artifactId>echo-maven-plugin</artifactId> | |
<version>1.2.0</version> | |
<executions> | |
<execution> | |
<phase>package</phase> | |
<goals> | |
<goal>echo</goal> | |
</goals> | |
<configuration> | |
<message>GIT commit id: ${git.commit.id}</message> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment