]> juplo.de Git - hibernate4-maven-plugin/commitdiff
JPA-properties must be converted into Hibernate-properties explicitly
authorKai Moritz <kai@juplo.de>
Sun, 6 Nov 2016 13:37:01 +0000 (14:37 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 13 Nov 2016 16:37:15 +0000 (17:37 +0100)
src/it/tutorials/entitymanager/pom.xml
src/it/tutorials/envers/pom.xml
src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java

index a68d7908e633eef5fb80985b766533368a4bf956..9d740a5e23d77bc685770695343b0fbb58305aa6 100644 (file)
@@ -69,8 +69,6 @@
                     <scanTestClasses>true</scanTestClasses>
                     <dialect>org.hibernate.dialect.H2Dialect</dialect>
                     <format>true</format>
-                    <username>sa</username>
-                    <password></password>
                 </configuration>
             </plugin>
         </plugins>
index 7aaac6156d1dc8cdd2fbb8c64794a83b48ac167a..f5d87692c139aa1a6a1c023e709ac4cd22a3df50 100644 (file)
@@ -74,8 +74,6 @@
                     <scanTestClasses>true</scanTestClasses>
                     <dialect>org.hibernate.dialect.H2Dialect</dialect>
                     <format>true</format>
-                    <username>sa</username>
-                    <password></password>
                 </configuration>
             </plugin>
         </plugins>
index ff68ea73f0838d626074d9c946b7d917df897f7f..9006f352d08ed9bb5384eb651a5b1d3968f32ddd 100644 (file)
@@ -960,50 +960,52 @@ public abstract class AbstractSchemaMojo extends AbstractMojo
       String alternativeKey
       )
   {
-    value = configure(properties, value, key);
-    if (value == null)
-      return;
+    configure(properties, value, key);
 
     if (properties.containsKey(alternativeKey))
     {
-      getLog().warn(
-          "Ignoring property " + alternativeKey + "=" +
-          properties.getProperty(alternativeKey) + " in favour for property " +
-          key + "=" + properties.getProperty(key)
-          );
-      properties.remove(alternativeKey);
+      if (properties.containsKey(key))
+      {
+        getLog().warn(
+            "Ignoring property " + alternativeKey + "=\"" +
+            properties.getProperty(alternativeKey) +
+            "\" in favour for property " + key + "=\"" +
+            properties.getProperty(key) + "\""
+            );
+        properties.remove(alternativeKey);
+      }
+      else
+      {
+        value = properties.getProperty(alternativeKey);
+        properties.remove(alternativeKey);
+        getLog().info(
+            "Using value \"" + value + "\" from property " + alternativeKey +
+            " for property " + key
+            );
+        properties.setProperty(key, value);
+      }
     }
   }
 
-  private String configure(Properties properties, String value, String key)
+  private void configure(Properties properties, String value, String key)
   {
     if (value != null)
     {
       if (properties.containsKey(key))
-        getLog().debug(
-            "Overwriting property " + key + "=" + properties.getProperty(key) +
-            " with the value " + value
+        getLog().info(
+            "Overwriting property " + key + "=\"" +
+            properties.getProperty(key) +
+            "\" with value \"" + value + "\""
             );
       else
-        getLog().debug("Using the value " + value + " for property " + key);
+        getLog().debug("Using value \"" + value + "\" for property " + key);
       properties.setProperty(key, value);
     }
-    return properties.getProperty(key);
   }
 
   private void configure(Properties properties, Boolean value, String key)
   {
-    if (value != null)
-    {
-      if (properties.containsKey(key))
-        getLog().debug(
-            "Overwriting property " + key + "=" + properties.getProperty(key) +
-            " with the value " + value
-            );
-      else
-        getLog().debug("Using the value " + value + " for property " + key);
-      properties.setProperty(key, value.toString());
-    }
+    configure(properties, value == null ? null : value.toString(), key);
   }
 
   private File getOutputFile(String filename)