The latest version of the maven-hibernate-plugin only supports Hibernate v2.x and cannot be used for projects that depend on Hibernate v3.x. Fortunately, there is a patch you can apply to v1.3 of the maven-hibernate-plugin to support both Hibernate v2.x and v3.x.
This short article provides a step-by-step guide for applying the patch and installing the new plugin, version 1.4.
- Have a look at theJIRA Entry, which talks about Support for Hibernate 3.0
- Download the patch.
Download the v1.3 of the maven-hibernate-plugin using svn
svn checkout http://svn.apache.org/repos/asf/maven/maven-1/plugins/tags/MAVEN_HIBERNATE_1_3.
Download the plugin-parent directory, since this is referenced by the maven-hibernate-plugin using svn
svn checkout http://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk/plugin-parent
Change into the \MAVEN_HIBERNATE_1_3 directory and apply the patch by executing
patch -p0 < version2and3comat.diff.
Build and install the plugin
And that’s all there is to it. Alternatively you can skip steps 1-6, download maven-hibernate-plugin-1.4.jar and drop it in MAVEN_HOME/plugins directory……but where’s the fun in that ;-).