X-Git-Url: http://juplo.de/gitweb/?p=hibernate4-maven-plugin;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Fjuplo%2Fplugins%2Fhibernate%2FUpdateMojo.java;h=b64b4b226a03cbb64899fb8ab73ab93f0ca7fa72;hp=6d9e62ef1544a56fc24c91c441255d0a206464ed;hb=bb6069ff5e565f522a7699225d950321dde667d1;hpb=505d13bdca776dd80f661a52797789b87e97b200 diff --git a/src/main/java/de/juplo/plugins/hibernate/UpdateMojo.java b/src/main/java/de/juplo/plugins/hibernate/UpdateMojo.java index 6d9e62ef..b64b4b22 100644 --- a/src/main/java/de/juplo/plugins/hibernate/UpdateMojo.java +++ b/src/main/java/de/juplo/plugins/hibernate/UpdateMojo.java @@ -17,6 +17,7 @@ package de.juplo.plugins.hibernate; */ import java.io.File; +import java.security.NoSuchAlgorithmException; import java.util.EnumSet; import java.util.Map; import org.apache.maven.plugin.MojoExecutionException; @@ -65,15 +66,19 @@ public class UpdateMojo extends AbstractSchemaMojo MojoFailureException, MojoExecutionException { - super.execute(outputFile); + try + { + super.execute(new MD5ModificationTracker(buildDirectory, outputFile, getLog())); + } + catch (NoSuchAlgorithmException e) + { + throw new MojoFailureException("Digest-Algorithm MD5 is missing!", e); + } } @Override - ExceptionHandlerCollectingImpl build( - final MetadataImplementor metadata, - final File output - ) + ExceptionHandlerCollectingImpl build(final MetadataImplementor metadata) throws MojoExecutionException, MojoFailureException @@ -85,7 +90,7 @@ public class UpdateMojo extends AbstractSchemaMojo SchemaManagementTool tool = registry.getService(SchemaManagementTool.class); final EnumSet targetTypes = EnumSet.of(TargetType.SCRIPT); - if ((Boolean)settings.get(EXECUTE)) + if (Boolean.parseBoolean(settings.get(EXECUTE).toString())) targetTypes.add(TargetType.DATABASE); TargetDescriptor target = new TargetDescriptor() @@ -101,7 +106,7 @@ public class UpdateMojo extends AbstractSchemaMojo { String charset = (String)settings.get(AvailableSettings.HBM2DDL_CHARSET_NAME); - return new ScriptTargetOutputToFile(output, charset); + return new ScriptTargetOutputToFile(new File(outputFile), charset); } };