Found annotated classes get logged now
[hibernate4-maven-plugin] / src / main / java / de / juplo / plugins / hibernate4 / Hbm2DdlMojo.java
index 1017ae6..04c8517 100644 (file)
@@ -27,12 +27,14 @@ import java.sql.Driver;
 import java.sql.DriverManager;
 import java.sql.DriverPropertyInfo;
 import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
 import java.util.Enumeration;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.Set;
+import java.util.TreeSet;
+import java.util.logging.Logger;
 import javax.persistence.Embeddable;
 import javax.persistence.Entity;
 import javax.persistence.MappedSuperclass;
@@ -183,14 +185,17 @@ public class Hbm2DdlMojo extends AbstractMojo
       MojoExecutionException
   {
     if (skip)
+    {
+      getLog().info("Exectuion of hibernate4-maven-plugin:export was skipped!");
       return;
+    }
 
     File dir = new File(outputDirectory);
     if (!dir.exists())
       throw new MojoExecutionException("Cannot scan for annotated classes in " + outputDirectory + ": directory does not exist!");
 
 
-    Set<String> classes = new HashSet<String>();
+    Set<String> classes = new TreeSet<String>();
     try
     {
       AnnotationDB db = new AnnotationDB();
@@ -212,6 +217,10 @@ public class Hbm2DdlMojo extends AbstractMojo
     if (classes.isEmpty())
       throw new MojoFailureException("No annotated classes found in directory " + outputDirectory);
 
+    getLog().info("Detected classes with mapping-annotations:");
+    for (String classname : classes)
+      getLog().info("  " + classname);
+
     Properties properties = new Properties();
 
     /** Try to read configuration from properties-file */
@@ -530,6 +539,15 @@ public class Hbm2DdlMojo extends AbstractMojo
       return target.jdbcCompliant();
     }
 
+    /**
+     * This Method cannot be annotated with @Override, becaus the plugin
+     * will not compile then under Java 1.6!
+     */
+    public Logger getParentLogger() throws SQLFeatureNotSupportedException
+    {
+      throw new SQLFeatureNotSupportedException("Not supported, for backward-compatibility with Java 1.6");
+    }
+
     @Override
     public String toString()
     {