Overwriting of a property with the same value is not reported as overwriting
authorKai Moritz <kai@juplo.de>
Sun, 6 Nov 2016 15:13:51 +0000 (16:13 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 13 Nov 2016 16:37:15 +0000 (17:37 +0100)
src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java

index e99aea4..06024c2 100644 (file)
@@ -1012,14 +1012,22 @@ public abstract class AbstractSchemaMojo extends AbstractMojo
     if (value != null)
     {
       if (properties.containsKey(key))
-        getLog().info(
-            "Overwriting property " + key + "=\"" +
-            properties.getProperty(key) +
-            "\" with value \"" + value + "\""
-            );
+      {
+        if (!properties.getProperty(key).equals(value))
+        {
+          getLog().info(
+              "Overwriting property " + key + "=\"" +
+              properties.getProperty(key) +
+              "\" with value \"" + value + "\""
+              );
+          properties.setProperty(key, value);
+        }
+      }
       else
+      {
         getLog().debug("Using value \"" + value + "\" for property " + key);
-      properties.setProperty(key, value);
+        properties.setProperty(key, value);
+      }
     }
   }