From d38b2386641c7ca00f54d69cb3f576c20b0cdccc Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 18 Sep 2013 23:59:13 +0200 Subject: [PATCH] Reverted to old behaviour: export is skipped, when maven.test.skip=true --- .../juplo/plugins/hibernate4/Hbm2DdlMojo.java | 2 +- src/site/apt/configuration.apt | 20 +++----------- src/site/apt/index.apt | 3 +++ src/site/apt/pitfalls.apt | 26 +++++++------------ src/site/site.xml | 1 + 5 files changed, 19 insertions(+), 33 deletions(-) diff --git a/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java b/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java index 5c3b5c7e..2e232bf1 100644 --- a/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java +++ b/src/main/java/de/juplo/plugins/hibernate4/Hbm2DdlMojo.java @@ -153,7 +153,7 @@ public class Hbm2DdlMojo extends AbstractMojo * The excecution is skipped automatically, if no modified or newly added * annotated classes are found and the dialect was not changed. * - * @parameter property="hibernate.export.skip" default-value="false" + * @parameter property="maven.test.skip" default-value="false" */ private boolean skip; diff --git a/src/site/apt/configuration.apt b/src/site/apt/configuration.apt index ea11db0c..a0934138 100644 --- a/src/site/apt/configuration.apt +++ b/src/site/apt/configuration.apt @@ -160,23 +160,11 @@ Configuration Examples --------------- - There are some seldom used parameters, that can only be configured throug - this method: + The parameter <> (name of the hibernate-properties-file + to use, defaults to <>) can only be configured through + this approach. - * <> the delimiter used in the generated sql-script - - * <> wether the generated sql-script is formatted, or not - - * <> name of the hibernate-properties-file - - * <> name of the generated sql-script - - * <> create database or generate sql-script or both - - * <> create or drop the database or do both or nothing - (just validate the annotation-configuration) - - For explanations, see the + For more explanations, see the {{{./export-mojo.html} Documentation of the export-Mojo}}. {Configuration-Method-Precedence} diff --git a/src/site/apt/index.apt b/src/site/apt/index.apt index c918892c..63116846 100644 --- a/src/site/apt/index.apt +++ b/src/site/apt/index.apt @@ -3,6 +3,9 @@ A simple Plugin for generating a Database-Schema from Hibernate 4 Mapping-Annota <> is a plugin for generating a database-schema from your Hibernate-4-Mappings and create or update your database accordingly. + Its main usage is to automatically create and populate a test-database + for unit-tests in cooperation with the + {{{http://mojo.codehaus.org/dbunit-maven-plugin/} dbunit-maven-plugin}}. The plugin was designed with three main goals in mind: diff --git a/src/site/apt/pitfalls.apt b/src/site/apt/pitfalls.apt index 0640e7fe..24909a5c 100644 --- a/src/site/apt/pitfalls.apt +++ b/src/site/apt/pitfalls.apt @@ -5,7 +5,7 @@ Known Pitfalls The default-configuration uses the EXPORT-target of the SchemaExport-Tool. If you do not need to create a database with the evaluated schema, you can use the NONE- or the SCRIPT-target. - This can be achieved with the commandline-parameter + This can be achieved with the command-line parameter <<<-Dhibernate.export.target=SCRIPT>>> or with the following configuration: ------------ @@ -128,27 +128,18 @@ Known Pitfalls [INFO] Skipping schema generation! ------------- - If one always uses <<>> for cleanup, this will not happen. + If one always uses <<>> for cleanup, this will not happen. Otherwise the recreation must be {{{./force.html}forced}}: ------------- mvn hibernate4:export -Dhibernate.export.force=true ------------- -* The hibernate4:export goal is executed, even if <<>> is - <<>> +* The hibernate4:export goal is not executed, when tests are skipped - Up to version 1.0.2 the hibernate4-maven-plugin automatically skipped - its execution, when <<>> was set to <<>>. Starting - with version 1.0.3 this behaviour was changed. The plugin now only skips - its execution, when explicitliy told so via the configuration-parameter - <<>> or via the property <<>>. - - This change was made, because in some use-cases it is necessary, that the - database-schema is always build and/or exported, even if the tests are - skipped, which was not possible with the old behaviour. - - If you need/like the old behaviour, you can turn it on in your configuration: + The hibernate4-maven-plugin automatically skips its execution, when + <<>> is set to <<>>. If you need it to be always + executed, you can configure that explicitly like this: ------------ @@ -156,7 +147,10 @@ mvn hibernate4:export -Dhibernate.export.force=true hibernate4-maven-plugin ... - ${maven.test.skip} + false ------------ + + Background-information for this design-decission can be found on the extra + page {{{./skip.html}To skip or not to skip: that is the question}}... \ No newline at end of file diff --git a/src/site/site.xml b/src/site/site.xml index fcc59320..f54b0018 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -21,6 +21,7 @@ + -- 2.20.1