On 13/12/2011, at 8:19 AM, Daz DeBoer wrote:

> On 12 December 2011 14:26, Robert Watkins <[email protected]> wrote:
> This isn't just a Maven feature - Ivy has the same functionality with a 
> different syntax - 
> http://ant.apache.org/ivy/history/trunk/settings/version-matchers.html It 
> just so happens that for this particular area, the syntax is the same.
> 
> Well as far as I know, ivy doesn't support the concept of "hard" version 
> requirements. So ivy might support the [1.0] syntax, but I don't think it 
> will behave the way maven does. (I'm not certain, because in Ivy the 
> responsibility for ejecting versions is smeared between the 
> DependencyResolver implementations and the Ivy ResolveEngine. So it may 
> depend on the DependencyResolvers you have configured.)
>  
Okay, after a bit of investigation, this is what I've found: the version 
matchers are only 'hard' if they are also forced. So in this respect, Ivy and 
Gradle are similar. (Gradle also will correctly use Ivy-style version matchers, 
both forced and not-forced)

The big difference is that Ivy respects the forced dependency transitively. 
Gradle doesn't, at least not at this time.

To implement this, Gradle will need to:
* Add the forced="true" attribute to the appropriate dependency in the 
generated ivy.xml
* Respect said forced="true" attribute in the ivy.xml for dependent projects.

And, when reading/generating Maven, treat forced dependencies as 'hard'.

I've updated my test cases again, this time including ivy vs gradle, showing 
the differences - output at 
http://dl.dropbox.com/u/46203904/result_for_ivy_forced_dependencies.html, with 
a tarball of the test case at 
http://dl.dropbox.com/u/46203904/ivy_forced_dependency_in_nested_diamond_structure_resolves_between_peers.tgz


Reply via email to