Add git commit hash to version

Use profile "release" to create a version without the commit hash
This commit is contained in:
Eric 2017-01-08 17:54:17 +01:00
parent 5a40f84e21
commit b007ffb133

29
pom.xml
View File

@ -7,7 +7,7 @@
<groupId>de.epiceric</groupId> <groupId>de.epiceric</groupId>
<artifactId>ShopChest</artifactId> <artifactId>ShopChest</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.11.1</version> <version>${version.final}</version>
<name>ShopChest</name> <name>ShopChest</name>
<url>https://www.spigotmc.org/resources/shopchest.11431/</url> <url>https://www.spigotmc.org/resources/shopchest.11431/</url>
<description>Let your players create their own nice-looking shops to sell their stuff to other players!</description> <description>Let your players create their own nice-looking shops to sell their stuff to other players!</description>
@ -16,6 +16,9 @@
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.7</maven.compiler.target>
<version.number>1.11.1</version.number>
<version.final>${version.number}-${git.commit.id.abbrev}</version.final>
<github.global.server>github</github.global.server> <github.global.server>github</github.global.server>
<javadoc.opts><!-- Only jdk 1.8 and later --></javadoc.opts> <javadoc.opts><!-- Only jdk 1.8 and later --></javadoc.opts>
@ -31,6 +34,12 @@
<javadoc.opts>-Xdoclint:none</javadoc.opts> <javadoc.opts>-Xdoclint:none</javadoc.opts>
</properties> </properties>
</profile> </profile>
<profile>
<id>release</id>
<properties>
<version.final>${version.number}</version.final>
</properties>
</profile>
</profiles> </profiles>
<repositories> <repositories>
@ -83,7 +92,6 @@
</distributionManagement> </distributionManagement>
<build> <build>
<finalName>${project.artifactId}</finalName>
<resources> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
@ -144,6 +152,23 @@ Timestamp: ${maven.build.timestamp}
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.1.5</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<generateGitPropertiesFile>false</generateGitPropertiesFile>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>