From: Kai Moritz Date: Thu, 1 Aug 2013 10:41:06 +0000 (+0200) Subject: Mapping-configurations are opend as given before searched in resources X-Git-Tag: hibernate4-maven-plugin-1.0.2~3 X-Git-Url: http://juplo.de/gitweb/?p=hibernate4-maven-plugin;a=commitdiff_plain;h=3d355800b5a5d2a536270b714f37a84d50b12168 Mapping-configurations are opend as given before searched in resources --- diff --git a/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java b/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java index e67a0787..f66f5249 100644 --- a/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java +++ b/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java @@ -587,12 +587,17 @@ public class Hbm2DdlMojo extends AbstractMojo 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()) { diff --git a/src/site/apt/pitfalls.apt b/src/site/apt/pitfalls.apt index 61b5bc95..6c921b08 100644 --- a/src/site/apt/pitfalls.apt +++ b/src/site/apt/pitfalls.apt @@ -128,7 +128,7 @@ Known Pitfalls [------------ If one always uses <<>> 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