-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: Hibernate, Maven & the jta.jar: a proposed fix
PostPosted: Tue Sep 01, 2009 8:10 pm 
Newbie

Joined: Wed Jun 17, 2009 11:08 am
Posts: 7
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


Top
 Profile  
 
 Post subject: Re: Hibernate, Maven & the jta.jar: a proposed fix
PostPosted: Fri Nov 06, 2009 10:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
The problem is that there are numerous re-licensing of the api jars (this is true of all the EE spec jars, not just jta). You like geronimo, but glassfish has theirs, jboss has theirs, etc. Why does your favorite get to win?

Anyway, this is already being addressed: http://opensource.atlassian.com/project ... e/HHH-4548

Glassfish recently began re-licensing most of these jars under CDDL+GPL: http://wiki.java.net/bin/view/Projects/ ... pendencies
The ones we care about are anyway. However, these re-licensed jars are not yet available in any repo of which I am aware. So in the meantime we will use the JBoss ones.

On a side note, this is really a failing in Maven in my opinion and the opinion of many others. Maven should provide some answer to deal with these "artifact coordinates" such that requests for them can be remapped or redirected elsewhere.


Top
 Profile  
 
 Post subject: Re: Hibernate, Maven & the jta.jar: a proposed fix
PostPosted: Fri Nov 06, 2009 3:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
steve wrote:
On a side note, this is really a failing in Maven in my opinion and the opinion of many others. Maven should provide some answer to deal with these "artifact coordinates" such that requests for them can be remapped or redirected elsewhere.


Well let me qualify this a bit more. Really I believe this should be a function of the repository as part of its metadata for the artifacts. However, Maven has a monopoly on the definition of the metadata (the pom) that goes into these repositories.


Top
 Profile  
 
 Post subject: Re: Hibernate, Maven & the jta.jar: a proposed fix
PostPosted: Sat Nov 07, 2009 10:32 pm 
Newbie

Joined: Wed Jun 17, 2009 11:08 am
Posts: 7
Hi Steve,

thank you for taking the time to reply to my post; I image you guys are probably bored to death hearing this kind of thing.

steve wrote:
The problem is that there are numerous re-licensing of the api jars (this is true of all the EE spec jars, not just jta). You like geronimo, but glassfish has theirs, jboss has theirs, etc. Why does your favorite get to win?


I really have no preference which particular jar is used, I just want my builds to work automatically so that I don't have to go to ten different machines manually installing the jta.jar required by Hibernate. geronimo happened to be the first one I tried that worked, hence the suggestion.

steve wrote:
On a side note, this is really a failing in Maven in my opinion and the opinion of many others. Maven should provide some answer to deal with these "artifact coordinates" such that requests for them can be remapped or redirected elsewhere.


I am just an innocent by-stander (end user) and don't know enough about the Maven internals doing the dependency resolution magic, so I can't really comment on that. It's nice to hear that you guys are doing something about the licensing problem though...


Top
 Profile  
 
 Post subject: Re: Hibernate, Maven & the jta.jar: a proposed fix
PostPosted: Sun Nov 08, 2009 9:17 am 
Newbie

Joined: Wed Jun 17, 2009 11:08 am
Posts: 7
I forgot to mention: in my current project we only use Hibernate core, thus the following declaration avoids the whole jta.jar issue altogether:

Code:
<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-core</artifactId>
   <version>3.3.0.GA</version>
</dependency>

<dependency>
   <groupId>javassist</groupId>
   <artifactId>javassist</artifactId>
   <version>3.8.0.GA</version>
</dependency>

Thought I should share it in case someone else found it useful...


Top
 Profile  
 
 Post subject: Re: Hibernate, Maven & the jta.jar: a proposed fix
PostPosted: Tue Nov 10, 2009 11:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
As another alternative: http://jira.codehaus.org/browse/GRADLE-733


Top
 Profile  
 
 Post subject: Re: Hibernate, Maven & the jta.jar: a proposed fix
PostPosted: Tue Nov 10, 2009 11:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
buzo wrote:
I forgot to mention: in my current project we only use Hibernate core, thus the following declaration avoids the whole jta.jar issue altogether:

Code:
<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-core</artifactId>
   <version>3.3.0.GA</version>
</dependency>

<dependency>
   <groupId>javassist</groupId>
   <artifactId>javassist</artifactId>
   <version>3.8.0.GA</version>
</dependency>

Thought I should share it in case someone else found it useful...


hibernate-core does in fact have a required dependency on jta, whether you use jta or not. Unfortunate, but true.


Top
 Profile  
 
 Post subject: Re: Hibernate, Maven & the jta.jar: a proposed fix
PostPosted: Wed Nov 11, 2009 10:03 am 
Newbie

Joined: Wed Jun 17, 2009 11:08 am
Posts: 7
steve wrote:
hibernate-core does in fact have a required dependency on jta, whether you use jta or not. Unfortunate, but true.

You are right, hibernate-core does depend on jta. However, the full hibernate jar, say hibernate-3.2.7.ga.jar, depends on jta-1.0.1B.jar (which is not available on maven central) while hibernate core (ie hibernate-core-3.3.0.GA.jar) depends on jta-1.1.jar, which is available from central. So adding hibernate.jar to your project will break your build, requiring manual installation of the jta.jar, while adding hibernat-core will work out of the box.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.