Configured hibernate-tutorials to use the plugin
authorKai Moritz <km@juplo.de>
Tue, 5 May 2015 10:43:15 +0000 (12:43 +0200)
committerKai Moritz <km@juplo.de>
Sat, 16 May 2015 14:02:06 +0000 (16:02 +0200)
12 files changed:
src/it/tutorials/annotations/pom.xml
src/it/tutorials/annotations/src/test/resources/hibernate.cfg.xml
src/it/tutorials/basic/pom.xml
src/it/tutorials/basic/src/test/resources/hibernate.cfg.xml
src/it/tutorials/entitymanager/pom.xml
src/it/tutorials/entitymanager/src/test/resources/META-INF/persistence.xml
src/it/tutorials/envers/pom.xml
src/it/tutorials/envers/src/test/resources/META-INF/persistence.xml
src/it/tutorials/osgi/managed-jpa/pom.xml
src/it/tutorials/osgi/unmanaged-jpa/pom.xml
src/it/tutorials/osgi/unmanaged-native/pom.xml
src/it/tutorials/pom.xml

index 50a9a9e..fc816f6 100644 (file)
     <properties>
         <!-- Skip artifact deployment -->
         <maven.deploy.skip>true</maven.deploy.skip>
+        <h4mp.version>@project.version@</h4mp.version>
     </properties>
 
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>de.juplo</groupId>
+                <artifactId>hibernate4-maven-plugin</artifactId>
+                <version>${h4mp.version}</version>
+                <executions>
+                    <execution>
+                        <phase>process-test-classes</phase>
+                        <goals>
+                            <goal>export</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <scanTestClasses>true</scanTestClasses>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
index aa1abfd..d9ae1f5 100644 (file)
@@ -32,7 +32,7 @@
 
         <!-- Database connection settings -->
         <property name="connection.driver_class">org.h2.Driver</property>
-        <property name="connection.url">jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE</property>
+        <property name="connection.url">jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE</property>
         <property name="connection.username">sa</property>
         <property name="connection.password"></property>
 
@@ -48,9 +48,6 @@
         <!-- Echo all executed SQL to stdout -->
         <property name="show_sql">true</property>
 
-        <!-- Drop and re-create the database schema on startup -->
-        <property name="hbm2ddl.auto">create</property>
-
         <!-- Names the annotated entity class -->
         <mapping class="org.hibernate.tutorial.annotations.Event"/>
 
index 49d2635..5a064d4 100644 (file)
     <properties>
         <!-- Skip artifact deployment -->
         <maven.deploy.skip>true</maven.deploy.skip>
+        <h4mp.version>@project.version@</h4mp.version>
     </properties>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>de.juplo</groupId>
+                <artifactId>hibernate4-maven-plugin</artifactId>
+                <version>${h4mp.version}</version>
+                <executions>
+                    <execution>
+                        <phase>process-test-classes</phase>
+                        <goals>
+                            <goal>export</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <scanTestClasses>true</scanTestClasses>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
index dc79584..8144f2d 100644 (file)
@@ -32,7 +32,7 @@
 
         <!-- Database connection settings -->
         <property name="connection.driver_class">org.h2.Driver</property>
-        <property name="connection.url">jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE</property>
+        <property name="connection.url">jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE</property>
         <property name="connection.username">sa</property>
         <property name="connection.password"/>
 
index 6df9240..5ec5b69 100644 (file)
@@ -40,6 +40,7 @@
     <properties>
         <!-- Skip artifact deployment -->
         <maven.deploy.skip>true</maven.deploy.skip>
+        <h4mp.version>@project.version@</h4mp.version>
     </properties>
 
     <dependencies>
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>de.juplo</groupId>
+                <artifactId>hibernate4-maven-plugin</artifactId>
+                <version>${h4mp.version}</version>
+                <executions>
+                    <execution>
+                        <phase>process-test-classes</phase>
+                        <goals>
+                            <goal>export</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <scanTestClasses>true</scanTestClasses>
+                    <hibernateDialect>org.hibernate.dialect.H2Dialect</hibernateDialect>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
index 07a891d..ac11225 100644 (file)
@@ -35,7 +35,7 @@
 
         <properties>
             <property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
-            <property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE" />
+            <property name="javax.persistence.jdbc.url" value="jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE" />
             <property name="javax.persistence.jdbc.user" value="sa" />
             <property name="javax.persistence.jdbc.password" value="" />
 
index 595df37..9980de3 100644 (file)
@@ -40,6 +40,7 @@
     <properties>
         <!-- Skip artifact deployment -->
         <maven.deploy.skip>true</maven.deploy.skip>
+        <h4mp.version>@project.version@</h4mp.version>
     </properties>
 
     <dependencies>
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>de.juplo</groupId>
+                <artifactId>hibernate4-maven-plugin</artifactId>
+                <version>${h4mp.version}</version>
+                <executions>
+                    <execution>
+                        <phase>process-test-classes</phase>
+                        <goals>
+                            <goal>export</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <scanTestClasses>true</scanTestClasses>
+                    <hibernateDialect>org.hibernate.dialect.H2Dialect</hibernateDialect>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
index ddafb8b..fae7276 100644 (file)
@@ -35,7 +35,7 @@
 
         <properties>
             <property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
-            <property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE" />
+            <property name="javax.persistence.jdbc.url" value="jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE" />
             <property name="javax.persistence.jdbc.user" value="sa" />
             <property name="javax.persistence.jdbc.password" value="" />
 
index 1810286..08ef2fe 100755 (executable)
@@ -6,6 +6,10 @@
        <version>1.0.0</version>
     <packaging>bundle</packaging>
 
+       <properties>
+               <h4mp.version>@project.version@</h4mp.version>
+       </properties>
+
        <dependencies>
                <dependency>
                        <groupId>org.hibernate.javax.persistence</groupId>
             <artifactId>org.apache.karaf.shell.console</artifactId>
             <version>2.3.0</version>
         </dependency>
+        <dependency>
+            <groupId>com.h2database</groupId>
+            <artifactId>h2</artifactId>
+            <version>1.4.187</version>
+        </dependency>
        </dependencies>
 
        <build>
                                        </instructions>
                                </configuration>
                        </plugin>
+                       <plugin>
+                               <groupId>de.juplo</groupId>
+                               <artifactId>hibernate4-maven-plugin</artifactId>
+                               <version>${h4mp.version}</version>
+                               <executions>
+                                       <execution>
+                                               <goals>
+                                                       <goal>export</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                               <configuration>
+                                       <url>jdbc:h2:mem:db1;MVCC=TRUE</url>
+                               </configuration>
+                       </plugin>
                </plugins>
        </build>
 </project>
index 9b6592f..259540e 100755 (executable)
@@ -6,6 +6,10 @@
        <version>1.0.0</version>
     <packaging>bundle</packaging>
 
+       <properties>
+               <h4mp.version>@project.version@</h4mp.version>
+       </properties>
+
        <dependencies>
                <dependency>
             <groupId>org.hibernate.javax.persistence</groupId>
                                        </instructions>
                                </configuration>
                        </plugin>
+                       <plugin>
+                               <groupId>de.juplo</groupId>
+                               <artifactId>hibernate4-maven-plugin</artifactId>
+                               <version>${h4mp.version}</version>
+                               <executions>
+                                       <execution>
+                                               <goals>
+                                                       <goal>export</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                       </plugin>
                </plugins>
        </build>
 </project>
index c0126bf..cd33736 100755 (executable)
@@ -6,6 +6,10 @@
        <version>1.0.0</version>
     <packaging>bundle</packaging>
 
+       <properties>
+               <h4mp.version>@project.version@</h4mp.version>
+       </properties>
+
        <dependencies>
                <dependency>
             <groupId>org.hibernate.javax.persistence</groupId>
                                        </instructions>
                                </configuration>
                        </plugin>
+                       <plugin>
+                               <groupId>de.juplo</groupId>
+                               <artifactId>hibernate4-maven-plugin</artifactId>
+                               <version>${h4mp.version}</version>
+                               <executions>
+                                       <execution>
+                                               <goals>
+                                                       <goal>export</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                       </plugin>
                </plugins>
        </build>
 </project>
index 37e4f1f..e899e4c 100644 (file)
@@ -89,6 +89,7 @@
             </testResource>
             <testResource>
                 <directory>src/test/resources</directory>
+                <filtering>true</filtering>
             </testResource>
         </testResources>
         <plugins>