You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Stephen Woods <sw...@gmail.com> on 2009/03/17 16:34:32 UTC

Conflict Management: Spring 2.0 vs 2.5 and Hiberante 2.1 vs Hibernate 3.1

I have a module that has both Hibernate 2 and Hibernate 3 code in it
that depends on Spring. Unfortunately, since Spring no longer supports
Hibernate 2 as of version 2.5, up until now, I have been forced to
stay with Spring 2.0.

Now that I'm using Ivy, I am hoping that I can create configurations
for my module that will allow me to use different dependencies
depending on whether or not I'm using the old Hibernate 2 code at
runtime - I don't want to tie my hands to Spring 2.0 if I don't have
to (i.e. when I'm just using the Hibernate 3 code).

I tried to set this up with no real success. Here's a snippet from my
ivy.xml file:

 <dependency org="org.springframework" name="spring" rev="[2.0.2,)"
conf="compile-hibernate3->master(*);runtime-hibernate3->runtime(*)"/>
<dependency org="org.springframework" name="spring" rev="2.0.2"
conf="compile-hibernate2->master(*);runtime-hibernate2->runtime(*)" />

That doesn't seem to work, as version 2.0.2 gets evicted once version
2.5.4 enters the picture. I even tried using a latest compatible
conflict manager on Spring, but unfortunately, version 2.5.4 is
blacklisted regardless of what configuration I use.

So I'm wondering if anyone has done this before, or if anyone could
provide insight as to how I can accomplish this. Do I need to create
my own conflict manager? Do I need to modify the Spring ivy.xmls
somehow? Or will I just need to punt, and break my module up into
sub-modules with their own dependencies? Any help would be greatly
appreciated. Thanks!

Steve