]> juplo.de Git - hibernate4-maven-plugin/commitdiff
WIP:Transfomed HTML, that was missinterpred by the parser, into valid markdown 2.1.1
authorKai Moritz <kai@juplo.de>
Wed, 29 Apr 2026 13:37:05 +0000 (15:37 +0200)
committerKai Moritz <kai@juplo.de>
Wed, 29 Apr 2026 13:44:08 +0000 (15:44 +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 ffb5fae88c2056b555e3df8492c410922998338c..ae9a0bd696556563932f319dcfdb06f40084b369 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;hibernate-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;create&lt;/goal&gt;
-      &lt;/goals&gt;
-    &lt;/execution&gt;
-  &lt;/executions&gt;
-&lt;/plugin&gt;
-</pre>
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate-maven-plugin</artifactId>
+  <version>${project.version}</version>
+  <executions>
+    <execution>
+      <goals>
+        <goal>create</goal>
+      </goals>
+    </execution>
+  </executions>
+</plugin>
+```
+
   <p>
   This would create the configured database.
   If you want it to be droped beforehand, you have to add the goal
   <code>drop</code>:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;plugin&gt;
-  &lt;groupId&gt;de.juplo&lt;/groupId&gt;
-  &lt;artifactId&gt;hibernate-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;drop&lt;/goal&gt;
-        &lt;goal&gt;create&lt;/goal&gt;
-      &lt;/goals&gt;
-    &lt;/execution&gt;
-  &lt;/executions&gt;
-&lt;/plugin&gt;
-</pre>
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate-maven-plugin</artifactId>
+  <version>${project.version}</version>
+  <executions>
+    <execution>
+      <goals>
+        <goal>drop</goal>
+        <goal>create</goal>
+      </goals>
+    </execution>
+  </executions>
+</plugin>
+```
+
   <p>
   A correspondin goal for the command <code>update</code> is missing in this
   version, but we are planning to implement it in near feature.
   to use.
   A simple example <code>hibernate.properties</code>-file may look like this:
   </p>
-  <pre class="prettyprint linenums lang-properties">
+
+```
 hibernate.dialect=org.hibernate.dialect.H2Dialect
 hibernate.connection.url=jdbc:h2:file:./target/db
 hibernate.connection.driver_class=org.h2.Driver
 hibernate.connection.username=sa
 hibernate.connection.password=
-</pre>
+```
+
   <p>
   But be aware, that using this configuration-approach the database-url,
   that is build in the application is the same that is used while testing,
@@ -79,24 +85,26 @@ hibernate.connection.password=
   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;hibernate-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;drop&lt;/goal&gt;
-        &lt;goal&gt;create&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>hibernate-maven-plugin</artifactId>
+  <version>${project.version}</version>
+  <executions>
+    <execution>
+      <goals>
+        <goal>drop</goal>
+        <goal>create</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
@@ -190,28 +198,30 @@ hibernate.connection.password=
   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;hibernate-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;drop&lt;/goal&gt;
-        &lt;goal&gt;create&lt;/goal&gt;
-      &lt;/goals&gt;
-    &lt;/execution&gt;
-  &lt;/executions&gt;
-  &lt;configuration&gt;
-    &lt;driver&gt;org.hsqldb.jdbcDriver&lt;/driver&gt;
-    &lt;dialect&gt;org.hibernate.dialect.HSQLDialect&lt;/dialect&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>hibernate-maven-plugin</artifactId>
+  <version>${project.version}</version>
+  <executions>
+    <execution>
+      <goals>
+        <goal>drop</goal>
+        <goal>create</goal>
+      </goals>
+    </execution>
+  </executions>
+  <configuration>
+    <driver>org.hsqldb.jdbcDriver</driver>
+    <dialect>org.hibernate.dialect.HSQLDialect</dialect>
+    <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
@@ -250,21 +260,22 @@ hibernate.connection.password=
   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;hibernate-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;drop&lt;/goal&gt;
-        &lt;goal&gt;create&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>hibernate-maven-plugin</artifactId>
+  <version>${project.version}</version>
+  <executions>
+    <execution>
+      <goals>
+        <goal>drop</goal>
+        <goal>create</goal>
+      </goals>
+    </execution>
+  </executions>
+  <configuration>
+    <password>${my-password-property}</password>
+  </configuration>
+</plugin>
+```
index f61897c7454c92d962a42c10efa65f4e078e2139..aab6e8817c5a5144b4a30d3646030c6d12ec70a6 100644 (file)
@@ -8,8 +8,11 @@
   enabled.
   For example, by executing:
   </p>
-  <pre class="prettyprint linenums lang-html">
-mvn -X compile hibernate:create</pre>
+
+```
+mvn -X compile hibernate:create
+```
+
   <p>
   (The <code>compile</code> might be necessary, because <code>hibernate-maven-plugin</code>
   has to scan the compiled classes for annotations!)
index 8e036a7256e60268ae152925ea7ad777abe58b75..9ce1ae10ee025460bb56d77c6775219cc1e42442 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;hibernate-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>hibernate-maven-plugin</artifactId>
+  <version>${project.version}</version>
+  <configuration>
+    <force>true</force>
+  </configuration>
+</plugin>
+```
+
   <p>
   Or you may specify <code>-Dhibernate.schema.force=true</code> at the command line,
   if you want to force hibernate-maven-plugin only once.
index 558c1520ffc323426f6dc37baeda929f64696acf..3b0ffe88751b7db02326f1f5077b0b616c2660d2 100644 (file)
   <code>-Dhibernate.schema.execute=false</code> or with the following
   configuration:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;configuration&gt;
-  &lt;execute&gt;false&lt;/execute&gt;
-&lt;/configuration&gt;</pre>
+
+```
+<configuration>
+  <execute>false</execute>
+</configuration>
+```
+
   <p>
   But even when no database is to be created, hibernate always needs to know
   the dialect. Hence, the plugin will still fail, if this parameter is also
@@ -46,7 +49,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 = 
 [INFO] Finished at: Mon Mar 07 19:06:54 CET 2016
 [INFO] Final Memory: 11M/215M
 [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 -&gt; [Help 1]
+[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</pre>
+[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
+```
+
   <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;hibernate-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;drop&lt;/goal&gt;
-        &lt;goal&gt;create&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>hibernate-maven-plugin</artifactId>
+  <version>${project.version}</version>
+  <executions>
+    <execution>
+      <goals>
+        <goal>drop</goal>
+        <goal>create</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
   hibernate-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.schema.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.schema.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 hibernate:create -Dhibernate.schema.force=true</pre>
+```
+mvn hibernate:create -Dhibernate.schema.force=true
+```
 
 ## The hibernate:create goal is not executed, when tests are skipped
 
@@ -174,15 +189,18 @@ mvn hibernate: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;hibernate-maven-plugin&lt;/artifactId&gt;
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate-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>...
@@ -196,15 +214,17 @@ mvn hibernate: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;hibernate-maven-plugin&lt;/artifactId&gt;
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate-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
 
@@ -236,27 +256,28 @@ mvn hibernate:create -Dhibernate.schema.force=true</pre>
   <p>
     Example configuration for two goals:
   </p>
-  <pre class="prettyprint linenums lang-html">
-&lt;executions&gt;
-  &lt;execution&gt;
-    &lt;id&gt;Create Drop-Schema&lt;/id&gt;
-    &lt;phase&gt;test-compile&lt;/phase&gt;
-    &lt;goals&gt;
-      &lt;goal&gt;drop&lt;/goal&gt;
-    &lt;/goals&gt;
-    &lt;configuration&gt;
-      &lt;outputFile&gt;db-schema/drop-schema.ddl&lt;/outputFile&gt;
-    &lt;/configuration&gt;
-  &lt;/execution&gt;
-  &lt;execution&gt;
-    &lt;id&gt;Create Create-Schema&lt;/id&gt;
-    &lt;phase&gt;test-compile&lt;/phase&gt;
-    &lt;goals&gt;
-      &lt;goal&gt;create&lt;/goal&gt;
-    &lt;/goals&gt;
-    &lt;configuration&gt;
-      &lt;outputFile&gt;db-schema/create-schema.ddl&lt;/outputFile&gt;
-    &lt;/configuration&gt;
-  &lt;/execution&gt;
-&lt;/executions&gt;
-</pre>
+
+```
+<executions>
+  <execution>
+    <id>Create Drop-Schema</id>
+    <phase>test-compile</phase>
+    <goals>
+      <goal>drop</goal>
+    </goals>
+    <configuration>
+      <outputFile>db-schema/drop-schema.ddl</outputFile>
+    </configuration>
+  </execution>
+  <execution>
+    <id>Create Create-Schema</id>
+    <phase>test-compile</phase>
+    <goals>
+      <goal>create</goal>
+    </goals>
+    <configuration>
+      <outputFile>db-schema/create-schema.ddl</outputFile>
+    </configuration>
+  </execution>
+</executions>
+```
index 109a510faba54ff1b9a1149c223afd175ef62e2e..3753250dd9007837e4c5146c1fdff970dba1879b 100644 (file)
   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;hibernate-maven-plugin&lt;/artifactId&gt;
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate-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 plugin 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;hibernate-maven-plugin&lt;/artifactId&gt;
+
+```
+<plugin>
+  <groupId>de.juplo</groupId>
+  <artifactId>hibernate-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 plugin 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>