Catched NPE, if hibernate-dialect is not set
authorKai Moritz <kai@juplo.de>
Tue, 5 May 2015 21:42:40 +0000 (23:42 +0200)
committerKai Moritz <km@juplo.de>
Sat, 16 May 2015 11:29:43 +0000 (13:29 +0200)
src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java

index 772df8c..fdcad88 100644 (file)
@@ -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 =