From dc652540d007799fb23fc11d06186aa5325058db Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 20 Dec 2015 21:06:37 +0100 Subject: [PATCH] All packages up to the root are checked for annotations --- .../de/juplo/plugins/hibernate/AbstractSchemaMojo.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java b/src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java index 1eb54e56..f6e18ea4 100644 --- a/src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java +++ b/src/main/java/de/juplo/plugins/hibernate/AbstractSchemaMojo.java @@ -1081,8 +1081,10 @@ public abstract class AbstractSchemaMojo extends AbstractMojo packageName = name; } - if (!packages.contains(packageName)) + while (packageName != null) { + if (packages.contains(packageName)) + return; String resource = packageName.replace('.', '/') + "/package-info.class"; InputStream is = classLoaderService.locateResourceStream(resource); if (is == null) @@ -1100,6 +1102,11 @@ public abstract class AbstractSchemaMojo extends AbstractMojo sources.addPackage(packageName); } packages.add(packageName); + int i = packageName.lastIndexOf('.'); + if (i < 0) + packageName = null; + else + packageName = packageName.substring(0,i); } } catch (Exception e) -- 2.20.1