Module eviction applies <include/>'s of dependencies instead of honoring
default inclusion of root module
---------------------------------------------------------------------------------------------------------
Key: IVY-1126
URL: https://issues.apache.org/jira/browse/IVY-1126
Project: Ivy
Issue Type: Bug
Affects Versions: 2.1.0-RC2, 2.1.0-RC1
Environment: Ant 1.7.1 running Ivy ant tasks, all platorms
Reporter: Josh Guice
Priority: Minor
I'm going to describe the exact situation this apparent bug happens in
(although there might be a more general case of the problem).
Suppose we have modules A, B, and C. A depends directly on C by declaring the
following:
<dependency org="COMPANY" name="C" rev="latest.integration">
<exclude name="build" type="xml"/>
</dependency>
A also depends directly on B as follows:
<dependency org="COMPANY" name="B" rev="latest.integration"/>
And B depends directly on C as follows:
<dependency org="COMPANY" name="C" rev="latest.integration">
<include name="lib/file1" ext="jar" matcher="exactOrRegexp"/>
<include name="lib/file2" ext="jar" matcher="exactOrRegexp"/>
</dependency>
When a build of A is ran and there is no conflict between versions of C, all of
C's artifacts are used in the build of A. However, when there is a conflict
between the version of C that A depends and the version of C that B depends,
only the artifacts specified by B's include are used. This is the case even
when the conflict resolution selects the version of C that A depends on.
What's also interesting is that if A depends on multiple modules that depend on
C (and include different parts), what A ends up getting is the union of those
inclusions.
When I realized that the specific includes declared by the "sub" modules
appeared to be clobbering the unspecified default inclusion of everything
(except the build.xml) defined in the "root" module I was able to find the
following workaround:
<dependency org="COMPANY" name="C" rev="latest.integration">
<include name="*"/>
<exclude name="build" type="xml"/>
</dependency>
By explicitly including all of C's artifacts in A's dependency declaration the
problem goes away.
I still feel this is a bug though because when no eviction occurs all of C's
artifacts are used. Only when there is an eviction does the inclusion issue
appear (even when the same version is selected that would be chosen if there
was no conflict). It seems to me that the behavior of the system when there is
no conflict and version X is used should be the same as when there *is* a
conflict and version X is selected.
Thanks,
Josh
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.