Tuesday, March 2, 2010

Compiling Hibernate 3.5.x

Few days ago I wanted to build Hibernate new 3.5.x trunk to see the documentation and basically eyeball differences from prior versions. I found this page (http://www.hibernate.org/422.html) and followed the set-up steps. This is where the pain started.

First off, build failed with an maven enforcer plugin error. I am running on jdk 1.6, specifically "1.6.0_17". Enforcer has a configuration that stops build when building with 1.6 jdk i.e. [1.5,1.6) - require at least 1.5 exclusive of 1.6.
Ended up changing that to [1.5,1.7)

Secondly, I am working on a Mac and hibernate builds documentation with po2xml that is not available on mac out of the box. Need to use ports (fink, macports, etc). I had an Ubuntu VM - so instead of messing around with ports I just moved to vm.

Thirdly, build was doing some very strange things - i.e. jar artifacts were not getting published to local .m2/repository. For some reason they were renamed to $artifact.jdocbook-style. This was totally bewildering result. I spent a bit of time trying to look at the debug log from Maven - but that provided no immediate results. A hint came from :

<requireMavenVersion>
<version>(2.0.7,)</version>
</requireMavenVersion>


I was using Maven 2.2.1. So I thought - would it help to downgrade to 2.0.11 and see if that helps? Well - yes it did help.
After repointing M2_HOME to location of 2.0.11 - build worked fine.

The moral of the story - to build hibernate you MUST use Maven 2.0.11 until something funky is fixed in maven jdocbook plugin.

No comments: