Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.1.0-RC2
-
None
-
None
-
Windows XP
Description
When using confmappingoverride=true, ivy does not behave like specified on
http://ant.apache.org/ivy/history/latest-milestone/ivyfile/configurations.html (2.1.0-rc2).
The last sentence states:
"When you now resolve the conf2 configuration, you'll get the other2 dependencies of your other-module",
but our tests show that in that case you also get other1 dependencies as well.
Below you can find the simplified use case we used to confirm that behavior.
The use case is like on the specifications page, just the artifacts were added.
Suppose we have "other-module" with the following ivy.xml:
<ivy-module version="2.0"> <info organisation="org.example.bug" module="other-module" revision="1.0.0.0" /> <configurations> <conf name="other1" /> <conf name="other2" /> </configurations> <publications> <artifact name="a1" conf="other1" /> <artifact name="a2" conf="other2" /> </publications> </ivy-module>
It contains two artifacts in two different configurations.
The ivy.xml of "this-module" is as following:
<ivy-module version="2.0"> <info organisation="org.example.bug" module="this-module" revision="1.0.0.0" /> <configurations confmappingoverride="true" defaultconfmapping="conf1->other1;conf2->other2"> <conf name="conf1" /> <conf name="conf2" extends="conf1" /> </configurations> <publications> <artifact name="b1" conf="conf1" /> <artifact name="b2" conf="conf2" /> </publications> <dependencies> <!-- build.xml just resolves conf2, but we still get a1.jar --> <dependency org="org.example.bug" name="other-module" rev="1.0.0.0" conf="conf1" /> </dependencies> </ivy-module>
In build.xml of "this-module" just conf2 is resolved:
<project name="ivyconfmappingoverridetest_bugreport_thismodule" xmlns:ivy="antlib:org.apache.ivy.ant"> <target name="retrieve"> <ivy:retrieve conf="conf2" /> </target> [...] </project>
but we still get both a1.jar and a2.jar in the lib directory
>dir this_module\lib /b a1-1.0.0.0.jar a2-1.0.0.0.jar
When we resolve/retrieve conf1 in "this-module", we want to get other1 dependency of "other-module".
When we resolve/retrieve conf2 in "this-module", we want to get other2 dependency of "other-module".
But when resolving/retrieving conf2, we get both other1 and other2 dependencies of "other-module",
although with confmappingoverride="true" we should just get other2 dependencies.
Unlike Ivy bug 917,
we do not expect that when using confmappingoverride just
<dependency name="other-module" conf="conf2->other2" />
should be constructed in memory instead of
<dependency name="other-module" conf="conf1->other1;conf2->other2" />
however, conf1->other1 mapping should not be used when we just ask the artifacts for conf2 to be resolved/retrieved.