2 <!-- Generated by Apache Maven Doxia Site Renderer 1.4 at 2013-12-16 -->
3 <!-- Current: export-mojo.html -->
4 <!-- Active: index.html -->
5 <!-- Path: [index.html, export-mojo.html] -->
6 <!-- Skiplist: [index.html, configuration.html, export-mojo.html, debugging.html, skip.html, force.html, pitfalls.html] -->
9 <title>juplo - Hibernate 4 Maven Plugin - Parameter Documentation</title>
10 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
11 <link rel="canonical" href="http://juplo.de/hibernate4-maven-plugin/export-mojo.html"/>
12 <link rel="stylesheet" type="text/css" href="/css/base.css" />
13 <style type="text/css">
14 @import '/css/screen.css' screen and (min-width: 960px);
15 @import '/css/phone.css' screen and (max-width: 599px);
16 @import '/css/tiny.css' screen and (max-width: 399px);
18 <script src="/js/base.js"></script>
20 <script src="/js/ie8.js"></script>
23 <script src="/js/ie7.js"></script>
26 <script src="/js/ie6.js"></script>
28 <meta name="Date-Revision-yyyymmdd" content="20131216" />
29 <meta http-equiv="Content-Language" content="en" />
32 <body onload="prettyPrint()">
35 <a href="/" title="Home" id="logo">juplo</a>
36 <span id="slogan"><strong>Java</strong> bits from nerds for nerds</span>
40 <strong class="b title">You are here:</strong>
42 <li class="b"><a class="b" href="/">Home</a></li>
43 <li class="b"><a class="b" href="/projects.html">Projects</a></li>
44 <li class="b"><a class="b" href="./index.html">Hibernate 4 Maven Plugin</a </li>
45 <li class="b"><strong class="b">Parameter Documentation</strong></li>
47 <a class="hide" href="#navigation">Jump to navigation</a>
50 <div class="fc cols_2">
51 <div class="content cf">
52 <section id="content" class="main">
53 <h1>Hibernate 4 Maven Plugin - Parameter Documentation</h1>
57 <h2>hibernate4:export<a name="hibernate4:export"></a></h2>
59 <p><b>Full name</b>:</p>
61 <p>de.juplo:hibernate4-maven-plugin:1.0.3:export</p>
63 <p><b>Description</b>:</p>
65 <div>Goal which extracts the hibernate-mapping-configuration and exports
66 an according SQL-database-schema.</div>
68 <p><b>Attributes</b>:</p>
72 <li>Requires a Maven project to be executed.</li>
74 <li>Requires dependency resolution of artifacts in scope: <tt>runtime</tt>.</li>
76 <li>The goal is thread-safe and supports parallel builds.</li>
78 <li>Binds by default to the <a class="externalLink" href="http://maven.apache.org/ref/current/maven-core/lifecycles.html">lifecycle phase</a>: <tt>process-classes</tt>.</li>
82 <h3>Optional Parameters<a name="Optional_Parameters"></a></h3>
84 <table class="bodyTable" border="0">
99 <td><b><a href="#delimiter">delimiter</a></b></td>
101 <td><tt>String</tt></td>
103 <td><tt>1.0</tt></td>
105 <td>Delimiter in output-file.<br /><b>Default value is</b>: <tt>;</tt>.<br /><b>User property is</b>: <tt>hibernate.export.schema.delimiter</tt>.</td>
110 <td><b><a href="#driverClassName">driverClassName</a></b></td>
112 <td><tt>String</tt></td>
114 <td><tt>1.0</tt></td>
116 <td>SQL-Driver name.<br /><b>User property is</b>: <tt>hibernate.connection.driver_class</tt>.</td>
121 <td><b><a href="#envers">envers</a></b></td>
123 <td><tt>boolean</tt></td>
125 <td><tt>1.0.3</tt></td>
127 <td>Generate envers schema for auditing tables.<br /><b>Default value is</b>: <tt>false</tt>.<br /><b>User property is</b>: <tt>hibernate.export.envers</tt>.</td>
132 <td><b><a href="#force">force</a></b></td>
134 <td><tt>boolean</tt></td>
136 <td><tt>1.0</tt></td>
140 <p>Force execution, even if no modified or newly added annotated
141 classes where found and the dialect was not changed.</p>
143 <p><tt>skip</tt> takes precedence over <tt>force</tt>.</p><br /><b>Default value is</b>: <tt>false</tt>.<br /><b>User property is</b>: <tt>hibernate.export.force</tt>.</td>
148 <td><b><a href="#format">format</a></b></td>
150 <td><tt>boolean</tt></td>
152 <td><tt>1.0</tt></td>
154 <td>Format output-file.<br /><b>Default value is</b>: <tt>true</tt>.<br /><b>User property is</b>: <tt>hibernate.export.schema.format</tt>.</td>
159 <td><b><a href="#hibernateDialect">hibernateDialect</a></b></td>
161 <td><tt>String</tt></td>
163 <td><tt>1.0</tt></td>
165 <td>Hibernate dialect.<br /><b>User property is</b>: <tt>hibernate.dialect</tt>.</td>
170 <td><b><a href="#hibernateMapping">hibernateMapping</a></b></td>
172 <td><tt>String</tt></td>
174 <td><tt>1.0.2</tt></td>
176 <td>List of Hibernate-Mapping-Files (XML). Multiple files can be
177 separated with white-spaces and/or commas.<br /><b>User property is</b>: <tt>hibernate.mapping</tt>.</td>
182 <td><b><a href="#hibernateNamingStrategy">hibernateNamingStrategy</a></b></td>
184 <td><tt>String</tt></td>
186 <td><tt>1.0.2</tt></td>
188 <td>Hibernate Naming Strategy<br /><b>User property is</b>: <tt>hibernate.ejb.naming_strategy</tt>.</td>
193 <td><b><a href="#hibernateProperties">hibernateProperties</a></b></td>
195 <td><tt>String</tt></td>
197 <td><tt>1.0</tt></td>
199 <td>Path to Hibernate configuration file.<br /><b>Default value is</b>: <tt>${project.build.outputDirectory}/hibernate.properties</tt>.<br /></td>
204 <td><b><a href="#outputDirectory">outputDirectory</a></b></td>
206 <td><tt>String</tt></td>
208 <td><tt>1.0</tt></td>
210 <td>Classes-Directory to scan.
212 <p>This parameter defaults to the maven build-output-directory for
213 classes. Additonally, all dependencies are scanned for annotated
214 classes.</p><br /><b>User property is</b>: <tt>project.build.outputDirectory</tt>.</td>
219 <td><b><a href="#outputFile">outputFile</a></b></td>
221 <td><tt>String</tt></td>
223 <td><tt>1.0</tt></td>
225 <td>Output file.<br /><b>Default value is</b>: <tt>${project.build.directory}/schema.sql</tt>.<br /><b>User property is</b>: <tt>hibernate.export.schema.filename</tt>.</td>
230 <td><b><a href="#password">password</a></b></td>
232 <td><tt>String</tt></td>
234 <td><tt>1.0</tt></td>
236 <td>Database password<br /><b>User property is</b>: <tt>hibernate.connection.password</tt>.</td>
241 <td><b><a href="#scanDependencies">scanDependencies</a></b></td>
243 <td><tt>String</tt></td>
245 <td><tt>1.0.3</tt></td>
247 <td>Dependency-Scopes, that should be scanned for annotated classes.
249 <p>By default, only dependencies in the scope <tt>compile</tt>
250 are scanned for annotated classes. Multiple scopes can be seperated
251 by white space or commas.</p>
253 <p>The plugin does not scan for annotated classes in transitive
254 dependencies. If some of your annotated classes are hidden in a
255 transitive dependency, you can simply add that dependency
256 explicitly.</p><br /><b>Default value is</b>: <tt>compile</tt>.<br /><b>User property is</b>: <tt>hibernate.export.scan_dependencies</tt>.</td>
261 <td><b><a href="#scanTestClasses">scanTestClasses</a></b></td>
263 <td><tt>boolean</tt></td>
265 <td><tt>1.0.1</tt></td>
267 <td>Wether to scan test-classes too, or not.
269 <p>If this parameter is set to <tt>true</tt> the test-classes
270 of the artifact will be scanned for hibernate-annotated classes
271 additionally.</p><br /><b>Default value is</b>: <tt>false</tt>.<br /><b>User property is</b>: <tt>hibernate.export.scan_testclasses</tt>.</td>
276 <td><b><a href="#skip">skip</a></b></td>
278 <td><tt>boolean</tt></td>
280 <td><tt>1.0</tt></td>
284 <p>If set to <tt>true</tt>, the execution is skipped.</p>
286 <p>A skipped excecution is signaled via the maven-property
287 <tt>${hibernate.export.skipped}</tt>.</p>
289 <p>The excecution is skipped automatically, if no modified or newly
290 added annotated classes are found and the dialect was not
291 changed.</p><br /><b>Default value is</b>: <tt>false</tt>.<br /><b>User property is</b>: <tt>maven.test.skip</tt>.</td>
296 <td><b><a href="#target">target</a></b></td>
298 <td><tt>String</tt></td>
300 <td><tt>1.0</tt></td>
302 <td>Target of execution:
306 <li><b>NONE</b> only export schema to SQL-script (forces
307 excecution, signals skip)</li>
309 <li><b>EXPORT</b> create database
310 (<b>DEFAULT!</b>). forces excecution, signals skip)</li>
312 <li><b>SCRIPT</b> export schema to SQL-script and print
317 A databaseconnection is only needed for EXPORT and BOTH, but a
318 Hibernate-Dialect must always be choosen.<br /><b>Default value is</b>: <tt>EXPORT</tt>.<br /><b>User property is</b>: <tt>hibernate.export.target</tt>.</td>
323 <td><b><a href="#testOutputDirectory">testOutputDirectory</a></b></td>
325 <td><tt>String</tt></td>
327 <td><tt>1.0.2</tt></td>
329 <td>Test-Classes-Directory to scan.
331 <p>This parameter defaults to the maven build-output-directory for
334 <p>This parameter is only used, when <tt>scanTestClasses</tt>
335 is set to <tt>true</tt>!</p><br /><b>User property is</b>: <tt>project.build.testOutputDirectory</tt>.</td>
340 <td><b><a href="#type">type</a></b></td>
342 <td><tt>String</tt></td>
344 <td><tt>1.0</tt></td>
346 <td>Type of execution.
350 <li><b>NONE</b> do nothing - just validate the
353 <li><b>CREATE</b> create database-schema</li>
355 <li><b>DROP</b> drop database-schema</li>
357 <li><b>BOTH</b> (<b>DEFAULT!</b>)</li>
359 If NONE is choosen, no databaseconnection is needed.<br /><b>Default value is</b>: <tt>BOTH</tt>.<br /><b>User property is</b>: <tt>hibernate.export.type</tt>.</td>
364 <td><b><a href="#url">url</a></b></td>
366 <td><tt>String</tt></td>
368 <td><tt>1.0</tt></td>
370 <td>Database URL.<br /><b>User property is</b>: <tt>hibernate.connection.url</tt>.</td>
375 <td><b><a href="#username">username</a></b></td>
377 <td><tt>String</tt></td>
379 <td><tt>1.0</tt></td>
381 <td>Database username<br /><b>User property is</b>: <tt>hibernate.connection.username</tt>.</td>
386 <div class="section">
387 <h3>Parameter Details<a name="Parameter_Details"></a></h3>
389 <p><b><a name="delimiter">delimiter</a>:</b></p>
391 <div>Delimiter in output-file.</div>
395 <li><b>Type</b>: <tt>java.lang.String</tt></li>
397 <li><b>Since</b>: <tt>1.0</tt></li>
399 <li><b>Required</b>: <tt>No</tt></li>
401 <li><b>User Property</b>: <tt>hibernate.export.schema.delimiter</tt></li>
403 <li><b>Default</b>: <tt>;</tt></li>
405 <p><b><a name="driverClassName">driverClassName</a>:</b></p>
407 <div>SQL-Driver name.</div>
411 <li><b>Type</b>: <tt>java.lang.String</tt></li>
413 <li><b>Since</b>: <tt>1.0</tt></li>
415 <li><b>Required</b>: <tt>No</tt></li>
417 <li><b>User Property</b>: <tt>hibernate.connection.driver_class</tt></li>
419 <p><b><a name="envers">envers</a>:</b></p>
421 <div>Generate envers schema for auditing tables.</div>
425 <li><b>Type</b>: <tt>boolean</tt></li>
427 <li><b>Since</b>: <tt>1.0.3</tt></li>
429 <li><b>Required</b>: <tt>No</tt></li>
431 <li><b>User Property</b>: <tt>hibernate.export.envers</tt></li>
433 <li><b>Default</b>: <tt>false</tt></li>
435 <p><b><a name="force">force</a>:</b></p>
439 <p>Force execution, even if no modified or newly added annotated
440 classes where found and the dialect was not changed.</p>
442 <p><tt>skip</tt> takes precedence over <tt>force</tt>.</p></div>
446 <li><b>Type</b>: <tt>boolean</tt></li>
448 <li><b>Since</b>: <tt>1.0</tt></li>
450 <li><b>Required</b>: <tt>No</tt></li>
452 <li><b>User Property</b>: <tt>hibernate.export.force</tt></li>
454 <li><b>Default</b>: <tt>false</tt></li>
456 <p><b><a name="format">format</a>:</b></p>
458 <div>Format output-file.</div>
462 <li><b>Type</b>: <tt>boolean</tt></li>
464 <li><b>Since</b>: <tt>1.0</tt></li>
466 <li><b>Required</b>: <tt>No</tt></li>
468 <li><b>User Property</b>: <tt>hibernate.export.schema.format</tt></li>
470 <li><b>Default</b>: <tt>true</tt></li>
472 <p><b><a name="hibernateDialect">hibernateDialect</a>:</b></p>
474 <div>Hibernate dialect.</div>
478 <li><b>Type</b>: <tt>java.lang.String</tt></li>
480 <li><b>Since</b>: <tt>1.0</tt></li>
482 <li><b>Required</b>: <tt>No</tt></li>
484 <li><b>User Property</b>: <tt>hibernate.dialect</tt></li>
486 <p><b><a name="hibernateMapping">hibernateMapping</a>:</b></p>
488 <div>List of Hibernate-Mapping-Files (XML). Multiple files can be
489 separated with white-spaces and/or commas.</div>
493 <li><b>Type</b>: <tt>java.lang.String</tt></li>
495 <li><b>Since</b>: <tt>1.0.2</tt></li>
497 <li><b>Required</b>: <tt>No</tt></li>
499 <li><b>User Property</b>: <tt>hibernate.mapping</tt></li>
501 <p><b><a name="hibernateNamingStrategy">hibernateNamingStrategy</a>:</b></p>
503 <div>Hibernate Naming Strategy</div>
507 <li><b>Type</b>: <tt>java.lang.String</tt></li>
509 <li><b>Since</b>: <tt>1.0.2</tt></li>
511 <li><b>Required</b>: <tt>No</tt></li>
513 <li><b>User Property</b>: <tt>hibernate.ejb.naming_strategy</tt></li>
515 <p><b><a name="hibernateProperties">hibernateProperties</a>:</b></p>
517 <div>Path to Hibernate configuration file.</div>
521 <li><b>Type</b>: <tt>java.lang.String</tt></li>
523 <li><b>Since</b>: <tt>1.0</tt></li>
525 <li><b>Required</b>: <tt>No</tt></li>
527 <li><b>Default</b>: <tt>${project.build.outputDirectory}/hibernate.properties</tt></li>
529 <p><b><a name="outputDirectory">outputDirectory</a>:</b></p>
531 <div>Classes-Directory to scan.
533 <p>This parameter defaults to the maven build-output-directory for
534 classes. Additonally, all dependencies are scanned for annotated
539 <li><b>Type</b>: <tt>java.lang.String</tt></li>
541 <li><b>Since</b>: <tt>1.0</tt></li>
543 <li><b>Required</b>: <tt>No</tt></li>
545 <li><b>User Property</b>: <tt>project.build.outputDirectory</tt></li>
547 <p><b><a name="outputFile">outputFile</a>:</b></p>
549 <div>Output file.</div>
553 <li><b>Type</b>: <tt>java.lang.String</tt></li>
555 <li><b>Since</b>: <tt>1.0</tt></li>
557 <li><b>Required</b>: <tt>No</tt></li>
559 <li><b>User Property</b>: <tt>hibernate.export.schema.filename</tt></li>
561 <li><b>Default</b>: <tt>${project.build.directory}/schema.sql</tt></li>
563 <p><b><a name="password">password</a>:</b></p>
565 <div>Database password</div>
569 <li><b>Type</b>: <tt>java.lang.String</tt></li>
571 <li><b>Since</b>: <tt>1.0</tt></li>
573 <li><b>Required</b>: <tt>No</tt></li>
575 <li><b>User Property</b>: <tt>hibernate.connection.password</tt></li>
577 <p><b><a name="scanDependencies">scanDependencies</a>:</b></p>
579 <div>Dependency-Scopes, that should be scanned for annotated classes.
581 <p>By default, only dependencies in the scope <tt>compile</tt>
582 are scanned for annotated classes. Multiple scopes can be seperated
583 by white space or commas.</p>
585 <p>The plugin does not scan for annotated classes in transitive
586 dependencies. If some of your annotated classes are hidden in a
587 transitive dependency, you can simply add that dependency
588 explicitly.</p></div>
592 <li><b>Type</b>: <tt>java.lang.String</tt></li>
594 <li><b>Since</b>: <tt>1.0.3</tt></li>
596 <li><b>Required</b>: <tt>No</tt></li>
598 <li><b>User Property</b>: <tt>hibernate.export.scan_dependencies</tt></li>
600 <li><b>Default</b>: <tt>compile</tt></li>
602 <p><b><a name="scanTestClasses">scanTestClasses</a>:</b></p>
604 <div>Wether to scan test-classes too, or not.
606 <p>If this parameter is set to <tt>true</tt> the test-classes
607 of the artifact will be scanned for hibernate-annotated classes
608 additionally.</p></div>
612 <li><b>Type</b>: <tt>boolean</tt></li>
614 <li><b>Since</b>: <tt>1.0.1</tt></li>
616 <li><b>Required</b>: <tt>No</tt></li>
618 <li><b>User Property</b>: <tt>hibernate.export.scan_testclasses</tt></li>
620 <li><b>Default</b>: <tt>false</tt></li>
622 <p><b><a name="skip">skip</a>:</b></p>
626 <p>If set to <tt>true</tt>, the execution is skipped.</p>
628 <p>A skipped excecution is signaled via the maven-property
629 <tt>${hibernate.export.skipped}</tt>.</p>
631 <p>The excecution is skipped automatically, if no modified or newly
632 added annotated classes are found and the dialect was not
637 <li><b>Type</b>: <tt>boolean</tt></li>
639 <li><b>Since</b>: <tt>1.0</tt></li>
641 <li><b>Required</b>: <tt>No</tt></li>
643 <li><b>User Property</b>: <tt>maven.test.skip</tt></li>
645 <li><b>Default</b>: <tt>false</tt></li>
647 <p><b><a name="target">target</a>:</b></p>
649 <div>Target of execution:
653 <li><b>NONE</b> only export schema to SQL-script (forces
654 excecution, signals skip)</li>
656 <li><b>EXPORT</b> create database
657 (<b>DEFAULT!</b>). forces excecution, signals skip)</li>
659 <li><b>SCRIPT</b> export schema to SQL-script and print
664 A databaseconnection is only needed for EXPORT and BOTH, but a
665 Hibernate-Dialect must always be choosen.</div>
669 <li><b>Type</b>: <tt>java.lang.String</tt></li>
671 <li><b>Since</b>: <tt>1.0</tt></li>
673 <li><b>Required</b>: <tt>No</tt></li>
675 <li><b>User Property</b>: <tt>hibernate.export.target</tt></li>
677 <li><b>Default</b>: <tt>EXPORT</tt></li>
679 <p><b><a name="testOutputDirectory">testOutputDirectory</a>:</b></p>
681 <div>Test-Classes-Directory to scan.
683 <p>This parameter defaults to the maven build-output-directory for
686 <p>This parameter is only used, when <tt>scanTestClasses</tt>
687 is set to <tt>true</tt>!</p></div>
691 <li><b>Type</b>: <tt>java.lang.String</tt></li>
693 <li><b>Since</b>: <tt>1.0.2</tt></li>
695 <li><b>Required</b>: <tt>No</tt></li>
697 <li><b>User Property</b>: <tt>project.build.testOutputDirectory</tt></li>
699 <p><b><a name="type">type</a>:</b></p>
701 <div>Type of execution.
705 <li><b>NONE</b> do nothing - just validate the
708 <li><b>CREATE</b> create database-schema</li>
710 <li><b>DROP</b> drop database-schema</li>
712 <li><b>BOTH</b> (<b>DEFAULT!</b>)</li>
714 If NONE is choosen, no databaseconnection is needed.</div>
718 <li><b>Type</b>: <tt>java.lang.String</tt></li>
720 <li><b>Since</b>: <tt>1.0</tt></li>
722 <li><b>Required</b>: <tt>No</tt></li>
724 <li><b>User Property</b>: <tt>hibernate.export.type</tt></li>
726 <li><b>Default</b>: <tt>BOTH</tt></li>
728 <p><b><a name="url">url</a>:</b></p>
730 <div>Database URL.</div>
734 <li><b>Type</b>: <tt>java.lang.String</tt></li>
736 <li><b>Since</b>: <tt>1.0</tt></li>
738 <li><b>Required</b>: <tt>No</tt></li>
740 <li><b>User Property</b>: <tt>hibernate.connection.url</tt></li>
742 <p><b><a name="username">username</a>:</b></p>
744 <div>Database username</div>
748 <li><b>Type</b>: <tt>java.lang.String</tt></li>
750 <li><b>Since</b>: <tt>1.0</tt></li>
752 <li><b>Required</b>: <tt>No</tt></li>
754 <li><b>User Property</b>: <tt>hibernate.connection.username</tt></li>
761 <div class="marginal">
764 <a id="navigation"></a>
765 <h2 class="nav menu">Section-Menu</h2>
767 <li class="m blog"><a href="/blog/" class="m">Blog</a></li>
768 <li class="m projects"><a href="/projects.html" class="m selected">Projects</a></li>
770 <h2 class="nav submenu">
771 <span class="s">Submenu for section</span>
772 <a class="s selected" href="/projects.html">Projects</a>
774 <ul id="submenu" class="s">
776 <a class="s selected" href="./index.html">Hibernate 4 Maven Plugin</a>
777 <ul class="s active">
779 <a href="configuration.html" class="s" title="Configuration Examples">Configuration Examples</a>
782 <strong class="s">Parameter Documentation</strong>
785 <a href="debugging.html" class="s" title="Enable Debug-Output">Enable Debug-Output</a>
788 <a href="skip.html" class="s" title="Skipping Execution">Skipping Execution</a>
791 <a href="force.html" class="s" title="Force Exceution">Force Exceution</a>
794 <a href="pitfalls.html" class="s" title="Known Pitfalls (FAQ)">Known Pitfalls (FAQ)</a>
797 <a href="project-info.html" class="s" title="Project Information">Project Information</a>
800 <a href="project-reports.html" class="s" title="Project Reports">Project Reports</a>
808 <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
809 <img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
817 <ul id="footerlinks">
818 <li class="f" id="copyright">© <strong>mo</strong> 2013
823 <script type="text/javascript"><!--//--><![CDATA[//><!--
824 var _gaq = _gaq || [];
825 _gaq.push(['_setAccount', 'UA-571104-3']);
826 _gaq.push(['_trackPageview']);
828 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
829 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
830 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);