3 <!-- Generated by Apache Maven Doxia Site Renderer 1.6 at 2016-11-05 -->
27 <!-- NEW PAGE - - - - - uri: integration.html -->
39 <!-- NEW PAGE - - - - - uri: dependencies.html -->
51 <!-- NEW PAGE - - - - - uri: dependency-info.html -->
63 <!-- NEW PAGE - - - - - uri: distribution-management.html -->
75 <!-- NEW PAGE - - - - - uri: index.html -->
87 <!-- NEW PAGE - - - - - uri: license.html -->
99 <!-- NEW PAGE - - - - - uri: plugin-management.html -->
111 <!-- NEW PAGE - - - - - uri: plugins.html -->
123 <!-- NEW PAGE - - - - - uri: team-list.html -->
135 <!-- NEW PAGE - - - - - uri: source-repository.html -->
147 <!-- NEW PAGE - - - - - uri: project-summary.html -->
154 <!-- NEW PAGE - - - - - uri: project-info.html -->
171 <!-- NEW PAGE - - - - - uri: testapidocs/index.html -->
183 <!-- NEW PAGE - - - - - uri: apidocs/index.html -->
195 <!-- NEW PAGE - - - - - uri: xref/index.html -->
207 <!-- NEW PAGE - - - - - uri: xref-test/index.html -->
219 <!-- NEW PAGE - - - - - uri: pmd.html -->
231 <!-- NEW PAGE - - - - - uri: plugin-info.html -->
238 <!-- NEW PAGE - - - - - uri: project-reports.html -->
243 <!-- DONE WITH MENUE - - $page.name-->
258 <!-- OVERWRITING PAGE - uri: index.html -->
270 <!-- NEW PAGE - - - - - uri: configuration.html -->
282 <!-- NEW PAGE - - - - - uri: export-mojo.html -->
294 <!-- NEW PAGE - - - - - uri: debugging.html -->
306 <!-- NEW PAGE - - - - - uri: skip.html -->
318 <!-- NEW PAGE - - - - - uri: force.html -->
330 <!-- NEW PAGE - - - - - uri: pitfalls.html -->
342 <!-- OVERWRITING PAGE - uri: project-info.html -->
354 <!-- OVERWRITING PAGE - uri: project-reports.html -->
359 <!-- DONE WITH MENUE - - (no name)-->
363 <!-- name: Known Pitfalls (FAQ) -->
364 <!-- title: Hibernate 4 Maven Plugin – -->
365 <!-- short title: -->
366 <!-- current page: pitfalls.html -->
367 <!-- path: /hibernate-maven-plugin/ -->
368 <!-- crumbs: {"uri":"/projects.html","name":"Projects"} -->
369 <!-- pages: {integration.html={name=CI Management, uri=integration.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-info.html, name=Project Information}, {uri=integration.html, name=CI Management}]}, dependencies.html={name=Dependencies, uri=dependencies.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-info.html, name=Project Information}, {uri=dependencies.html, name=Dependencies}]}, dependency-info.html={name=Dependency Information, uri=dependency-info.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-info.html, name=Project Information}, {uri=dependency-info.html, name=Dependency Information}]}, distribution-management.html={name=Distribution Management, uri=distribution-management.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-info.html, name=Project Information}, {uri=distribution-management.html, name=Distribution Management}]}, index.html={name=Overview, uri=index.html, childs={index.html=Overview, configuration.html=Configuration Examples, export-mojo.html=Parameter Documentation, debugging.html=Enable Debug-Output, skip.html=Skipping Execution, force.html=Force Exceution, pitfalls.html=Known Pitfalls (FAQ), project-info.html=Project Information, project-reports.html=Project Reports}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=index.html, name=Overview}]}, license.html={name=Licenses, uri=license.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-info.html, name=Project Information}, {uri=license.html, name=Licenses}]}, plugin-management.html={name=Plugin Management, uri=plugin-management.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-info.html, name=Project Information}, {uri=plugin-management.html, name=Plugin Management}]}, plugins.html={name=Plugins, uri=plugins.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-info.html, name=Project Information}, {uri=plugins.html, name=Plugins}]}, team-list.html={name=Team, uri=team-list.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-info.html, name=Project Information}, {uri=team-list.html, name=Team}]}, source-repository.html={name=Source Code Management, uri=source-repository.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-info.html, name=Project Information}, {uri=source-repository.html, name=Source Code Management}]}, project-summary.html={name=Summary, uri=project-summary.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-info.html, name=Project Information}, {uri=project-summary.html, name=Summary}]}, project-info.html={name=Project Information, uri=project-info.html, childs={integration.html=CI Management, dependencies.html=Dependencies, dependency-info.html=Dependency Information, distribution-management.html=Distribution Management, index.html=About, license.html=Licenses, plugin-management.html=Plugin Management, plugins.html=Plugins, team-list.html=Team, source-repository.html=Source Code Management, project-summary.html=Summary}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-info.html, name=Project Information}]}, testapidocs/index.html={name=Test JavaDocs, uri=testapidocs/index.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-reports.html, name=Project Reports}, {uri=testapidocs/index.html, name=Test JavaDocs}]}, apidocs/index.html={name=JavaDocs, uri=apidocs/index.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-reports.html, name=Project Reports}, {uri=apidocs/index.html, name=JavaDocs}]}, xref/index.html={name=Source Xref, uri=xref/index.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-reports.html, name=Project Reports}, {uri=xref/index.html, name=Source Xref}]}, xref-test/index.html={name=Test Source Xref, uri=xref-test/index.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-reports.html, name=Project Reports}, {uri=xref-test/index.html, name=Test Source Xref}]}, pmd.html={name=PMD, uri=pmd.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-reports.html, name=Project Reports}, {uri=pmd.html, name=PMD}]}, plugin-info.html={name=Plugin Documentation, uri=plugin-info.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-reports.html, name=Project Reports}, {uri=plugin-info.html, name=Plugin Documentation}]}, project-reports.html={name=Project Reports, uri=project-reports.html, childs={testapidocs/index.html=Test JavaDocs, apidocs/index.html=JavaDocs, xref/index.html=Source Xref, xref-test/index.html=Test Source Xref, pmd.html=PMD, plugin-info.html=Plugin Documentation}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=project-reports.html, name=Project Reports}]}, configuration.html={name=Configuration Examples, uri=configuration.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=configuration.html, name=Configuration Examples}]}, export-mojo.html={name=Parameter Documentation, uri=export-mojo.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=export-mojo.html, name=Parameter Documentation}]}, debugging.html={name=Enable Debug-Output, uri=debugging.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=debugging.html, name=Enable Debug-Output}]}, skip.html={name=Skipping Execution, uri=skip.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=skip.html, name=Skipping Execution}]}, force.html={name=Force Exceution, uri=force.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=force.html, name=Force Exceution}]}, pitfalls.html={name=Known Pitfalls (FAQ), uri=pitfalls.html, childs={}, crumbs=[{uri=index.html, name=Hibernate 4 Maven Plugin}, {uri=pitfalls.html, name=Known Pitfalls (FAQ)}]}} -->
374 xmlns="http://www.w3.org/1999/xhtml"
375 xmlns:layout="http://www.thymeleaf.org"
376 layout:decorator="templates/layout"
378 uri='/hibernate-maven-plugin/pitfalls.html',
379 json='MERGE:{"pages":{"/hibernate-maven-plugin/integration.html":{"name":"CI Management","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-info.html","name":"Project Information"},{"uri":"/hibernate-maven-plugin/integration.html","name":"CI Management"}]},"/hibernate-maven-plugin/dependencies.html":{"name":"Dependencies","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-info.html","name":"Project Information"},{"uri":"/hibernate-maven-plugin/dependencies.html","name":"Dependencies"}]},"/hibernate-maven-plugin/dependency-info.html":{"name":"Dependency Information","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-info.html","name":"Project Information"},{"uri":"/hibernate-maven-plugin/dependency-info.html","name":"Dependency Information"}]},"/hibernate-maven-plugin/distribution-management.html":{"name":"Distribution Management","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-info.html","name":"Project Information"},{"uri":"/hibernate-maven-plugin/distribution-management.html","name":"Distribution Management"}]},"/hibernate-maven-plugin/index.html":{"name":"Overview","childs":{"/hibernate-maven-plugin/index.html":"Overview","/hibernate-maven-plugin/configuration.html":"Configuration Examples","/hibernate-maven-plugin/export-mojo.html":"Parameter Documentation","/hibernate-maven-plugin/debugging.html":"Enable Debug-Output","/hibernate-maven-plugin/skip.html":"Skipping Execution","/hibernate-maven-plugin/force.html":"Force Exceution","/hibernate-maven-plugin/pitfalls.html":"Known Pitfalls (FAQ)","/hibernate-maven-plugin/project-info.html":"Project Information","/hibernate-maven-plugin/project-reports.html":"Project Reports"},"crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/index.html","name":"Overview"}]},"/hibernate-maven-plugin/license.html":{"name":"Licenses","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-info.html","name":"Project Information"},{"uri":"/hibernate-maven-plugin/license.html","name":"Licenses"}]},"/hibernate-maven-plugin/plugin-management.html":{"name":"Plugin Management","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-info.html","name":"Project Information"},{"uri":"/hibernate-maven-plugin/plugin-management.html","name":"Plugin Management"}]},"/hibernate-maven-plugin/plugins.html":{"name":"Plugins","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-info.html","name":"Project Information"},{"uri":"/hibernate-maven-plugin/plugins.html","name":"Plugins"}]},"/hibernate-maven-plugin/team-list.html":{"name":"Team","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-info.html","name":"Project Information"},{"uri":"/hibernate-maven-plugin/team-list.html","name":"Team"}]},"/hibernate-maven-plugin/source-repository.html":{"name":"Source Code Management","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-info.html","name":"Project Information"},{"uri":"/hibernate-maven-plugin/source-repository.html","name":"Source Code Management"}]},"/hibernate-maven-plugin/project-summary.html":{"name":"Summary","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-info.html","name":"Project Information"},{"uri":"/hibernate-maven-plugin/project-summary.html","name":"Summary"}]},"/hibernate-maven-plugin/project-info.html":{"name":"Project Information","childs":{"/hibernate-maven-plugin/integration.html":"CI Management","/hibernate-maven-plugin/dependencies.html":"Dependencies","/hibernate-maven-plugin/dependency-info.html":"Dependency Information","/hibernate-maven-plugin/distribution-management.html":"Distribution Management","/hibernate-maven-plugin/index.html":"About","/hibernate-maven-plugin/license.html":"Licenses","/hibernate-maven-plugin/plugin-management.html":"Plugin Management","/hibernate-maven-plugin/plugins.html":"Plugins","/hibernate-maven-plugin/team-list.html":"Team","/hibernate-maven-plugin/source-repository.html":"Source Code Management","/hibernate-maven-plugin/project-summary.html":"Summary"},"crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-info.html","name":"Project Information"}]},"/hibernate-maven-plugin/testapidocs/index.html":{"name":"Test JavaDocs","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-reports.html","name":"Project Reports"},{"uri":"/hibernate-maven-plugin/testapidocs/index.html","name":"Test JavaDocs"}]},"/hibernate-maven-plugin/apidocs/index.html":{"name":"JavaDocs","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-reports.html","name":"Project Reports"},{"uri":"/hibernate-maven-plugin/apidocs/index.html","name":"JavaDocs"}]},"/hibernate-maven-plugin/xref/index.html":{"name":"Source Xref","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-reports.html","name":"Project Reports"},{"uri":"/hibernate-maven-plugin/xref/index.html","name":"Source Xref"}]},"/hibernate-maven-plugin/xref-test/index.html":{"name":"Test Source Xref","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-reports.html","name":"Project Reports"},{"uri":"/hibernate-maven-plugin/xref-test/index.html","name":"Test Source Xref"}]},"/hibernate-maven-plugin/pmd.html":{"name":"PMD","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-reports.html","name":"Project Reports"},{"uri":"/hibernate-maven-plugin/pmd.html","name":"PMD"}]},"/hibernate-maven-plugin/plugin-info.html":{"name":"Plugin Documentation","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-reports.html","name":"Project Reports"},{"uri":"/hibernate-maven-plugin/plugin-info.html","name":"Plugin Documentation"}]},"/hibernate-maven-plugin/project-reports.html":{"name":"Project Reports","childs":{"/hibernate-maven-plugin/testapidocs/index.html":"Test JavaDocs","/hibernate-maven-plugin/apidocs/index.html":"JavaDocs","/hibernate-maven-plugin/xref/index.html":"Source Xref","/hibernate-maven-plugin/xref-test/index.html":"Test Source Xref","/hibernate-maven-plugin/pmd.html":"PMD","/hibernate-maven-plugin/plugin-info.html":"Plugin Documentation"},"crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/project-reports.html","name":"Project Reports"}]},"/hibernate-maven-plugin/configuration.html":{"name":"Configuration Examples","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/configuration.html","name":"Configuration Examples"}]},"/hibernate-maven-plugin/export-mojo.html":{"name":"Parameter Documentation","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/export-mojo.html","name":"Parameter Documentation"}]},"/hibernate-maven-plugin/debugging.html":{"name":"Enable Debug-Output","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/debugging.html","name":"Enable Debug-Output"}]},"/hibernate-maven-plugin/skip.html":{"name":"Skipping Execution","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/skip.html","name":"Skipping Execution"}]},"/hibernate-maven-plugin/force.html":{"name":"Force Exceution","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/force.html","name":"Force Exceution"}]},"/hibernate-maven-plugin/pitfalls.html":{"name":"Known Pitfalls (FAQ)","crumbs":[{"uri":"/projects.html","name":"Projects"}#set( = ","){"uri":"/hibernate-maven-plugin/index.html","name":"Hibernate 4 Maven Plugin"},{"uri":"/hibernate-maven-plugin/pitfalls.html","name":"Known Pitfalls (FAQ)"}]}}}'
383 <title>Hibernate 4 Maven Plugin — Known Pitfalls (FAQ)</title>
384 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
385 <link rel="canonical" href="/hibernate-maven-plugin/pitfalls.html"/>
391 <li><a href="index.html">Hibernate 4 Maven Plugin</a></li><li><a href="pitfalls.html">Known Pitfalls (FAQ)</a></li> </ol>
394 <article class="main" layout:fragment="maincontent">
399 <h1>Known Pitfalls (FAQ)</h1>
401 <div class="section">
402 <h2><a name="Annotated_classes_in_dependencies_are_not_found."></a>Annotated classes in dependencies are not found.</h2>
405 hibernate4-maven-plugin by default scans dependencies in the scope
406 <tt>compile</tt>. You can configure it to scan dependencies in other
407 scopes as well. But it scans only direct dependencies. Transitive
408 dependencies are not scanned for annotated classes. If some of your
409 annotated classes are hidden in a transitive dependency, you can simply
410 add that dependency explicitly.
413 <div class="section">
414 <h2><a name="hibernate4-maven-plugin_always_needs_a_database-connection"></a>hibernate4-maven-plugin always needs a database-connection</h2>
417 The default-configuration uses the EXPORT-target of the SchemaExport-Tool.
418 If you do not need to create a database with the evaluated schema, you can
419 use the NONE- or the SCRIPT-target.
420 This can be achieved with the command-line parameter
421 <tt>-Dhibernate.export.target=SCRIPT</tt> or with the following configuration:
425 <pre class="prettyprint linenums lang-html">
426 <configuration>
427 <target>SCRIPT</target>
428 </configuration></pre></div>
431 But even when no database is to be created, hibernate always needs to know
432 the dialect. Hence, the plugin will fail if this parameter is missing!
435 <div class="section">
436 <h2><a name="Dependency_for_driver-class_XYZ_is_missing"></a>Dependency for driver-class XYZ is missing</h2>
439 One regular problem is the scope of the jdbc-driver-dependency.
440 It is very unlikely, that this dependency is needed at compile-time.
441 So a tidy maven-developer would usually scope it for <tt>runtime</tt>.
445 But this will break the execution of the <tt>hibernate4-maven-plugin</tt>.
446 Since it will not be able to see the needed dependency, it will fail with
447 an error-message like:
451 <pre class="prettyprint">
452 [INFO] Gathered hibernate-configuration (turn on debugging for details):
453 [INFO] hibernate.connection.username = sa
454 [INFO] hibernate.connection.password =
455 [INFO] hibernate.dialect = org.hibernate.dialect.HSQLDialect
456 [INFO] hibernate.connection.url = jdbc:hsqldb:/home/kai/mmf/target/mmf;shutdown=true
457 [INFO] hibernate.connection.driver_class = org.hsqldb.jdbcDriver
458 [ERROR] Dependency for driver-class org.hsqldb.jdbcDriver is missing!
459 [INFO] ------------------------------------------------------------------------
461 [INFO] ------------------------------------------------------------------------
462 [INFO] org.hsqldb.jdbcDriver
463 [INFO] ------------------------------------------------------------------------
464 [INFO] For more information, run Maven with the -e switch
465 [INFO] ------------------------------------------------------------------------
466 [INFO] Total time: 2 seconds
467 [INFO] Finished at: Thu Nov 29 11:31:14 CET 2012
468 [INFO] Final Memory: 32M/342M
469 [INFO] ------------------------------------------------------------------------</pre></div>
472 A quick workaround for this error would be, to delete the runtime-constraint
473 for the jdbc-driver-dependency.
477 A much cleaner way is, to (additionally) ad the dependency, to the
482 <pre class="prettyprint linenums lang-html">
484 <groupId>de.juplo</groupId>
485 <artifactId>hibernate4-maven-plugin</artifactId>
486 <version>1.1.1</version>
490 <goal>export</goal>
496 <groupId>org.hsqldb</groupId>
497 <artifactId>hsqldb</artifactId>
498 <version>2.2.8</version>
500 </dependencies>
501 </plugin></pre></div>
504 This is also the best way, if you use a different jdbc-driver for
505 testing, than in production.
506 Because otherwise, this dependency will unnecessarily bloat the
507 runtime-dependencies of your project.
510 <div class="section" id="fails">
511 <h2 id="fails">DBUnit fails after execution of hibernate4 was skipped because nothing has changed</h2>
514 If hibernate4-maven-plugin skips its excecution, this may lead to errors in
516 For example, when importing sample-data in the automatically created database
517 with the help of the <a class="externalLink" href="http://mojo.codehaus.org/dbunit-maven-plugin/">dbunit-plugin</a>,
518 the <tt>CLEAN_INSERT</tt>-operation may fail because of foreign-key-constraints,
519 if the database was not recreated, because the hibernate4-maven-plugin has
520 skipped its excecution.
524 A quick fix to this problem is, to <a href="./force.html">force</a>
525 hibernate4-maven-plugin to export the schema every time it is running.
526 But to recreate the database on every testrun may noticeable slow down your
527 development cycle, if you have to wait for slow IO.
531 To circumvent this problem, hibernate4-maven-plugin signals a skipped
532 excecution by setting the maven property <tt>$\{hibernate.export.skipped\}</tt> to
534 You can configure other plugins to react on this signal.
535 For example, the dbunit-plugin can be configured to skip its excecution, if
536 hibernate4-maven-plugin was skipped like this:
540 <pre class="prettyprint linenums lang-html">
542 <groupId>org.codehaus.mojo</groupId>
543 <artifactId>dbunit-maven-plugin</artifactId>
544 <configuration>
545 <skip>${hibernate.export.skipped}</skip>
546 </configuration>
547 </plugin></pre></div>
549 <div class="section">
550 <h2><a name="The_database_will_not_be_recreated_after_a_manual_dropclean"></a>The database will not be recreated after a manual drop/clean</h2>
553 If one manually drops the database or removes the hsqldb-files, it will not
554 be recreated by the hibernate4-maven-plugin, because it cannot detect, that
555 the database needs to be recreated.
556 This happens, because the plugin will not recreate the database if neither
557 the configuration nor the annotated classes have changed, because an
558 unnecessary drop-create-cycle might take a long time. The plugin will
559 report that like this:
563 <pre class="prettyprint">
564 [INFO] No modified annotated classes found and dialect unchanged.
565 [INFO] Skipping schema generation!</pre></div>
568 If one always uses <tt>mvn clean</tt> for cleanup, this will not happen.
569 Otherwise the recreation must be <a href="./force.html">forced</a>:
573 <pre class="prettyprint">
574 mvn hibernate4:export -Dhibernate.export.force=true</pre></div>
576 <div class="section">
577 <h2><a name="The_hibernate4:export_goal_is_not_executed_when_tests_are_skipped"></a>The hibernate4:export goal is not executed, when tests are skipped</h2>
580 The hibernate4-maven-plugin automatically skips its execution, when
581 <tt>maven.test.skip</tt> is set to <tt>true</tt>. If you need it to be always
582 executed, you can configure that explicitly like this:
586 <pre class="prettyprint linenums lang-html">
588 <groupId>de.juplo</groupId>
589 <artifactId>hibernate4-maven-plugin</artifactId>
591 <configuration>
592 <skip>false</skip>
593 </configuration>
594 </plugin></pre></div>
597 Background-information for this design-decission can be found on the extra
598 page <a href="./skip.html">To skip or not to skip: that is the question</a>...
601 <div class="section">
602 <h2><a name="I_do_not_want_my_dependencies_to_be_scanned_for_hibernate_annotations"></a>I do not want my dependencies to be scanned for hibernate annotations</h2>
605 If you do not want your dependencies to be scanned for hibernate annotations,
606 you can pass <tt>-Dhibernate.export.scan_dependencies=none</tt> to maven
607 or set <tt>scanDependencies</tt> to <tt>none</tt> in the configuration
608 of the plugin like this:
612 <pre class="prettyprint linenums lang-html">
614 <groupId>de.juplo</groupId>
615 <artifactId>hibernate4-maven-plugin</artifactId>
617 <configuration>
618 <scanDependencies>none</scanDependencies>
619 </configuration>
620 </plugin></pre></div>
622 <div class="section">
623 <h2><a name="No_annotated_classes_found"></a>No annotated classes found</h2>
626 If you are working under Windows and get the error-message
627 <tt>No annotated classes found in directory C:\projects\X Y Z\path-to-project\target\classes</tt>,
628 but you are really sure, that there are annotated classes in that
629 directory, you are expiriencing a bug, in the scannotation-library, that
630 was closed in version 1.1.0 of the hibernate-maven-plugin.
635 You should consider to upgrade to that version of the plugin.
645 <li><a href="integration.html">CI Management</a></li><li><a href="dependencies.html">Dependencies</a></li><li><a href="dependency-info.html">Dependency Information</a></li><li><a href="distribution-management.html">Distribution Management</a></li><li><a href="index.html">Overview</a></li><li><a href="license.html">Licenses</a></li><li><a href="plugin-management.html">Plugin Management</a></li><li><a href="plugins.html">Plugins</a></li><li><a href="team-list.html">Team</a></li><li><a href="source-repository.html">Source Code Management</a></li><li><a href="project-summary.html">Summary</a></li><li><a href="project-info.html">Project Information</a></li><li><a href="testapidocs/index.html">Test JavaDocs</a></li><li><a href="apidocs/index.html">JavaDocs</a></li><li><a href="xref/index.html">Source Xref</a></li><li><a href="xref-test/index.html">Test Source Xref</a></li><li><a href="pmd.html">PMD</a></li><li><a href="plugin-info.html">Plugin Documentation</a></li><li><a href="project-reports.html">Project Reports</a></li><li><a href="configuration.html">Configuration Examples</a></li><li><a href="export-mojo.html">Parameter Documentation</a></li><li><a href="debugging.html">Enable Debug-Output</a></li><li><a href="skip.html">Skipping Execution</a></li><li><a href="force.html">Force Exceution</a></li><li><a href="pitfalls.html">Known Pitfalls (FAQ)</a></li> </ul>