Mapping-configurations are opend as given before searched in resources
authorKai Moritz <kai@juplo.de>
Thu, 1 Aug 2013 10:41:06 +0000 (12:41 +0200)
committerKai Moritz <kai@juplo.de>
Thu, 1 Aug 2013 22:36:45 +0000 (00:36 +0200)
src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java
src/site/apt/pitfalls.apt

index e67a078..f66f524 100644 (file)
@@ -587,12 +587,17 @@ public class Hbm2DdlMojo extends AbstractMojo
         MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
         for (String filename : hibernateMapping.split("[\\s,]+"))
         {
         MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
         for (String filename : hibernateMapping.split("[\\s,]+"))
         {
-          File file = null;
-          for (Resource resource : project.getResources())
+          // First try the filename as absolute/relative path
+          File file = new File(filename);
+          if (!file.exists())
           {
           {
-            file = new File(resource.getDirectory() + File.separator + filename);
-            if (file.exists())
-              break;
+            // If the file was not found, search for it in the resource-directories
+            for (Resource resource : project.getResources())
+            {
+              file = new File(resource.getDirectory() + File.separator + filename);
+              if (file.exists())
+                break;
+            }
           }
           if (file != null && file.exists())
           {
           }
           if (file != null && file.exists())
           {
index 61b5bc9..6c921b0 100644 (file)
@@ -128,7 +128,7 @@ Known Pitfalls
 [------------
 
   If one always uses <<<mvn clen>>> for cleanup, this will not happen.
 [------------
 
   If one always uses <<<mvn clen>>> for cleanup, this will not happen.
-  Otherwise the recreation must be forced:
+  Otherwise the recreation must be {{{./force.html}forced}}:
 
 -------------
 mvn hibernate4:export -Dhibernate.export.force=true
 
 -------------
 mvn hibernate4:export -Dhibernate.export.force=true