On Mon, 2021-02-15 at 08:11 +0700, Andreas Reichel wrote:
> this is where a "Build ID" or "Commit ID" would become handy, packing
> into "h2-2.0.201_888e228.jar" instead of "h2-2.0.201" only.

Patch attached.
Best regards

Andreas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/c7a0927f6ce11a2d0ba23b954e3877d5143d399a.camel%40manticore-projects.com.
diff --git a/h2/pom.xml b/h2/pom.xml
index 027897f..130efe8 100644
--- a/h2/pom.xml
+++ b/h2/pom.xml
@@ -1,5 +1,5 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";>
   <modelVersion>4.0.0</modelVersion>
 
   <groupId>com.h2database</groupId>
@@ -69,9 +69,9 @@
       <version>${lucene.version}</version>
     </dependency>
     <dependency>
-        <groupId>org.apache.lucene</groupId>
-        <artifactId>lucene-queryparser</artifactId>
-        <version>${lucene.version}</version>
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-queryparser</artifactId>
+      <version>${lucene.version}</version>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
@@ -125,7 +125,7 @@
   </dependencies>
 
   <!-- The test code creates proxy files using javac or tools.jar. Through maven we need to tell it
-       where to possibly find tools.jar and annoyingly its called classes.jar on OSX -->
+  where to possibly find tools.jar and annoyingly its called classes.jar on OSX -->
   <profiles>
     <profile>
       <id>jigsaw-jdk</id>
@@ -172,6 +172,7 @@
 
   <build>
     <sourceDirectory>src/main</sourceDirectory>
+    <finalName>${project.artifactId}-${project.version}-${git.commit.id.describe-short}</finalName>
     <testSourceDirectory>src/test</testSourceDirectory>
     <!-- Resources do not follow maven project layout. We need to manually copy them -->
     <resources>
@@ -200,19 +201,19 @@
       </resource>
     </resources>
     <testResources>
-  <testResource>
-    <directory>src/test</directory>
-      <includes>
-        <include>org/h2/test/bench/test.properties</include>
-        <include>org/h2/test/script/testScrip.sql</include>
-        <include>org/h2/test/scripts/**/*.sql</include>
-        <include>org/h2/samples/newsfeed.sql</include>
-        <include>org/h2/samples/optimizations.sql</include>
-      </includes>
-    </testResource>
+      <testResource>
+        <directory>src/test</directory>
+        <includes>
+          <include>org/h2/test/bench/test.properties</include>
+          <include>org/h2/test/script/testScrip.sql</include>
+          <include>org/h2/test/scripts/**/*.sql</include>
+          <include>org/h2/samples/newsfeed.sql</include>
+          <include>org/h2/samples/optimizations.sql</include>
+        </includes>
+      </testResource>
     </testResources>
     <plugins>
-    <plugin>
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-enforcer-plugin</artifactId>
         <version>3.0.0-M3</version>
@@ -226,7 +227,7 @@
               <rules>
                 <requireFilesExist>
                   <files>
-                   <file>src/main/org/h2/res/help.csv</file>
+                    <file>src/main/org/h2/res/help.csv</file>
                   </files>
                   <message>
 <![CDATA[
@@ -290,7 +291,32 @@
           </includes>
         </configuration>
       </plugin>
-
+      <plugin>
+        <groupId>pl.project13.maven</groupId>
+        <artifactId>git-commit-id-plugin</artifactId>
+        <version>2.2.4</version>
+        <executions>
+          <execution>
+            <id>get-the-git-infos</id>
+            <goals>
+              <goal>revision</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
+          <prefix>git</prefix>
+          <verbose>false</verbose>
+          <generateGitPropertiesFile>true</generateGitPropertiesFile>
+          <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
+          <format>json</format>
+          <gitDescribe>
+            <skip>false</skip>
+            <always>false</always>
+            <dirty>-dirty</dirty>
+          </gitDescribe>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 

Reply via email to