Hi Connor, Stephen
 
Apologies. I didn't give a very clear explanation of the rationale for the 
changes in the patch, hopefully I can elaborate and would welcome any further 
feedback you may have.


The dependency tree for the 1.2 build is:
 
[dependency:tree {execution: default-cli}]
test:test:jar:0.1-SNAPSHOT
\- joda-time:joda-time-hibernate:jar:1.2:compile
   +-
joda-time:joda-time:jar:1.5:compile
   \- org.hibernate:hibernate:jar:3.0.5:compile
      +-
commons-logging:commons-logging:jar:1.0.4:compile
      +-
ehcache:ehcache:jar:1.1:compile
      +-
cglib:cglib:jar:2.0.2:compile
      +-
javax.transaction:jta:jar:1.01B:compile
      +-
asm:asm:jar:1.4.3:compile
      +-
commons-collections:commons-collections:jar:2.1.1:compile
      +-
dom4j:dom4j:jar:1.6:compile
      \-
hibernate:antlr:jar:2.7.5H3:compile
 
Ignoring the rest of the dependency tree, the versions of
Hibernate and JodaTime are outdated, not a big deal, you can work around this
(which you pretty much always will), but I still think it might be an 
improvement if you don't have to:
 
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time-hibernate</artifactId>
      <version>1.2</version>
      <exclusions>
        <exclusion>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate</artifactId>
        </exclusion>
        <exclusion>
          <groupId>joda-time</groupId>
          <artifactId>joda-time</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
 
The first change I made in the patch was to update to
Hibernate 3.3.2.GA as the current release. A project depending on the released
jar with Hibernate 3.3.2 would see the following dependency tree:
 
[INFO] [dependency:tree {execution: default-cli}]
[INFO] test:test:jar:0.1-SNAPSHOT
[INFO] \-
joda-time:joda-time-hibernate:jar:1.3-SNAPSHOT:compile
[INFO]    +-
joda-time:joda-time:jar:1.6:compile
[INFO]    \-
org.hibernate:hibernate-core:jar:3.3.2.GA:compile
[INFO]       +- antlr:antlr:jar:2.7.6:compile
[INFO]       +-
commons-collections:commons-collections:jar:3.1:compile
[INFO]       +-
dom4j:dom4j:jar:1.6.1:compile
[INFO]       |  \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO]       +-
javax.transaction:jta:jar:1.1:compile
[INFO]       \-
org.slf4j:slf4j-api:jar:1.5.8:compile
 
I have updated the Joda Time dependency to the current
version also. Some nice side effects of updating the Hibernate dependency
include the fact the version of JTA is available under a less restrictive
license so you can resolve this directly using Maven without having to download
it yourself (building using 1.2 failed for me until I did that). 


Another point of interest is that Hibernate is not using
commons-logging, it is using SLF4J. Only the API is linked at compile time, so
if you want to use Hibernate at runtime, you'll need to provide an
implementation of a logging library onto the classpath. Similarly Hibernate now
uses either Javassist /or/ CGLib so you need to include the one you want to use
on your runtime classpath (with Javassist working without further configuration 
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2506). You also 
don't get EHCache for similar reasons I think.
 
You would need to supply these runtime dependencies to
execute the unit tests. These are the additional dependencies and I have marked
these as test scope (like JUnit itself) so that they are only supplied during 
unit test execution; the
dependency tree for a user of the API is unchanged - so they are still free to
select whatever logging framework they want for example. 
 
I did include the tag <optional/> in the patch for
Hibernate itself, this should have read "<optional>true</optional>"
(corrected file attached). The effect of this would be that the linked
Hibernate jar would not be exported as a transitive dependency with the jar. I
think it is fair to say that you want to use this library because you are
already using a version of Hibernate that you have chosen, so this would spare
the need to reject the transitive dependency, and mean that the jar is then 
directly
usable (without exclusions) for as long as Hibernate retains binary
compatibility.
 
If I declare a project which depends on Joda-Time
Hibernate with the patch, and the corrected line above, the dependency tree 
looks
as follows:
 
[dependency:tree {execution: default-cli}]
test:test:jar:0.1-SNAPSHOT
\- joda-time:joda-time-hibernate:jar:1.3-SNAPSHOT:compile
   \-
joda-time:joda-time:jar:1.6:compile
 
Now I can add whichever Hibernate jars I would want to use.


The other changes basically related to trying to make the
build less platform dependent, so resolving a warning about platform encoding,
and also using the Maven toolchain so that the build was performed with Java
1.4 without hardcoding a path (these are both facilities only added to Maven 
since 1.2 release of the jar).

Best wishes,

 
Chris

-----Original Message-----
From: Connor Barry [mailto:[email protected]]
Sent: 17 February 2010 03:42
To: Discussion of the Joda project
Subject: [SPAM] - Re: [Joda-interest] Joda-time and Hibernate 3.3.x -
Email found in subject

I agree with Stephen, the joda-time-hibernate artifact should only
specify Hibernate and Joda time as its dependencies. Was there a
specific reason to include something else?

Stephen, if a user wants to use the latest joda-time but they are on an
older version of Hibernate, assuming there are no binary
incompatibilities then they can simply reject the dependency pulled from

joda-time and override with their own custom version of Hibernate. So
nothing you have to worry about.

Connor

On 2/16/2010 10:50 AM, Stephen Colebourne wrote:
> The problem seems to be that everyone disagrees on what the right
> version or dependencies are:
> http://n2.nabble.com/Joda-time-and-Hibernate-3-3-x-td3615120.html
>
> Last change I made, I removed all the dependencies except hibernate
> (and thus maven should work out its own dependencies transitively).
> This patch adds them all back in! And what about those users who
> aren't on the latest version of Hibernate?
>
> As I find maven extremely time-wasting, and don't use hibernate, I
> keep on struggling to see how I can get this to a resolution that
> satisfies everyone!
>
> Stephen
>
>
> On 16 February 2010 10:08, Chris Pheby<[email protected]>  wrote:
>
>> Hi Stephen,
>>
>> Please find attached a patch for Joda Time Hibernate which
>> updates the pom to use the Hibernate 3.3.2.GA release. Also there are
a few
>> updates of some of the other dependencies to current releases. I also
modified the pom file to use Maven's toolchain which means the location
of JDK 1.4's javac is
>> not hardcoded into the pom.
>>
>> Kind Regards
>>
>>
>> Chris Pheby.
>>
>>
>>       New Email names for you!
>> Get the Email name you've always wanted on the new @ymail and
@rocketmail.
>> Hurry before someone else does!
>> http://mail.promotions.yahoo.com/newdomains/aa/
>>
------------------------------------------------------------------------
------
>> SOLARIS 10 is the OS for Data Centers - provides features such as
DTrace,
>> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
>> http://p.sf.net/sfu/solaris-dev2dev
>> _______________________________________________
>> Joda-interest mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/joda-interest
>>
>>
>>
>
------------------------------------------------------------------------
------
> SOLARIS 10 is the OS for Data Centers - provides features such as
DTrace,
> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
> http://p.sf.net/sfu/solaris-dev2dev
> _______________________________________________
> Joda-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>

------------------------------------------------------------------------
------
SOLARIS 10 is the OS for Data Centers - provides features such as
DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest


-------------------------------------------------------------------------------
This message contains confidential information and is intended only for the 
individual named.

If you are not the named addressee you should not disseminate, distribute or
copy this e-mail. Please notify the sender immediately by e-mail if you have
received this e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive late or
incomplete, or contain viruses. The sender therefore does not accept liability
for any errors or omissions in the contents of this message, which arise as a
result of e-mail transmission. If verification is required please request a 
hard-copy version.
-------------------------------------------------------------------------------


      Get your new Email address!
Grab the Email name you&#39;ve always wanted before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/

Attachment: hibernate-update.patch
Description: Binary data

------------------------------------------------------------------------------
Download Intel&reg; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs 
proactively, and fine-tune applications for parallel performance. 
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to