From 9156c5f6414b676d34eb0c934e70604ba822d09a Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 5 May 2015 23:42:40 +0200 Subject: [PATCH] Catched NPE, if hibernate-dialect is not set --- .../java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 = -- 2.20.1