Skip to content

Commit

Permalink
JENKINS-25873: Added git short SHA to version number
Browse files Browse the repository at this point in the history
  • Loading branch information
Bue Petersen committed Dec 2, 2014
1 parent f7ce714 commit 026ca1d
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions pom.xml
Expand Up @@ -9,6 +9,12 @@
<url>http://wiki.jenkins-ci.org/display/JENKINS/Pretested+Integration+Plugin</url>
<name>Pretested integration</name>
<artifactId>pretested-integration</artifactId>
<!--
Using the buildnumber-maven-plugin and the maven-hpi-plugin configuration below
the plugin will show up with at version number like:
major.minor.patch-SNAPSHOT-gitSHA (dev builds)
major.minor.patch-gitSHA (releases)
-->
<version>2.2.0-SNAPSHOT</version>
<packaging>hpi</packaging>

Expand Down Expand Up @@ -79,6 +85,57 @@

<build>
<plugins>
<!--
Enabled us to use custom build numbers for the plugin and
relate them to a git SHA. Very usefull for snapshots and non-releases
that goes to manual validation.
With this plugin and the maven-hpi-plugin configuration below
the plugin will show up with at version number like:
major.minor.patch-SNAPSHOT-gitSHA (dev builds)
major.minor.patch-gitSHA (releases)
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.3</version> <!-- Need newest version to get bugfixes compared to parent pom -->
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<!--
Fail build if there are local modifications.
Add -Dmaven.buildNumber.doCheck=false to skip in your local
builds
-->
<doCheck>true</doCheck>
<!-- Git SHA of 5 should be more than enough for uniqueness in combo with version number -->
<shortRevisionLength>5</shortRevisionLength>
</configuration>
</plugin>

<!--
This produces the hpi file for Jenkins plugins.
We reconfigure it here to add version information and a newer version
It would have been nice if we could signal dirty workspaces on the version
but buildnumber-maven-plugin does not support it. Neither does one like it:
https://github.com/code54/buildversion-plugin
-->
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<version>1.109</version> <!-- Older version have some problems with writing the manifest file -->
<configuration>
<pluginVersionDescription>${buildNumber}</pluginVersionDescription>
<compatibleSinceVersion>2.0</compatibleSinceVersion>
</configuration>
</plugin>


<!--
Use java 1.7. We need this for our testing environment
-->
Expand Down

0 comments on commit 026ca1d

Please sign in to comment.