java - What is the difference between ivy's override tag and force=true attribute? -
here example. dealing ivy 2.1 , ant 1.8.3. 1 of our project has direct dependency of 'math' version 5.1 , 'common' version 1.4.6. 'common' has direct dependency of 'math' version 5.2.
<dependencies> <dependency org="home" name="math" revision="5.1" conf="runtime" /> <dependency org="home" name="common" revision="1.4.6" conf="runtime" /> </dependencies>
it sure resolution gather 'math' version 5.2 owing 'common's direct dependency. since causes compiler error want use 'math' 5.1 instead therefore tried put proper override tag ivy xml after dependency tags:
<override org="home" module="math" rev="5.1" />
it should work , gather version 5.1. , turned out works in intellij idea 14 , in eclipse 4.3, after respective ivy plugin's resolve can see 'math' version 5.1 in project's libraries. have checked dependency graph in ivy visualizer view , seemed fine.
however when use 1 of suitable ant build target fails compilation error because resolves 'math' version 5.2 rather 5.1(!!).
based on ivy's documentation override
"can useful when direct dependency bringing transitive dependency want change revision, without declaring dependency on it"
also claimed that
overriding done before else, in phase called dependency descriptor mediation. transitive dependency behave if declared new value.
so should work ant build behaves contradictory expectation. figured out force attribute (force="true") of dependency tag rescue results expected library structure after ides' , after ant build resolution. based on ivy documentation:
...the dependency element supports force attribute (since 0.8), gives indication conflicts manager force revision of dependency 1 given here.
why override tag causes contradictory behavior of different tools , why force="true" works? appreciate if can highlight (slight?) differences.
Comments
Post a Comment