]> juplo.de Git - hibernate4-maven-plugin/commitdiff
Transfomed HTML, that was missinterpred by the parser, into valid markdown
authorKai Moritz <kai@juplo.de>
Mon, 6 Apr 2026 17:02:02 +0000 (19:02 +0200)
committerKai Moritz <kai@juplo.de>
Wed, 29 Apr 2026 17:26:01 +0000 (19:26 +0200)
src/site/markdown/configuration.md
src/site/markdown/debugging.md
src/site/markdown/force.md
src/site/markdown/pitfalls.md
src/site/markdown/skip.md

index 41faa259c7a24ff28a47accbaf47cb6e850ffd86..76f039bf50cd3e51d4bbda3d69eddb61e5268d95 100644 (file)
   Doing so, the only additionally configuration needed, to activat the plugin
   is the following entry in the <code>plugins</code>-section of your <code>pom.xml</code>:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;plugin&gt;
-  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
-  &lt;artifactId&gt;hibernate4-maven-plugin&lt;/artifactId&gt;
-  &lt;version&gt;${project.version}&lt;/version&gt;
-  &lt;executions&gt;
-    &lt;execution&gt;
-      &lt;goals&gt;
-        &lt;goal&gt;export&lt;/goal&gt;
-      &lt;/goals&gt;
-    &lt;/execution&gt;
-  &lt;/executions&gt;
-&lt;/plugin&gt;
-</pre>
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate4-maven-plugin</artifactId>
+  <version>${project.version}</version>
+  <executions>
+    <execution>
+      <goals>
+        <goal>export</goal>
+      </goals>
+    </execution>
+  </executions>
+</plugin>
+```
+
   <p>
   But be aware, that in this case the database-url, that is
   build in the application is the same that is used while testing, where
   A better approach is, to specify a different url for testing like in the
   following snippet:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;plugin&gt;
-  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
-  &lt;artifactId&gt;hibernate4-maven-plugin&lt;/artifactId&gt;
-  &lt;version&gt;${project.version}&lt;/version&gt;
-  &lt;executions&gt;
-    &lt;execution&gt;
-      &lt;goals&gt;
-        &lt;goal&gt;export&lt;/goal&gt;
-      &lt;/goals&gt;
-    &lt;/execution&gt;
-  &lt;/executions&gt;
-  &lt;configuration&gt;
-    &lt;url&gt;&lt;![CDATA[jdbc:mysql://localhost/test-db]]&gt;&lt;/url&gt;
-  &lt;/configuration&gt;
-&lt;/plugin&gt;
-</pre>
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate4-maven-plugin</artifactId>
+  <version>${project.version}</version>
+  <executions>
+    <execution>
+      <goals>
+        <goal>export</goal>
+      </goals>
+    </execution>
+  </executions>
+  <configuration>
+    <url><![CDATA[jdbc:mysql://localhost/test-db]]></url>
+  </configuration>
+</plugin>
+```
+
   <p>
   Configuration properties, that are set in the <code>configuration</code>-section
   of the plugin-configuration cannnot be overwritten elsewere (for details
   the plugin-configuration, to be sure to have a separate database for
   testing):
   </p>
-  <pre class="prettyprint linenums lang-html">
 
-&lt;properties&gt;
-  &lt;hibernate.connection.driver_class&gt;org.hsqldb.jdbcDriver&lt;/hibernate.connection.driver_class&gt;
-  &lt;hibernate.dialect&gt;org.hibernate.dialect.HSQLDialect&lt;/hibernate.dialect&gt;
-  &lt;hibernate.connection.url&gt;&lt;![CDATA[jdbc:hsqldb:res:org.my.path.production_db]]&gt;&lt;/hibernate.connection.url&gt;
-  &lt;hibernate.connection.username&gt;sa&lt;/hibernate.connection.username&gt;
-  &lt;hibernate.connection.password&gt;&lt;/hibernate.connection.password&gt;
-&lt;/properties&gt;
+```
+<properties>
+  <hibernate.connection.driver_class>org.hsqldb.jdbcDriver</hibernate.connection.driver_class>
+  <hibernate.dialect>org.hibernate.dialect.HSQLDialect</hibernate.dialect>
+  <hibernate.connection.url><![CDATA[jdbc:hsqldb:res:org.my.path.production_db]]></hibernate.connection.url>
+  <hibernate.connection.username>sa</hibernate.connection.username>
+  <hibernate.connection.password></hibernate.connection.password>
+</properties>
 
 ...
 
-&lt;plugins&gt;
+<plugins>
 
   ...
 
-  &lt;plugin&gt;
-    &lt;groupId&gt;de.juplo&lt;/groupId&gt;
-    &lt;artifactId&gt;hibernate4-maven-plugin&lt;/artifactId&gt;
-    &lt;version&gt;${project.version}&lt;/version&gt;
-    &lt;executions&gt;
-      &lt;execution&gt;
-        &lt;goals&gt;
-          &lt;goal&gt;export&lt;/goal&gt;
-        &lt;/goals&gt;
-      &lt;/execution&gt;
-    &lt;/executions&gt;
-    &lt;configuration&gt;
-      &lt;url&gt;&lt;![CDATA[jdbc:hsqldb:target/db/testdb;shutdown=true]]&gt;&lt;/url&gt;
-    &lt;/configuration&gt;
-  &lt;/plugin&gt;
-
-&lt;plugins&gt;
-  </pre>
+  <plugin>
+    <groupId>de.juplo</groupId>
+    <artifactId>hibernate4-maven-plugin</artifactId>
+    <version>${project.version}</version>
+    <executions>
+      <execution>
+        <goals>
+          <goal>export</goal>
+        </goals>
+      </execution>
+    </executions>
+    <configuration>
+      <url><![CDATA[jdbc:hsqldb:target/db/testdb;shutdown=true]]></url>
+    </configuration>
+  </plugin>
+
+<plugins>
+```
+
   <p>
   This way, you can reuse the same properties to provide a
   default-configurationthe, that is build into your application, and
   The equivalent of the configuration from the last section would look
   like this:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;plugin&gt;
-  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
-  &lt;artifactId&gt;hibernate4-maven-plugin&lt;/artifactId&gt;
-  &lt;version&gt;${project.version}&lt;/version&gt;
-  &lt;executions&gt;
-    &lt;execution&gt;
-      &lt;goals&gt;
-        &lt;goal&gt;export&lt;/goal&gt;
-      &lt;/goals&gt;
-    &lt;/execution&gt;
-  &lt;/executions&gt;
-  &lt;configuration&gt;
-    &lt;driverClassName&gt;org.hsqldb.jdbcDriver&lt;/driverClassName&gt;
-    &lt;hibernateDialect&gt;org.hibernate.dialect.HSQLDialect&lt;/hibernateDialect&gt;
-    &lt;url&gt;&lt;![CDATA[jdbc:hsqldb:target/db/fotos;shutdown=true]]&gt;&lt;/url&gt;
-    &lt;username&gt;sa&lt;/username&gt;
-    &lt;password&gt;&lt;/password&gt;
-  &lt;/configuration&gt;
-&lt;/plugin&gt;
-</pre>
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate4-maven-plugin</artifactId>
+  <version>${project.version}</version>
+  <executions>
+    <execution>
+      <goals>
+        <goal>export</goal>
+      </goals>
+    </execution>
+  </executions>
+  <configuration>
+    <driverClassName>org.hsqldb.jdbcDriver</driverClassName>
+    <hibernateDialect>org.hibernate.dialect.HSQLDialect</hibernateDialect>
+    <url><![CDATA[jdbc:hsqldb:target/db/fotos;shutdown=true]]></url>
+    <username>sa</username>
+    <password></password>
+  </configuration>
+</plugin>
+```
+
   <p>
   The parameter <strong>hibernateProperties</strong> (name of the hibernate-properties-file
   to use, defaults to <strong>hibernate.properties</strong>) can only be configured through
   If you need to overwrite plugin-configuration-values with
   maven-properties, you can use maven-properties in the plugin-configuration:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;plugin&gt;
-  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
-  &lt;artifactId&gt;hibernate4-maven-plugin&lt;/artifactId&gt;
-  &lt;version&gt;${project.version}&lt;/version&gt;
-  &lt;executions&gt;
-    &lt;execution&gt;
-      &lt;goals&gt;
-        &lt;goal&gt;export&lt;/goal&gt;
-      &lt;/goals&gt;
-    &lt;/execution&gt;
-  &lt;/executions&gt;
-  &lt;configuration&gt;
-    &lt;password&gt;${my-password-property}&lt;/password&gt;
-  &lt;/configuration&gt;
-&lt;/plugin&gt;
-</pre>
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate4-maven-plugin</artifactId>
+  <version>${project.version}</version>
+  <executions>
+    <execution>
+      <goals>
+        <goal>export</goal>
+      </goals>
+    </execution>
+  </executions>
+  <configuration>
+    <password>${my-password-property}</password>
+  </configuration>
+</plugin>
+```
index b2321e135bbc37298dd3db757604ba029605e448..5e709760d0feb1ae55723623ba25c16f1abed14b 100644 (file)
@@ -8,8 +8,11 @@
   enabled.
   For example, by executing:
   </p>
-  <pre class="prettyprint linenums lang-html">
-mvn -X compile hibernate4:export</pre>
+
+```
+mvn -X compile hibernate4:create
+```
+
   <p>
   (The <code>compile</code> might be necessary, because <code>hibernate4-maven-plugin</code>
   has to scan the compiled classes for annotations!)
index b6064132c941ddf388a998c445264af9358f3e3d..dd169bafc4720e85440cc02b88a8fb5878bb7d47 100644 (file)
   you can force it to do so, if you set the parameter <code>force</code> to
   <code>true</code>:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;plugin&gt;
-  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
-  &lt;artifactId&gt;hibernate4-maven-plugin&lt;/artifactId&gt;
-  &lt;version&gt;${project.version}&lt;/version&gt;
-  &lt;configuration&gt;
-    &lt;force&gt;true&lt;/force&gt;
-  &lt;/configuration&gt;
-&lt;/plugin&gt;</pre>
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate4-maven-plugin</artifactId>
+  <version>${project.version}</version>
+  <configuration>
+    <force>true</force>
+  </configuration>
+</plugin>
+```
+
   <p>
   Or you may specify <code>-Dhibernate.export.force=true</code> at the command line,
   if you want to force hibernate4-maven-plugin only once.
index 9cfba8a1358694247e9120efb029e0e30dc02590..4552589622074a8723b6e2abc7d50915a783d31e 100644 (file)
   This can be achieved with the command-line parameter
   <code>-Dhibernate.export.target=SCRIPT</code> or with the following configuration:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;configuration&gt;
-  &lt;target&gt;SCRIPT&lt;/target&gt;
-&lt;/configuration&gt;</pre>
+
+```
+<configuration>
+  <target>SCRIPT</target>
+</configuration>
+```
+
   <p>
   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!
@@ -41,7 +44,8 @@
   Since it will not be able to see the needed dependency, it will fail with
   an error-message like:
   </p>
-  <pre class="prettyprint">
+
+```
 [INFO] Gathered hibernate-configuration (turn on debugging for details):
 [INFO]   hibernate.connection.username = sa
 [INFO]   hibernate.connection.password = 
@@ -59,7 +63,9 @@
 [INFO] Total time: 2 seconds
 [INFO] Finished at: Thu Nov 29 11:31:14 CET 2012
 [INFO] Final Memory: 32M/342M
-[INFO] ------------------------------------------------------------------------</pre>
+[INFO] ------------------------------------------------------------------------
+```
+
   <p>
   A quick workaround for this error would be, to delete the runtime-constraint
   for the jdbc-driver-dependency.
   A much cleaner way is, to (additionally) ad the dependency, to the
   plugin-definition:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;plugin&gt;
-  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
-  &lt;artifactId&gt;hibernate4-maven-plugin&lt;/artifactId&gt;
-  &lt;version&gt;${project.version}&lt;/version&gt;
-  &lt;executions&gt;
-    &lt;execution&gt;
-      &lt;goals&gt;
-        &lt;goal&gt;export&lt;/goal&gt;
-      &lt;/goals&gt;
-    &lt;/execution&gt;
-  &lt;/executions&gt;
-  &lt;dependencies&gt;
-  &lt;dependency&gt;
-    &lt;groupId&gt;org.hsqldb&lt;/groupId&gt;
-    &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
-    &lt;version&gt;2.2.8&lt;/version&gt;
-  &lt;/dependency&gt;
-  &lt;/dependencies&gt;
-&lt;/plugin&gt;</pre>
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate4-maven-plugin</artifactId>
+  <version>${project.version}</version>
+  <executions>
+    <execution>
+      <goals>
+        <goal>export</goal>
+      </goals>
+    </execution>
+  </executions>
+  <dependencies>
+  <dependency>
+    <groupId>org.hsqldb</groupId>
+    <artifactId>hsqldb</artifactId>
+    <version>2.2.8</version>
+  </dependency>
+  </dependencies>
+</plugin>
+```
+
   <p>
   This is also the best way, if you use a different jdbc-driver for
   testing, than in production.
   For example, the dbunit-plugin can be configured to skip its excecution, if
   hibernate4-maven-plugin was skipped like this:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;plugin&gt;
-  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
-  &lt;artifactId&gt;dbunit-maven-plugin&lt;/artifactId&gt;
-  &lt;configuration&gt;
-    &lt;skip&gt;${hibernate.export.skipped}&lt;/skip&gt;
-  &lt;/configuration&gt;
-&lt;/plugin&gt;</pre>
+
+```
+<plugin>
+  <groupId>org.codehaus.mojo</groupId>
+  <artifactId>dbunit-maven-plugin</artifactId>
+  <configuration>
+    <skip>${hibernate.export.skipped}</skip>
+  </configuration>
+</plugin>
+```
 
 ## The database will not be recreated after a manual drop/clean
 
   unnecessary drop-create-cycle might take a long time. The plugin will
   report that like this:
   </p>
-  <pre class="prettyprint">
+
+```
 [INFO] No modified annotated classes found and dialect unchanged.
-[INFO] Skipping schema generation!</pre>
+[INFO] Skipping schema generation!
+```
+
   <p>
   If one always uses <code>mvn clean</code> for cleanup, this will not happen.
   Otherwise the recreation must be <a href="./force.html">forced</a>:
   </p>
-  <pre class="prettyprint">
-mvn hibernate4:create -Dhibernate.schema.force=true</pre>
+
+```
+mvn hibernate4:create -Dhibernate.schema.force=true
+```
 
 ## The hibernate:create goal is not executed, when tests are skipped
 
@@ -157,15 +173,18 @@ mvn hibernate4:create -Dhibernate.schema.force=true</pre>
   <code>maven.test.skip</code> is set to <code>true</code>. If you need it to be always
   executed, you can configure that explicitly like this:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;plugin&gt;
-  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
-  &lt;artifactId&gt;hibernate4-maven-plugin&lt;/artifactId&gt;
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate4-maven-plugin</artifactId>
   ...
-  &lt;configuration&gt;
-    &lt;skip&gt;false&lt;/skip&gt;
-  &lt;/configuration&gt;
-&lt;/plugin&gt;</pre>
+  <configuration>
+    <skip>false</skip>
+  </configuration>
+</plugin>
+```
+
   <p>
   Background-information for this design-decission can be found on the extra
   page <a href="./skip.html">To skip or not to skip: that is the question</a>...
@@ -179,15 +198,17 @@ mvn hibernate4:create -Dhibernate.schema.force=true</pre>
     or set <code>scanDependencies</code> to <code>none</code> in the configuration
     of the plugin like this:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;plugin&gt;
-  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
-  &lt;artifactId&gt;hibernate4-maven-plugin&lt;/artifactId&gt;
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate4-maven-plugin</artifactId>
   ...
-  &lt;configuration&gt;
-    &lt;scanDependencies&gt;none&lt;/scanDependencies&gt;
-  &lt;/configuration&gt;
-&lt;/plugin&gt;</pre>
+  <configuration>
+    <scanDependencies>none</scanDependencies>
+  </configuration>
+</plugin>
+```
 
 ## No annotated classes found
 
index 989449c482221496aeb97af3ef33dbad5f508970..e7e98fbd2850f87789c1d49391455d90138d37a9 100644 (file)
   export-goal, even if the tests are skipped you can configure that explicitly,
   by setting the configuration-parameter <code>skip</code> to false:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;plugin&gt;
-  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
-  &lt;artifactId&gt;hibernate4-maven-plugin&lt;/artifactId&gt;
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate4-maven-plugin</artifactId>
   ...
-  &lt;configuration&gt;
-    &lt;skip&gt;false&lt;/skip&gt;
-  &lt;/configuration&gt;
-&lt;/plugin&gt;</pre>
+  <configuration>
+    <skip>false</skip>
+  </configuration>
+</plugin>
+```
+
   <p>
   Or, if you want the export-goal to be executed by default and to be skipped
   if you say so, you can bind the value of the configuration-parameter
   <code>skip</code> to a custom property. For example:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;plugin&gt;
-  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
-  &lt;artifactId&gt;hibernate4-maven-plugin&lt;/artifactId&gt;
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate4-maven-plugin</artifactId>
   ...
-  &lt;configuration&gt;
-    &lt;skip&gt;${foo.bar}&lt;/skip&gt;
-  &lt;/configuration&gt;
-&lt;/plugin&gt;</pre>
+  <configuration>
+    <skip>${foo.bar}</skip>
+  </configuration>
+</plugin>
+```
+
   <p>
   This way, the export-goal would be skipped, if you set the property
   <code>foo.bar</code> to <code>true</code>. For example, if you specify <code>-Dfoo.bar=true</code>