Updated documentation
[hibernate4-maven-plugin] / src / main / java / de / juplo / plugins / hibernate / AbstractSchemaMojo.java
index 1eb54e5..d4386eb 100644 (file)
@@ -136,7 +136,7 @@ public abstract class AbstractSchemaMojo extends AbstractMojo
    * If set to <code>true</code>, the execution is skipped.
    * <p>
    * A skipped execution is signaled via the maven-property
-   * <code>${hibernate.export.skipped}</code>.
+   * <code>${hibernate.schema.skipped}</code>.
    * <p>
    * The execution is skipped automatically, if no modified or newly added
    * annotated classes are found and the dialect was not changed.
@@ -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)