X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsite%2Fxhtml%2Fpitfalls.xhtml;fp=src%2Fsite%2Fxhtml%2Fpitfalls.xhtml;h=d762b3aec0d30c71bdf8ea9897c30fa4f9da8102;hb=0611db682bc69b80d8567bf9316668a1b6161725;hp=3967811bcff10e730e135d067c493eae7dc5290f;hpb=a275df25c52fdb7b5b4275fcf9a359194f7b9116;p=hibernate-maven-plugin diff --git a/src/site/xhtml/pitfalls.xhtml b/src/site/xhtml/pitfalls.xhtml index 3967811b..d762b3ae 100644 --- a/src/site/xhtml/pitfalls.xhtml +++ b/src/site/xhtml/pitfalls.xhtml @@ -15,19 +15,25 @@
- 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.
+ The default-configuration exports the created schema to the configured
+ database.
+ Therefore, it needs a valid database-connection and fails, if none is
+ available.
+ If you do not need to export the created schema to a database,
+ you can set the property hibernate.schema.export
to
+ false
.
This can be achieved with the command-line parameter
- -Dhibernate.export.target=SCRIPT
or with the following configuration:
+ -Dhibernate.schema.export=false
or with the following
+ configuration:
<configuration> - <target>SCRIPT</target> + <export>false</export> </configuration>
But even when no database is to be created, hibernate always needs to know - the dialect. Hence, the plugin will fail if this parameter is missing! + the dialect. Hence, the plugin will still fail, if this parameter is also + missing!
@@ -44,21 +50,32 @@ [INFO] Gathered hibernate-configuration (turn on debugging for details): [INFO] hibernate.connection.username = sa [INFO] hibernate.connection.password = -[INFO] hibernate.dialect = org.hibernate.dialect.HSQLDialect -[INFO] hibernate.connection.url = jdbc:hsqldb:/home/kai/mmf/target/mmf;shutdown=true -[INFO] hibernate.connection.driver_class = org.hsqldb.jdbcDriver -[ERROR] Dependency for driver-class org.hsqldb.jdbcDriver is missing! +[INFO] hibernate.dialect = org.hibernate.dialect.H2Dialect +[INFO] hibernate.connection.url = jdbc:h2:file:./db +[INFO] hibernate.hbm2dll.create_namespaces = false +[INFO] hibernate.connection.driver_class = org.h2.Driver +[INFO] hibernate.format_sql = true +[INFO] HHH000412: Hibernate Core {5.0.2.Final} +[INFO] HHH000206: hibernate.properties not found +[INFO] HHH000021: Bytecode provider name : javassist +[INFO] Adding /home/kai/project/target/classes to the list of roots to scan... +[INFO] Adding dependencies from scope compile to the list of roots to scan +[INFO] Adding dependencies from scope org.hibernate:hibernate-core:jar:4.3.0.Final to the list of roots to scan +[INFO] Adding annotated resource: de.juplo.tests.SimplestMavenHib4Test [INFO] ------------------------------------------------------------------------ -[ERROR] BUILD ERROR +[INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ -[INFO] org.hsqldb.jdbcDriver +[INFO] Total time: 1.760s +[INFO] Finished at: Mon Mar 07 19:06:54 CET 2016 +[INFO] Final Memory: 11M/215M [INFO] ------------------------------------------------------------------------ -[INFO] For more information, run Maven with the -e switch -[INFO] ------------------------------------------------------------------------ -[INFO] Total time: 2 seconds -[INFO] Finished at: Thu Nov 29 11:31:14 CET 2012 -[INFO] Final Memory: 32M/342M -[INFO] ------------------------------------------------------------------------ +[ERROR] Failed to execute goal de.juplo:hibernate-maven-plugin:${project.version}:drop (default) on project hibernate4-properties-test: Could not open the JDBC-connection: Unable to load class [org.h2.Driver]: Could not load requested class : org.h2.Driver -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
A quick workaround for this error would be, to delete the runtime-constraint for the jdbc-driver-dependency. @@ -75,7 +92,8 @@ <executions> <execution> <goals> - <goal>export</goal> + <goal>drop</goal> + <goal>create</goal> </goals> </execution> </executions> @@ -111,7 +129,7 @@
To circumvent this problem, hibernate-maven-plugin signals a skipped
- excecution by setting the maven property $\{hibernate.export.skipped\}
to
+ excecution by setting the maven property ${hibernate.schema.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
@@ -122,7 +140,7 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>dbunit-maven-plugin</artifactId>
<configuration>
- <skip>${hibernate.export.skipped}</skip>
+ <skip>${hibernate.schema.skipped}</skip>
</configuration>
</plugin>
-mvn hibernate:export -Dhibernate.export.force=true-
The hibernate-maven-plugin automatically skips its execution, when
maven.test.skip
is set to true
. If you need it to be always
@@ -166,7 +184,7 @@ mvn hibernate:export -Dhibernate.export.force=true
If you do not want your dependencies to be scanned for hibernate annotations,
- you can pass -Dhibernate.export.scan_dependencies=none
to maven
+ you can pass -Dhibernate.schema.scan.dependencies=none
to maven
or set scanDependencies
to none
in the configuration
of the plugin like this:
- You should consider to upgrade to that version of the plugin. + You should consider to upgrade to the latest version of the plugin.