WIP
[hibernate4-maven-plugin] / src / main / java / de / juplo / plugins / hibernate / DropMojo.java
index 2f59272..88f6698 100644 (file)
@@ -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 DropMojo 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
@@ -101,7 +106,7 @@ public class DropMojo extends AbstractSchemaMojo
       {
         String charset =
             (String)settings.get(AvailableSettings.HBM2DDL_CHARSET_NAME);
-        return new ScriptTargetOutputToFile(output, charset);
+        return new ScriptTargetOutputToFile(new File(outputFile), charset);
       }
     };