WIP: site?
authorKai Moritz <kai@juplo.de>
Fri, 5 May 2017 08:37:41 +0000 (10:37 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 5 May 2017 08:37:41 +0000 (10:37 +0200)
src/site/site.xml [new file with mode: 0644]
src/site/xhtml/getting-started.xhtml [new file with mode: 0644]
src/site/xhtml/index.xhtml [new file with mode: 0644]
src/site/xhtml/issue-tracking.xhtml [new file with mode: 0644]
src/site/xhtml/mail-lists.xhtml [new file with mode: 0644]

diff --git a/src/site/site.xml b/src/site/site.xml
new file mode 100644 (file)
index 0000000..e06ff91
--- /dev/null
@@ -0,0 +1,15 @@
+<project>
+  <googleAnalyticsAccountId>UA-571104-3</googleAnalyticsAccountId>
+  <body>
+    <menu>
+      <item name="Getting Started" href="getting-started.html"/>
+    </menu>
+    <menu ref="reports"/>
+  </body>
+  <skin>
+    <groupId>de.juplo</groupId>
+    <artifactId>juplo-maven-skin</artifactId>
+    <version>1.0.8</version>
+  </skin>
+</project>
+
diff --git a/src/site/xhtml/getting-started.xhtml b/src/site/xhtml/getting-started.xhtml
new file mode 100644 (file)
index 0000000..e8c5afd
--- /dev/null
@@ -0,0 +1,216 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ </head>
+ <body>
+  <h2>Configuration through a hibernate.properties-File</h2>
+  <p>
+  The most simple way to configure the plugin is, to put all the
+  hibernate-configuration in a <strong>hibernate.properties</strong>-file on your
+  classpath. Put the file in the <code>resources</code>-folder. Maven will put
+  it in the <code>class</code>-folder of your webapp, where it will be picked up
+  by this plugin as well as by Hibernate 4.
+  </p>
+  <p>
+  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;export&lt;/goal&gt;
+      &lt;/goals&gt;
+    &lt;/execution&gt;
+  &lt;/executions&gt;
+&lt;/plugin&gt;</pre>
+  <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
+  the database is droped and recreated by the plugin.
+  Because of that,
+  <strong>
+    you should never fire up this configuration on your production
+    system, or your database might be erased!
+  </strong>
+  </p>
+  <p>
+  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;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>
+  <p>
+  Configuration properties, that are set in the <code>configuration</code>-section
+  of the plugin-configuration cannnot be overwritten elsewere (for details
+  see <a href="#precedence">Configuration-Method-Precedence</a>).
+  You never can overwrite them by accident when specifying a property on
+  the commandline or in your <code>settings.xml</code>.
+  </p>
+  <h2>Configuration through maven-properties</h2>
+  <p>
+  Alternatively, it is possible, to configure the plugin via maven-properties.
+  Each relevant configuration-option has a corresponding maven-property
+  (for a full list see the <a href="./export-mojo.html">Documentation of the export-Mojo</a>).
+  These are named after the
+  <a href="http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html_single/#configuration-hibernatejdbc">Hibernate JDBC Properties</a>:
+  </p>
+  <ul>
+    <li><code>hibernate.connection.driver_class</code></li>
+    <li><code>hibernate.dialect</code></li>
+    <li><code>hibernate.connection.url</code></li>
+    <li><code>hibernate.connection.username</code></li>
+    <li><code>hibernate.connection.password</code></li>
+  </ul>
+  <p>
+  So, instead of writing the hibernate-configuration in the properties-file,
+  like above, you could put it in the <code>properties</code>-section of your
+  <code>pom.xml</code>.
+  </p>
+  <p>
+  Thogether with the plugin-definition from above, the following would
+  be a complete configuration (again, the database-url was overwritten in
+  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;
+
+...
+
+&lt;plugins&gt;
+
+  ...
+
+  &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;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>
+  <h2>Configuration through the plugin-configuration</h2>
+  <p>
+  A third way for configuring the plugin is the plugin-configuration.
+  The relevant configuration-parameters are:
+  </p>
+  <ul>
+    <li><code>driver</code></li>
+    <li><code>dialect</code></li>
+    <li><code>url</code></li>
+    <li><code>username</code></li>
+    <li><code>password</code></li>
+  </ul>
+  <p>
+  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;export&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>
+  <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
+  this approach.
+  </p>
+  <p>
+  For more explanations, see the
+  <a href="./export-mojo.html">Documentation of the export-Mojo</a>.
+  </p>
+  <h2 id="precedence">Configuration-Method-Precedence</h2>
+  <p>
+  The configuration is gathered in a fix order:
+  </p>
+  <ol>
+    <li><code>hibernate.properties</code></li>
+    <li><code>hibernate.cfg.xml</code></li>
+    <li><code>persistence.xml</code></li>
+    <li>maven-properties</li>
+    <li>plugin-configuration</li>
+  </ol>
+  <p>
+  If you are in doubt about where a configuration-value comes from, run
+  maven with the <a href="./debugging.html">debug-output</a> enabled: <code>mvn -X hibernate:export</code>
+  and be aware, that maven-properties can be overwitten on the command-line,
+  in your <code>~/.m2/settings.xml</code> and in a profile.
+  </p>
+  <p>
+  The plugin-configuration comes last and overwrites everything else.
+  That way, you can be sure, that a configuration-value, that is
+  specified in the plugin-configuration will never be overwritten by any
+  other configuration-method.
+  </p>
+  <p>
+  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;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>
+ </body>
+</html>
diff --git a/src/site/xhtml/index.xhtml b/src/site/xhtml/index.xhtml
new file mode 100644 (file)
index 0000000..a30e6d6
--- /dev/null
@@ -0,0 +1,70 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ </head>
+ <body>
+  <h1>Hibernate 4 Maven Plugin</h1>
+  <h2>A simple Plugin for generating a Database-Schema from Hibernate 4 Mapping-Annotations</h2>
+  <p>
+  The <strong>hibernate-maven-plugin</strong> is a plugin for generating a database-schema
+  from your Hibernate-4-Mappings and create or update your database
+  accordingly.
+  Its main usage is to automatically create and populate a test-database
+  for unit-tests in cooperation with the
+  <a href="http://mojo.codehaus.org/dbunit-maven-plugin">dbunit-maven-plugin</a>.
+  </p>
+  <p>
+  The plugin was designed with three main goals in mind:
+  </p>
+  <ul>
+    <li>It should be easy to use.</li>
+    <li>It should be maximal unlikely, to erase a producation-database by accident.</li>
+    <li>It should not slow down the development cycle.</li>
+  </ul>
+  <p>
+  To achieve the first goal, the convention-over-configuration paradigma
+  was applied and the plugin was stuffed with usefull logging-messages.
+  So, if in doubt, just turn on the <a href="./debugging.html">debugging output</a> with the <code>mvn -X ...</code>. 
+  </p>
+  <p>
+  To achieve the second goal, the precedence in which the configuration
+  locations are consulted was layouted in a way that makes it possible, to
+  prevent overwrites of the wrong database by accident.
+  </p>
+  <p>
+  Last but not least, in order to not slow down the development cycle, the
+  hibernate-maven-plugin only executes the schema-export, if the mapping
+  or the dialect changes (or if you force it to do so).
+  </p>
+  <p>
+  For more information about the inspiration to write this tiny plugin,
+  <a href="/hibernate-maven-plugin-a-simple-plugin-for-generating-a-database-schema-from-hibernate-4-mapping-annotations/">read our blog-article about the hibernate-maven-plugin</a>.
+  </p>
+  <h2>Documentation</h2>
+  <ul>
+   <li>
+   See <a href="./configuration.html">Configuration Examples</a> for Usage-Explanations
+   and simple examples of how to use this plugin.
+   </li>
+   <li>
+   See <a href="./export-mojo.html">hibernate:export</a> and
+   <a href="./plugin-info.html">Plugin Documentation</a> for the full
+   autogenerated documentation. These are mostly configuration-options
+   of the Hibernate-Tools <code>SchemaExport</code> and <code>SchemaUpdate</code>, that do
+   the work in the background.
+   </li>
+  </ul>
+  <h2>Releases</h2>
+  <ul>
+    <li><a href="http://juplo.de/hibernate-maven-plugin">current version</a></li>
+    <li>${project.version} (this version)</li>
+    <li><a href="http://juplo.de/hibernate4-maven-plugin-1.0.5">1.0.5</a></li>
+    <li><a href="http://juplo.de/hibernate4-maven-plugin-1.0.4">1.0.4</a></li>
+    <li><a href="http://juplo.de/hibernate4-maven-plugin-1.0.3">1.0.3</a></li>
+    <li><a href="http://juplo.de/hibernate4-maven-plugin-1.0.2">1.0.2</a></li>
+    <li><a href="http://juplo.de/hibernate4-maven-plugin-1.0.1">1.0.1</a></li>
+    <li><a href="http://juplo.de/hibernate4-maven-plugin-1.0">1.0</a></li>
+  </ul>
+ </body>
+</html>
diff --git a/src/site/xhtml/issue-tracking.xhtml b/src/site/xhtml/issue-tracking.xhtml
new file mode 100644 (file)
index 0000000..f7e6859
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ </head>
+ <body>
+  <strong>There is no bug-tracking system set up for this project!</strong>
+  <p>
+  Please send your bug-reports, questions or feature-requests directly
+  to the developer.
+  </p>
+ </body>
+</html>
diff --git a/src/site/xhtml/mail-lists.xhtml b/src/site/xhtml/mail-lists.xhtml
new file mode 100644 (file)
index 0000000..ff8d7f2
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ </head>
+ <body>
+  <strong>There are no mailinglists defined for this project!</strong>
+  <p>
+  Please send your bug-reports, questions or feature-requests directly
+  to the developer.
+  </p>
+ </body>
+</html>