Hello there:
I've used Hibernate in my Maven builds for quite some time now, and as most of you probably know, the jta.jar dependency included in the Hibernate pom.xml never fails to cause grief. My understanding is that Sun has some sort of license restriction on this jar, which prevents it from being publicly available on the central Maven repository.
In the past, I was able to set up a copy of this jta.jar on a private Maven repository manager; all our development machines could then point to this repo and transparently download the hibernate.jar along with the jta.jar.
In my current project, I can only access the central maven repository: this causes my build to fail because jta is nowhere to be found (automatically, that is).
A workaround that seems to work so far, is to exclude the jta dependency from hibernate and explicitly include geronimo's JTA:
Code:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.7.ga</version>
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>geronimo-spec</groupId>
<artifactId>geronimo-spec-jta</artifactId>
<version>1.0.1B-rc4</version>
</dependency>
Now, this looks pretty ugly and helps my pom.xml become more verbose than necessary. So, my question is, given that every single developer that wants Hibernate/Maven will experience this pain, is there a reason why Hibernate cannot replace the infamous dependency to javax.transaction.jta.jar with the geronimo-spec.geronimo-spec-jta.jar?
I have cracked open both jars, and after comparing the contents they seem identical.
If there are no major drawbacks/objections with my suggestion above, I'll be happy to open a jira ticket: I could even give you a pom.xml with the new dependency.
This fix would remove any manual intervention from the developers and make Maven builds using Hibernate successful right out of the box (as opposed to the current default, failing builds right out of the box).
All comments/ideas are welcomed.
Regards