hibernate4-maven-plugin 1.0.2 released!

Today we released the version 1.0.2 of hibernate4-maven-plugin to Central.

This release includes:

  • Improved documentation (thanks to Adriano Machado)
  • Support for the hibernateNamingStrategy-configuration-option (thanks to Lorenzo Nicora)
  • Mapping via *.hbm.xml-files (old approach without annotations)

hibernate4-maven-plugin 1.0.2 is available in the Central Maven Repository.

Release notes:


commit 4edef457d2b747d939a141de24bec5e32abbc0c7
Author: Kai Moritz
Date: Fri Aug 2 00:37:40 2013 +0200

Last preparations for release

commit 82eada1297cdc295dcec9f43660763a04c1b1deb
Author: Kai Moritz
Date: Fri Aug 2 00:37:22 2013 +0200

Upgrade to Hibernate 4.2.3.Final

commit 3d355800b5a5d2a536270b714f37a84d50b12168
Author: Kai Moritz
Date: Thu Aug 1 12:41:06 2013 +0200

Mapping-configurations are opend as given before searched in resources

commit 1ba817af3ae5ab23232fca001061f8050cecd6a7
Author: Kai Moritz
Date: Thu Aug 1 01:45:22 2013 +0200

Improved documentaion (new FAQ-entries)

commit 02312592d27d628cc7e0d8e28cc40bf74a80de21
Author: Kai Moritz
Date: Wed Jul 31 23:07:26 2013 +0200

Added support for mapping-configuration through mapping-files (*.hbm.xml)

commit b6ac188a40136102edc51b6824875dfb07c89955
Author: nicus
Date: Fri Apr 19 15:27:21 2013 +0200

Fixed problem with NamingStrategy (contribution from Lorenzo Nicora)

* NamingStrategy is set explicitly on Hibernate Configuration (not
passed by properties)
* Added 'hibernateNamingStrategy' configuration property

commit c2135b5dedc55fc9e3f4dd9fe53f8c7b4141204c
Author: Kai Moritz
Date: Mon Feb 25 22:35:33 2013 +0100

Integration of the maven-plugin-plugin for automated helpmojo-generation

Thanks to Adriano Machado, who contributed this patch!

hibernate4-maven-plugin 1.0.1 released!

Today we released the bugfix-version 1.0.1 of hibernate4-maven-plugin to Central.

Appart from two bugfixes, this version includes some minor improvements, which might come in handy for you.

hibernate4-maven-plugin 1.0.1 should be available in the Central Maven Repository in a few hours.

Release notes:


commit 4b507b15b0122ac180e44b8418db8d9143ae9c3a
Author: Kai Moritz
Date: Tue Jan 15 23:09:01 2013 +0100

Reworked documentation: splited and reorderd pages and menu

commit 65bbbdbaa7df1edcc92a3869122ff06a3895fe57
Author: Kai Moritz
Date: Tue Jan 15 22:39:39 2013 +0100

Added breadcrumb to site

commit a8c4f4178a570da392c94e384511f9e671b0d040
Author: Kai Moritz
Date: Tue Jan 15 22:33:48 2013 +0100

Added Google-Analytics tracking-code to site

commit 1feb1053532279981a464cef954072cfefbe01a5
Author: Kai Moritz
Date: Tue Jan 15 22:21:54 2013 +0100

Added release information to site

commit bf5e8c39287713b9eb236ca441473f723059357a
Author: Kai Moritz
Date: Tue Dec 18 00:14:08 2012 +0100

Reworked documentation: added documentation for new features etc.

commit 36af74be42d47438284677134037ce399ea0b58e
Author: Kai Moritz
Date: Tue Jan 15 10:40:09 2013 +0100

Test-Classes can now be included into the scanning for Hibernate-Annotations

commit bcf07578452d7c31dc97410bc495c73bd0f87748
Author: Kai Moritz
Date: Tue Jan 15 09:09:05 2013 +0100

Bugfix: database-parameters for connection were not taken from properties

The hibernate-propertiesfile was read and used for the configuration of
the SchemaExport-class, but the database-parameters from these source were
ignored, when the database-connection was opened.

commit 54b22b88de40795a73397ac8b3725716bc80b6c4
Author: Kai Moritz
Date: Wed Jan 9 20:57:22 2013 +0100

Bugfix: connection was closed, even when it was never created

Bugreport from: Adriano Machado

When only the script is generated and no export is executed, no database-
connection is opend. Nevertheless, the code tried to close it in the
finally-block, which lead to a NPE.

commit b9ab24b21d3eb65e2a2208be658ff447c1846894
Author: Kai Moritz
Date: Tue Dec 18 00:31:22 2012 +0100

Implemented new parameter "force"

If -Dhibernate.export.force is specified, the schema-export will be forced.

commit 19740023bb37770ad8e08c8e50687cb507e2fbfd
Author: Kai Moritz
Date: Fri Dec 14 02:16:44 2012 +0100

Plugin ignores upper- or lower-case mismatches for "type" and "target"

commit 8a2e08b6409034fd692c4bea72058f785e6802ad
Author: Kai Moritz
Date: Fri Dec 14 02:13:05 2012 +0100

The Targets EXPORT and NONE force excecution

Otherwise, an explicitly requestes SQL-export or mapping-test-run would be
skipped, if no annotated class was modified.

If the export is skipped, this is signaled via the maven-property
hibernate.export.skipped.

Refactored name of the skip-property to an public final static String

commit 55a33e35422b904b974a19d3d6368ded60ea1811
Author: Kai Moritz
Date: Fri Dec 14 01:43:45 2012 +0100

Configuration via properties reworked

* export-type and -target are now also configurable via properties
* schema-filename, -delemiter and -format are now also configurable via
porperties

commit 5002604d2f9024dd7119190915b6c62c75fbe1d6
Author: Kai Moritz
Date: Thu Dec 13 16:19:55 2012 +0100

schema is now rebuild, when SQL-dialect changes

commit a2859d3177a64880ca429d4dfd9437a7fb78dede
Author: Kai Moritz
Date: Tue Dec 11 17:30:19 2012 +0100

Skipping of unchanged scenarios is now based on MD5-sums of all classes

When working with Netbeans, the schema was often rebuild without need.
The cause of this behaviour was, that Netbeans (or Maven itself) sometimes
touches unchanged classes. To avoid this, hibernat4-maven-plugin now
calculates MD5-sums for all annotated classes and compares these instead of
the last-modified value.

commit a4de03f352b21ce6abad570d2753467e3a972a10
Author: Kai Moritz
Date: Tue Dec 11 17:02:14 2012 +0100

hibernate4:export is skipped, when annotated classes are unchanged

Hbm2DdlMojo now checks the last-modified-timestamp of all found annotated
classes and aborts the schema-generation, when no class has changed and no
new class was added since the last execution.

It then sets a maven-property, to indicate to other plugins, that the
generation was skipped.

commit 2f3807b9fbde5c1230e3a22010932ddec722871b
Author: Kai Moritz
Date: Thu Nov 29 18:23:59 2012 +0100

Found annotated classes get logged now

hibernate4-maven-plugin 1.0 released!

Yeah! We successfully released our first artifact to Central.

hibernate4-maven-plugin is now available in the Central Maven Repository

That means, that you now can use it without manually downloading and adding it to your local repository.

Simply define it in your plugins-section…


  de.juplo
  hibernate4-maven-plugin
  1.0

…and there you go!

hibernate4-maven-plugin

A simple Plugin for generating a Database-Schema from Hibernate 4 Mapping-Annotations

Hibernate comes with the buildin functionality, to automatically create or update the database schema. This functionality is configured in the session-configuraton via the parameter hbm2ddl.auto (see Hibernate Reference Documentation – Chapter 3.4. Optional configuration properties). But doing so is not very wise, because you can easily corrupt or erase your production database, if this configuration parameter slips through to your production environment.

Alternatively, you can run the tools SchemaExport or SchemaUpdate by hand. But that is not very comfortable and being used to maven you will quickly long for a plugin, that does that job automatically for you, when you fire up your test cases.

In the good old times, there was the Maven Hibernate3 Plugin, that does this for you. But unfortunatly, this plugin is not compatible with Hibernate 4.x. Since there does not seem to be any successor for the Maven Hibernate3 Plugin and googeling does not help, I decided to write up this simple plugin (inspired by these two articles I found: Schema Export with Hibernate 4 and Maven and Schema generation with Hibernate 4, JPA and Maven).

I hope, the resulting simple to use buletproof hibernate4-maven-plugin is usefull!

Try it out now!