Dear All,

we have implemented support for H2 Driver Version Snapshots, based on
GIT IDs.
This way, one can easily migrate many H2 databases from one H2 snapshot
to another one.

You can now also add H2 Drivers to the program (e. g. for adding more
snapshots or adding older H2 versions).

There are two caveats though:

1) the GIT ID is parsed from the H2 driver file name only. You will
need to create correct filenames when compiling the H2 snapshots, e. g.
using this patch attached to this e-mail.

2) the GIT ID itself does not say anything about a particular order.
Instead, we maintain the order in a Textfile as part of the Migration
Tool. 
I am looking for a better and more robust solution to this and any idea
was very welcome.

@H2 Developers: Some help or feedback on this snapshot version thing
was much appreciated. I understand that you can't maintain backward
compatibility during the developing cycle and why export to SQL script
is needed.
But at the same time, the lack of a reliable versioning makes it
difficult to maintain many databases. Please consider adding the GIT ID
to the H2 driver filename and also to put it into the Meta Data
somewhere. So we have a chance to know which driver version to use.

Testing many H2 databases against the recent development snapshots has
merrits. We found a few issues this way, which static test cases have
not found before.

Thank you and best regards!

https://github.com/manticore-projects/H2MigrationTool

-- 
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/c0335526a4430ce8057401cc399884f5d11a37bd.camel%40manticore-projects.com.
diff --git a/h2/pom.xml b/h2/pom.xml
index 027897f..ca10b31 100644
--- a/h2/pom.xml
+++ b/h2/pom.xml
@@ -1,10 +1,10 @@
 <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>
   <artifactId>h2</artifactId>
-  <version>2.0.201-SNAPSHOT</version>
+  <version>2.0.201</version>
   <packaging>jar</packaging>
   <name>H2 Database Engine</name>
   <url>https://h2database.com</url>
@@ -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,33 @@
           </includes>
         </configuration>
       </plugin>
-
+      <plugin>
+        <groupId>pl.project13.maven</groupId>
+        <artifactId>git-commit-id-plugin</artifactId>
+        <version>4.0.3</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>
+            <abbrev>9</abbrev>
+          </gitDescribe>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 

Reply via email to