X-Git-Url: https://juplo.de/gitweb/?p=hibernate4-maven-plugin;a=blobdiff_plain;f=src%2Fsite%2Fxhtml%2Fpitfalls.xhtml;h=3967811bcff10e730e135d067c493eae7dc5290f;hp=71839293395c61ff627c5156e50929da387e8710;hb=4940080670944a15916c68fb294e18a6bfef12d5;hpb=fdda82a6f76deefd10f83da89d7e82054e3c3ecd diff --git a/src/site/xhtml/pitfalls.xhtml b/src/site/xhtml/pitfalls.xhtml index 71839293..3967811b 100644 --- a/src/site/xhtml/pitfalls.xhtml +++ b/src/site/xhtml/pitfalls.xhtml @@ -6,14 +6,14 @@

Annotated classes in dependencies are not found.

- hibernate4-maven-plugin by default scans dependencies in the scope + hibernate-maven-plugin by default scans dependencies in the scope compile. You can configure it to scan dependencies in other scopes as well. But it scans only direct dependencies. Transitive dependencies are not scanned for annotated classes. If some of your annotated classes are hidden in a transitive dependency, you can simply add that dependency explicitly.

-

hibernate4-maven-plugin always needs a database-connection

+

hibernate-maven-plugin always needs a database-connection

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 @@ -36,7 +36,7 @@ So a tidy maven-developer would usually scope it for runtime.

- But this will break the execution of the hibernate4-maven-plugin. + But this will break the execution of the hibernate-maven-plugin. Since it will not be able to see the needed dependency, it will fail with an error-message like:

@@ -70,7 +70,7 @@
 <plugin>
   <groupId>de.juplo</groupId>
-  <artifactId>hibernate4-maven-plugin</artifactId>
+  <artifactId>hibernate-maven-plugin</artifactId>
   <version>${project.version}</version>
   <executions>
     <execution>
@@ -93,29 +93,29 @@
   Because otherwise, this dependency will unnecessarily bloat the
   runtime-dependencies of your project.
   

-

DBUnit fails after execution of hibernate4 was skipped because nothing has changed

+

DBUnit fails after execution of hibernate was skipped because nothing has changed

- If hibernate4-maven-plugin skips its excecution, this may lead to errors in + If hibernate-maven-plugin skips its excecution, this may lead to errors in other plugins. For example, when importing sample-data in the automatically created database with the help of the dbunit-plugin, the CLEAN_INSERT-operation may fail because of foreign-key-constraints, - if the database was not recreated, because the hibernate4-maven-plugin has + if the database was not recreated, because the hibernate-maven-plugin has skipped its excecution.

A quick fix to this problem is, to force - hibernate4-maven-plugin to export the schema every time it is running. + hibernate-maven-plugin to export the schema every time it is running. But to recreate the database on every testrun may noticeable slow down your development cycle, if you have to wait for slow IO.

- To circumvent this problem, hibernate4-maven-plugin signals a skipped + To circumvent this problem, hibernate-maven-plugin signals a skipped excecution by setting the maven property $\{hibernate.export.skipped\} to true. You can configure other plugins to react on this signal. For example, the dbunit-plugin can be configured to skip its excecution, if - hibernate4-maven-plugin was skipped like this: + hibernate-maven-plugin was skipped like this:

 <plugin>
@@ -128,7 +128,7 @@
   

The database will not be recreated after a manual drop/clean

If one manually drops the database or removes the hsqldb-files, it will not - be recreated by the hibernate4-maven-plugin, because it cannot detect, that + be recreated by the hibernate-maven-plugin, because it cannot detect, that the database needs to be recreated. This happens, because the plugin will not recreate the database if neither the configuration nor the annotated classes have changed, because an @@ -143,17 +143,17 @@ Otherwise the recreation must be forced:

-mvn hibernate4:export -Dhibernate.export.force=true
-

The hibernate4:export goal is not executed, when tests are skipped

+mvn hibernate:export -Dhibernate.export.force=true
+

The hibernate:export goal is not executed, when tests are skipped

- The hibernate4-maven-plugin automatically skips its execution, when + The hibernate-maven-plugin automatically skips its execution, when maven.test.skip is set to true. If you need it to be always executed, you can configure that explicitly like this:

 <plugin>
   <groupId>de.juplo</groupId>
-  <artifactId>hibernate4-maven-plugin</artifactId>
+  <artifactId>hibernate-maven-plugin</artifactId>
   ...
   <configuration>
     <skip>false</skip>
@@ -173,7 +173,7 @@ mvn hibernate4:export -Dhibernate.export.force=true
 <plugin>
   <groupId>de.juplo</groupId>
-  <artifactId>hibernate4-maven-plugin</artifactId>
+  <artifactId>hibernate-maven-plugin</artifactId>
   ...
   <configuration>
     <scanDependencies>none</scanDependencies>