From 3d355800b5a5d2a536270b714f37a84d50b12168 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Thu, 1 Aug 2013 12:41:06 +0200 Subject: [PATCH] Mapping-configurations are opend as given before searched in resources --- .../de/juplo/plugins/hibernate4/Hbm2DdlMojo.java | 15 ++++++++++----- src/site/apt/pitfalls.apt | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) 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 -- 2.20.1