*/
public class Hbm2DdlMojo extends AbstractMojo
{
+ public final static String EXPORT_SKIPPED_PROPERTY = "hibernate.export.skipped";
+
public final static String DRIVER_CLASS = "hibernate.connection.driver_class";
public final static String URL = "hibernate.connection.url";
public final static String USERNAME = "hibernate.connection.username";
if (skip)
{
getLog().info("Exectuion of hibernate4-maven-plugin:export was skipped!");
+ project.getProperties().setProperty(EXPORT_SKIPPED_PROPERTY, "true");
return;
}
md5s.put(DIALECT, properties.getProperty(DIALECT));
}
- if (!modified)
- {
- getLog().info("No modified annotated classes found and dialect unchanged.");
- getLog().info("Skipping schema generation!");
- project.getProperties().setProperty("hibernate.export.skipped", "true");
- return;
- }
-
- getLog().info("Gathered hibernate-configuration (turn on debugging for details):");
if (properties.isEmpty())
{
getLog().error("No properties set!");
throw new MojoFailureException("Hibernate-Configuration is missing!");
}
- for (Entry<Object,Object> entry : properties.entrySet())
- getLog().info(" " + entry.getKey() + " = " + entry.getValue());
Configuration config = new Configuration();
config.setProperties(properties);
throw new MojoExecutionException("Invalid value for configuration-option \"type\"");
}
+ if (target.equals(Target.SCRIPT) || target.equals(Target.NONE))
+ {
+ project.getProperties().setProperty(EXPORT_SKIPPED_PROPERTY, "true");
+ }
+ if (
+ !modified
+ && !target.equals(Target.SCRIPT)
+ && !target.equals(Target.NONE)
+ )
+ {
+ getLog().info("No modified annotated classes found and dialect unchanged.");
+ getLog().info("Skipping schema generation!");
+ project.getProperties().setProperty(EXPORT_SKIPPED_PROPERTY, "true");
+ return;
+ }
+
+ getLog().info("Gathered hibernate-configuration (turn on debugging for details):");
+ for (Entry<Object,Object> entry : properties.entrySet())
+ getLog().info(" " + entry.getKey() + " = " + entry.getValue());
+
Connection connection = null;
try
{