From: Kai Moritz Date: Tue, 5 May 2015 21:42:40 +0000 (+0200) Subject: Catched NPE, if hibernate-dialect is not set X-Git-Tag: hibernate4-maven-plugin-1.1.0~12 X-Git-Url: http://juplo.de/gitweb/?p=hibernate4-maven-plugin;a=commitdiff_plain;h=9156c5f6414b676d34eb0c934e70604ba822d09a Catched NPE, if hibernate-dialect is not set --- diff --git a/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java b/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java index 772df8c4..fdcad88b 100644 --- a/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java +++ b/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java @@ -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 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 entry : properties.entrySet()) - getLog().info(" " + entry.getKey() + " = " + entry.getValue()); - Environment.verifyProperties( properties ); ConfigurationHelper.resolvePlaceHolders( properties ); StandardServiceRegistryImpl registry =