Catched NPE, if hibernate-dialect is not set
[hibernate4-maven-plugin] / src / main / java / de / juplo / plugins / hibernate4 / Hbm2DdlMojo.java
index 12c3fea..fdcad88 100644 (file)
@@ -341,7 +341,7 @@ public class Hbm2DdlMojo extends AbstractMojo
   /**
    * Generate envers schema for auditing tables.
    *
-   * @parameter property="hibernate.export.envers" default-value="false"
+   * @parameter property="hibernate.export.envers" default-value="true"
    * @since 1.0.3
    */
   private boolean envers;
@@ -703,6 +703,13 @@ public class Hbm2DdlMojo extends AbstractMojo
       throw new MojoFailureException("Hibernate configuration is missing!");
     }
 
+    getLog().info("Gathered hibernate-configuration (turn on debugging for details):");
+    for (Entry<Object,Object> entry : properties.entrySet())
+      getLog().info("  " + entry.getKey() + " = " + entry.getValue());
+
+    if (hibernateDialect == null)
+      throw new MojoFailureException("hibernate-dialect must be set!");
+
     final ValidationConfiguration config = new ValidationConfiguration(hibernateDialect);
 
     config.setProperties(properties);
@@ -853,10 +860,6 @@ public class Hbm2DdlMojo extends AbstractMojo
         return;
       }
 
-      getLog().info("Gathered hibernate-configuration (turn on debugging for details):");
-      for (Entry<Object,Object> entry : properties.entrySet())
-        getLog().info("  " + entry.getKey() + " = " + entry.getValue());
-
       Environment.verifyProperties( properties );
       ConfigurationHelper.resolvePlaceHolders( properties );
       StandardServiceRegistryImpl registry =