Skip to content
This repository
Browse code

Automatically suffix git hash in the packaged JAR name

  • Loading branch information...
commit 17e4aeab8da99cd0b541dd7dec2356930f603eb2 1 parent 5460021
Mirco Dotta authored October 07, 2012

Showing 1 changed file with 32 additions and 1 deletion. Show diff stats Hide diff stats

  1. 33  pom.xml
33  pom.xml
@@ -6,6 +6,13 @@
6 6
   <artifactId>scalariform.parent</artifactId>
7 7
   <version>0.1.4-SNAPSHOT</version>
8 8
   <packaging>pom</packaging>
  9
+
  10
+  <!-- scm configuration is require to extract the github hash-->
  11
+  <scm>
  12
+    <connection>scm:git://github.com/mdr/scalariform.git</connection>
  13
+    <url>https://github.com/mdr/scalariform</url>
  14
+  </scm>
  15
+
9 16
   <properties>
10 17
     <tycho.version>0.12.0</tycho.version>
11 18
     <scala.version>2.8.0</scala.version>
@@ -41,13 +48,37 @@
41 48
           <pomDependencies>consider</pomDependencies>
42 49
         </configuration>
43 50
       </plugin>
  51
+      <!-- git hash extractor -->
  52
+      <plugin>
  53
+        <groupId>org.codehaus.mojo</groupId>
  54
+        <artifactId>buildnumber-maven-plugin</artifactId>
  55
+        <version>1.1</version>
  56
+      </plugin>
  57
+      <plugin>
  58
+        <!-- plugin used to extract the git hash and store it in ${buildNumber} -->
  59
+        <groupId>org.codehaus.mojo</groupId>
  60
+        <artifactId>buildnumber-maven-plugin</artifactId>
  61
+        <executions>
  62
+          <execution>
  63
+            <phase>validate</phase>
  64
+            <goals>
  65
+              <goal>create</goal>
  66
+            </goals>
  67
+          </execution>
  68
+        </executions>
  69
+        <configuration>
  70
+          <doCheck>false</doCheck>
  71
+          <doUpdate>false</doUpdate>
  72
+          <shortRevisionLength>7</shortRevisionLength>
  73
+        </configuration>
  74
+      </plugin>
44 75
       <!-- for setting a better qualifier -->
45 76
       <plugin>
46 77
         <groupId>org.eclipse.tycho</groupId>
47 78
         <artifactId>tycho-packaging-plugin</artifactId>
48 79
         <version>${tycho.version}</version>
49 80
         <configuration>
50  
-          <format>yyyyMMddHHmm'-${git.hash}'</format>
  81
+          <format>yyyyMMddHHmm'-${buildNumber}'</format>
51 82
           <archiveSite>true</archiveSite>
52 83
         </configuration>
53 84
       </plugin>    

0 notes on commit 17e4aea

Please sign in to comment.
Something went wrong with that request. Please try again.