2 <!-- Generated by Apache Maven Doxia Site Renderer 1.4 at 2014-06-02 -->
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 <meta name="viewport" content="width=device-width, initial-scale=1" />
13 <link rel="stylesheet" type="text/css" href="/css/base.css" />
14 <style type="text/css">
15 @import '/css/screen.css' screen;
17 <script src="/js/base.js"></script>
19 <link rel="stylesheet" type="text/css" href="/css/ie8.css" />
20 <script src="/js/ie8.js"></script>
23 <script src="/js/ie7.js"></script>
26 <script src="/js/ie6.js"></script>
30 <body class="menu" onload="prettyPrint()">
31 <div id="page" class="cf">
33 <h1 id="logo"><a href="/" title="Home" class="l">juplo</a></h1>
34 <span id="slogan"><strong>Java</strong> bits from nerds for nerds</span>
38 <strong class="b title">You are here:</strong>
40 <li class="b"><a class="b" href="/">Home</a></li>
41 <li class="b"><a class="b" href="/projects.html">Projects</a></li>
42 <li class="b"><a class="b" href="./index.html">Hibernate 4 Maven Plugin</a></li>
43 <li class="b"><strong class="b">Parameter Documentation</strong></li>
45 <a class="hide" href="#navigation">Jump to navigation</a>
48 <main class="content cf">
49 <article id="content" class="main">
50 <header><h1>Parameter Documentation</h1></header>
54 <h2>hibernate4:export<a name="hibernate4:export"></a></h2>
56 <p><b>Full name</b>:</p>
58 <p>de.juplo:hibernate4-maven-plugin:1.0.4:export</p>
60 <p><b>Description</b>:</p>
62 <div>Goal which extracts the hibernate-mapping-configuration and exports
63 an according SQL-database-schema.</div>
65 <p><b>Attributes</b>:</p>
69 <li>Requires a Maven project to be executed.</li>
71 <li>Requires dependency resolution of artifacts in scope: <tt>runtime</tt>.</li>
73 <li>The goal is thread-safe and supports parallel builds.</li>
75 <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>
79 <h3>Optional Parameters<a name="Optional_Parameters"></a></h3>
81 <table class="bodyTable" border="0">
96 <td><b><a href="#delimiter">delimiter</a></b></td>
98 <td><tt>String</tt></td>
100 <td><tt>1.0</tt></td>
102 <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>
107 <td><b><a href="#driverClassName">driverClassName</a></b></td>
109 <td><tt>String</tt></td>
111 <td><tt>1.0</tt></td>
113 <td>SQL-Driver name.<br /><b>User property is</b>: <tt>hibernate.connection.driver_class</tt>.</td>
118 <td><b><a href="#envers">envers</a></b></td>
120 <td><tt>boolean</tt></td>
122 <td><tt>1.0.3</tt></td>
124 <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>
129 <td><b><a href="#force">force</a></b></td>
131 <td><tt>boolean</tt></td>
133 <td><tt>1.0</tt></td>
137 <p>Force execution, even if no modified or newly added annotated
138 classes where found and the dialect was not changed.</p>
140 <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>
145 <td><b><a href="#format">format</a></b></td>
147 <td><tt>boolean</tt></td>
149 <td><tt>1.0</tt></td>
151 <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>
156 <td><b><a href="#hibernateDialect">hibernateDialect</a></b></td>
158 <td><tt>String</tt></td>
160 <td><tt>1.0</tt></td>
162 <td>Hibernate dialect.<br /><b>User property is</b>: <tt>hibernate.dialect</tt>.</td>
167 <td><b><a href="#hibernateMapping">hibernateMapping</a></b></td>
169 <td><tt>String</tt></td>
171 <td><tt>1.0.2</tt></td>
173 <td>List of Hibernate-Mapping-Files (XML). Multiple files can be
174 separated with white-spaces and/or commas.<br /><b>User property is</b>: <tt>hibernate.mapping</tt>.</td>
179 <td><b><a href="#hibernateNamingStrategy">hibernateNamingStrategy</a></b></td>
181 <td><tt>String</tt></td>
183 <td><tt>1.0.2</tt></td>
185 <td>Hibernate Naming Strategy<br /><b>User property is</b>: <tt>hibernate.ejb.naming_strategy</tt>.</td>
190 <td><b><a href="#hibernateProperties">hibernateProperties</a></b></td>
192 <td><tt>String</tt></td>
194 <td><tt>1.0</tt></td>
196 <td>Path to Hibernate configuration file.<br /><b>Default value is</b>: <tt>${project.build.outputDirectory}/hibernate.properties</tt>.<br /></td>
201 <td><b><a href="#outputDirectory">outputDirectory</a></b></td>
203 <td><tt>String</tt></td>
205 <td><tt>1.0</tt></td>
207 <td>Classes-Directory to scan.
209 <p>This parameter defaults to the maven build-output-directory for
210 classes. Additionally, all dependencies are scanned for annotated
211 classes.</p><br /><b>User property is</b>: <tt>project.build.outputDirectory</tt>.</td>
216 <td><b><a href="#outputFile">outputFile</a></b></td>
218 <td><tt>String</tt></td>
220 <td><tt>1.0</tt></td>
222 <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>
227 <td><b><a href="#password">password</a></b></td>
229 <td><tt>String</tt></td>
231 <td><tt>1.0</tt></td>
233 <td>Database password<br /><b>User property is</b>: <tt>hibernate.connection.password</tt>.</td>
238 <td><b><a href="#scanDependencies">scanDependencies</a></b></td>
240 <td><tt>String</tt></td>
242 <td><tt>1.0.3</tt></td>
244 <td>Dependency-Scopes, that should be scanned for annotated classes.
246 <p>By default, only dependencies in the scope <tt>compile</tt>
247 are scanned for annotated classes. Multiple scopes can be seperated
248 by white space or commas.</p>
250 <p>The plugin does not scan for annotated classes in transitive
251 dependencies. If some of your annotated classes are hidden in a
252 transitive dependency, you can simply add that dependency
253 explicitly.</p><br /><b>Default value is</b>: <tt>compile</tt>.<br /><b>User property is</b>: <tt>hibernate.export.scan_dependencies</tt>.</td>
258 <td><b><a href="#scanTestClasses">scanTestClasses</a></b></td>
260 <td><tt>boolean</tt></td>
262 <td><tt>1.0.1</tt></td>
264 <td>Whether to scan test-classes too, or not.
266 <p>If this parameter is set to <tt>true</tt> the test-classes
267 of the artifact will be scanned for hibernate-annotated classes
268 additionally.</p><br /><b>Default value is</b>: <tt>false</tt>.<br /><b>User property is</b>: <tt>hibernate.export.scan_testclasses</tt>.</td>
273 <td><b><a href="#skip">skip</a></b></td>
275 <td><tt>boolean</tt></td>
277 <td><tt>1.0</tt></td>
281 <p>If set to <tt>true</tt>, the execution is skipped.</p>
283 <p>A skipped execution is signaled via the maven-property
284 <tt>${hibernate.export.skipped}</tt>.</p>
286 <p>The execution is skipped automatically, if no modified or newly
287 added annotated classes are found and the dialect was not
288 changed.</p><br /><b>Default value is</b>: <tt>${maven.test.skip}</tt>.<br /><b>User property is</b>: <tt>hibernate.skip</tt>.</td>
293 <td><b><a href="#target">target</a></b></td>
295 <td><tt>String</tt></td>
297 <td><tt>1.0</tt></td>
299 <td>Target of execution:
303 <li><b>NONE</b> only export schema to SQL-script (forces
304 execution, signals skip)</li>
306 <li><b>EXPORT</b> create database
307 (<b>DEFAULT!</b>). forces execution, signals skip)</li>
309 <li><b>SCRIPT</b> export schema to SQL-script and print
314 A database connection is only needed for EXPORT and BOTH, but a
315 Hibernate-Dialect must always be chosen.<br /><b>Default value is</b>: <tt>EXPORT</tt>.<br /><b>User property is</b>: <tt>hibernate.export.target</tt>.</td>
320 <td><b><a href="#testOutputDirectory">testOutputDirectory</a></b></td>
322 <td><tt>String</tt></td>
324 <td><tt>1.0.2</tt></td>
326 <td>Test-Classes-Directory to scan.
328 <p>This parameter defaults to the maven build-output-directory for
331 <p>This parameter is only used, when <tt>scanTestClasses</tt>
332 is set to <tt>true</tt>!</p><br /><b>User property is</b>: <tt>project.build.testOutputDirectory</tt>.</td>
337 <td><b><a href="#type">type</a></b></td>
339 <td><tt>String</tt></td>
341 <td><tt>1.0</tt></td>
343 <td>Type of execution.
347 <li><b>NONE</b> do nothing - just validate the
350 <li><b>CREATE</b> create database-schema</li>
352 <li><b>DROP</b> drop database-schema</li>
354 <li><b>BOTH</b> (<b>DEFAULT!</b>)</li>
356 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>
361 <td><b><a href="#url">url</a></b></td>
363 <td><tt>String</tt></td>
365 <td><tt>1.0</tt></td>
367 <td>Database URL.<br /><b>User property is</b>: <tt>hibernate.connection.url</tt>.</td>
372 <td><b><a href="#username">username</a></b></td>
374 <td><tt>String</tt></td>
376 <td><tt>1.0</tt></td>
378 <td>Database username<br /><b>User property is</b>: <tt>hibernate.connection.username</tt>.</td>
383 <div class="section">
384 <h3>Parameter Details<a name="Parameter_Details"></a></h3>
386 <p><b><a name="delimiter">delimiter</a>:</b></p>
388 <div>Delimiter in output-file.</div>
392 <li><b>Type</b>: <tt>java.lang.String</tt></li>
394 <li><b>Since</b>: <tt>1.0</tt></li>
396 <li><b>Required</b>: <tt>No</tt></li>
398 <li><b>User Property</b>: <tt>hibernate.export.schema.delimiter</tt></li>
400 <li><b>Default</b>: <tt>;</tt></li>
402 <p><b><a name="driverClassName">driverClassName</a>:</b></p>
404 <div>SQL-Driver name.</div>
408 <li><b>Type</b>: <tt>java.lang.String</tt></li>
410 <li><b>Since</b>: <tt>1.0</tt></li>
412 <li><b>Required</b>: <tt>No</tt></li>
414 <li><b>User Property</b>: <tt>hibernate.connection.driver_class</tt></li>
416 <p><b><a name="envers">envers</a>:</b></p>
418 <div>Generate envers schema for auditing tables.</div>
422 <li><b>Type</b>: <tt>boolean</tt></li>
424 <li><b>Since</b>: <tt>1.0.3</tt></li>
426 <li><b>Required</b>: <tt>No</tt></li>
428 <li><b>User Property</b>: <tt>hibernate.export.envers</tt></li>
430 <li><b>Default</b>: <tt>false</tt></li>
432 <p><b><a name="force">force</a>:</b></p>
436 <p>Force execution, even if no modified or newly added annotated
437 classes where found and the dialect was not changed.</p>
439 <p><tt>skip</tt> takes precedence over <tt>force</tt>.</p></div>
443 <li><b>Type</b>: <tt>boolean</tt></li>
445 <li><b>Since</b>: <tt>1.0</tt></li>
447 <li><b>Required</b>: <tt>No</tt></li>
449 <li><b>User Property</b>: <tt>hibernate.export.force</tt></li>
451 <li><b>Default</b>: <tt>false</tt></li>
453 <p><b><a name="format">format</a>:</b></p>
455 <div>Format output-file.</div>
459 <li><b>Type</b>: <tt>boolean</tt></li>
461 <li><b>Since</b>: <tt>1.0</tt></li>
463 <li><b>Required</b>: <tt>No</tt></li>
465 <li><b>User Property</b>: <tt>hibernate.export.schema.format</tt></li>
467 <li><b>Default</b>: <tt>true</tt></li>
469 <p><b><a name="hibernateDialect">hibernateDialect</a>:</b></p>
471 <div>Hibernate dialect.</div>
475 <li><b>Type</b>: <tt>java.lang.String</tt></li>
477 <li><b>Since</b>: <tt>1.0</tt></li>
479 <li><b>Required</b>: <tt>No</tt></li>
481 <li><b>User Property</b>: <tt>hibernate.dialect</tt></li>
483 <p><b><a name="hibernateMapping">hibernateMapping</a>:</b></p>
485 <div>List of Hibernate-Mapping-Files (XML). Multiple files can be
486 separated with white-spaces and/or commas.</div>
490 <li><b>Type</b>: <tt>java.lang.String</tt></li>
492 <li><b>Since</b>: <tt>1.0.2</tt></li>
494 <li><b>Required</b>: <tt>No</tt></li>
496 <li><b>User Property</b>: <tt>hibernate.mapping</tt></li>
498 <p><b><a name="hibernateNamingStrategy">hibernateNamingStrategy</a>:</b></p>
500 <div>Hibernate Naming Strategy</div>
504 <li><b>Type</b>: <tt>java.lang.String</tt></li>
506 <li><b>Since</b>: <tt>1.0.2</tt></li>
508 <li><b>Required</b>: <tt>No</tt></li>
510 <li><b>User Property</b>: <tt>hibernate.ejb.naming_strategy</tt></li>
512 <p><b><a name="hibernateProperties">hibernateProperties</a>:</b></p>
514 <div>Path to Hibernate configuration file.</div>
518 <li><b>Type</b>: <tt>java.lang.String</tt></li>
520 <li><b>Since</b>: <tt>1.0</tt></li>
522 <li><b>Required</b>: <tt>No</tt></li>
524 <li><b>Default</b>: <tt>${project.build.outputDirectory}/hibernate.properties</tt></li>
526 <p><b><a name="outputDirectory">outputDirectory</a>:</b></p>
528 <div>Classes-Directory to scan.
530 <p>This parameter defaults to the maven build-output-directory for
531 classes. Additionally, all dependencies are scanned for annotated
536 <li><b>Type</b>: <tt>java.lang.String</tt></li>
538 <li><b>Since</b>: <tt>1.0</tt></li>
540 <li><b>Required</b>: <tt>No</tt></li>
542 <li><b>User Property</b>: <tt>project.build.outputDirectory</tt></li>
544 <p><b><a name="outputFile">outputFile</a>:</b></p>
546 <div>Output file.</div>
550 <li><b>Type</b>: <tt>java.lang.String</tt></li>
552 <li><b>Since</b>: <tt>1.0</tt></li>
554 <li><b>Required</b>: <tt>No</tt></li>
556 <li><b>User Property</b>: <tt>hibernate.export.schema.filename</tt></li>
558 <li><b>Default</b>: <tt>${project.build.directory}/schema.sql</tt></li>
560 <p><b><a name="password">password</a>:</b></p>
562 <div>Database password</div>
566 <li><b>Type</b>: <tt>java.lang.String</tt></li>
568 <li><b>Since</b>: <tt>1.0</tt></li>
570 <li><b>Required</b>: <tt>No</tt></li>
572 <li><b>User Property</b>: <tt>hibernate.connection.password</tt></li>
574 <p><b><a name="scanDependencies">scanDependencies</a>:</b></p>
576 <div>Dependency-Scopes, that should be scanned for annotated classes.
578 <p>By default, only dependencies in the scope <tt>compile</tt>
579 are scanned for annotated classes. Multiple scopes can be seperated
580 by white space or commas.</p>
582 <p>The plugin does not scan for annotated classes in transitive
583 dependencies. If some of your annotated classes are hidden in a
584 transitive dependency, you can simply add that dependency
585 explicitly.</p></div>
589 <li><b>Type</b>: <tt>java.lang.String</tt></li>
591 <li><b>Since</b>: <tt>1.0.3</tt></li>
593 <li><b>Required</b>: <tt>No</tt></li>
595 <li><b>User Property</b>: <tt>hibernate.export.scan_dependencies</tt></li>
597 <li><b>Default</b>: <tt>compile</tt></li>
599 <p><b><a name="scanTestClasses">scanTestClasses</a>:</b></p>
601 <div>Whether to scan test-classes too, or not.
603 <p>If this parameter is set to <tt>true</tt> the test-classes
604 of the artifact will be scanned for hibernate-annotated classes
605 additionally.</p></div>
609 <li><b>Type</b>: <tt>boolean</tt></li>
611 <li><b>Since</b>: <tt>1.0.1</tt></li>
613 <li><b>Required</b>: <tt>No</tt></li>
615 <li><b>User Property</b>: <tt>hibernate.export.scan_testclasses</tt></li>
617 <li><b>Default</b>: <tt>false</tt></li>
619 <p><b><a name="skip">skip</a>:</b></p>
623 <p>If set to <tt>true</tt>, the execution is skipped.</p>
625 <p>A skipped execution is signaled via the maven-property
626 <tt>${hibernate.export.skipped}</tt>.</p>
628 <p>The execution is skipped automatically, if no modified or newly
629 added annotated classes are found and the dialect was not
634 <li><b>Type</b>: <tt>boolean</tt></li>
636 <li><b>Since</b>: <tt>1.0</tt></li>
638 <li><b>Required</b>: <tt>No</tt></li>
640 <li><b>User Property</b>: <tt>hibernate.skip</tt></li>
642 <li><b>Default</b>: <tt>${maven.test.skip}</tt></li>
644 <p><b><a name="target">target</a>:</b></p>
646 <div>Target of execution:
650 <li><b>NONE</b> only export schema to SQL-script (forces
651 execution, signals skip)</li>
653 <li><b>EXPORT</b> create database
654 (<b>DEFAULT!</b>). forces execution, signals skip)</li>
656 <li><b>SCRIPT</b> export schema to SQL-script and print
661 A database connection is only needed for EXPORT and BOTH, but a
662 Hibernate-Dialect must always be chosen.</div>
666 <li><b>Type</b>: <tt>java.lang.String</tt></li>
668 <li><b>Since</b>: <tt>1.0</tt></li>
670 <li><b>Required</b>: <tt>No</tt></li>
672 <li><b>User Property</b>: <tt>hibernate.export.target</tt></li>
674 <li><b>Default</b>: <tt>EXPORT</tt></li>
676 <p><b><a name="testOutputDirectory">testOutputDirectory</a>:</b></p>
678 <div>Test-Classes-Directory to scan.
680 <p>This parameter defaults to the maven build-output-directory for
683 <p>This parameter is only used, when <tt>scanTestClasses</tt>
684 is set to <tt>true</tt>!</p></div>
688 <li><b>Type</b>: <tt>java.lang.String</tt></li>
690 <li><b>Since</b>: <tt>1.0.2</tt></li>
692 <li><b>Required</b>: <tt>No</tt></li>
694 <li><b>User Property</b>: <tt>project.build.testOutputDirectory</tt></li>
696 <p><b><a name="type">type</a>:</b></p>
698 <div>Type of execution.
702 <li><b>NONE</b> do nothing - just validate the
705 <li><b>CREATE</b> create database-schema</li>
707 <li><b>DROP</b> drop database-schema</li>
709 <li><b>BOTH</b> (<b>DEFAULT!</b>)</li>
711 If NONE is choosen, no databaseconnection is needed.</div>
715 <li><b>Type</b>: <tt>java.lang.String</tt></li>
717 <li><b>Since</b>: <tt>1.0</tt></li>
719 <li><b>Required</b>: <tt>No</tt></li>
721 <li><b>User Property</b>: <tt>hibernate.export.type</tt></li>
723 <li><b>Default</b>: <tt>BOTH</tt></li>
725 <p><b><a name="url">url</a>:</b></p>
727 <div>Database URL.</div>
731 <li><b>Type</b>: <tt>java.lang.String</tt></li>
733 <li><b>Since</b>: <tt>1.0</tt></li>
735 <li><b>Required</b>: <tt>No</tt></li>
737 <li><b>User Property</b>: <tt>hibernate.connection.url</tt></li>
739 <p><b><a name="username">username</a>:</b></p>
741 <div>Database username</div>
745 <li><b>Type</b>: <tt>java.lang.String</tt></li>
747 <li><b>Since</b>: <tt>1.0</tt></li>
749 <li><b>Required</b>: <tt>No</tt></li>
751 <li><b>User Property</b>: <tt>hibernate.connection.username</tt></li>
758 <div class="marginal">
761 <a id="navigation"></a>
762 <a class="hide" href="#top" title="Show Content">Jump back to the top of the page</a>
763 <h2 class="nav menu">Section-Menu</h2>
765 <li class="m blog"><a href="/blog/" class="m">Blog</a></li>
766 <li class="m projects"><a href="/projects.html" class="m selected">Projects</a></li>
767 <li class="m about"><a href="/about.html" class="m">About</a></li>
769 <h2 class="nav submenu">
770 <span class="s">Submenu for section</span>
771 <a class="s selected" href="/projects.html">Projects</a>
773 <ul id="submenu" class="s">
775 <a class="s selected" href="./index.html">Hibernate 4 Maven Plugin</a>
776 <ul class="s active">
778 <a href="configuration.html" class="s" title="Configuration Examples">Configuration Examples</a>
781 <strong class="s">Parameter Documentation</strong>
784 <a href="debugging.html" class="s" title="Enable Debug-Output">Enable Debug-Output</a>
787 <a href="skip.html" class="s" title="Skipping Execution">Skipping Execution</a>
790 <a href="force.html" class="s" title="Force Exceution">Force Exceution</a>
793 <a href="pitfalls.html" class="s" title="Known Pitfalls (FAQ)">Known Pitfalls (FAQ)</a>
796 <a href="project-info.html" class="s" title="Project Information">Project Information</a>
799 <a href="project-reports.html" class="s" title="Project Reports">Project Reports</a>
807 <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
808 <img class="poweredBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
815 <ul id="footerlinks">
816 <li class="f" id="copyright">© <strong>mo</strong> 2014
818 <li class="f"><a class="f" href="/impressum.html">Impressum</a></li>
819 <li class="f about"><a class="f" href="/about.html">About</a></li>
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);