ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vitaliy Sapounov (JIRA)" <>
Subject [jira] [Created] (IVY-1422) Dependency "force" does not work if comes from extended module
Date Tue, 07 May 2013 08:57:15 GMT
Vitaliy Sapounov created IVY-1422:

             Summary: Dependency "force" does not work if comes from extended module
                 Key: IVY-1422
             Project: Ivy
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.3.0
            Reporter: Vitaliy Sapounov


We have a project that uses several Ivy modules:

1) There is a base module that declares dependency on "vendorlib", revision 1.0, with "force"
attribute (the whole purpose of the module is to guarantee the "vendorlib" revision):

    <info organisation="com.mycompany" module="base" revision="trunk"/>

        <dependency org="com.vendor" name="vendorlib" rev="1.0" force="true"/>

2) There is an extending module that extends the base and includes our library "mylib":

    <info organisation="com.mycompany" module="extending" revision="trunk">
        <extends organisation="com.test" module="base" revision="trunk"/>

        <dependency org="com.mycompany" name="mylib" rev="trunk"/>


3) Finally, our library "mylib" also depends on "vendorlib", revision 2.0 (i.e. there is another
dependency on "vendorlib" with revision 2.0):

    <info organisation="com.mycompany" module="mylib" revision="trunk"/>

        <dependency org="com.vendor" name="vendorlib" rev="2.0"/>


4) We use "latest-revision" conflict manager in ivysettings.xml.

***** PROBLEM:

Despite the "force" attribute in base module for "vendorlib", latest revision (2.0) of "vendorlib"
is selected by the conflict manager for the extended module.

***** ROOT CAUSE: has the following code:

    public Collection resolveConflicts(IvyNode parent, Collection conflicts) {
        if (conflicts.size() < 2) {
            return conflicts;
        for (Iterator iter = conflicts.iterator(); iter.hasNext();) {
            IvyNode node = (IvyNode);
            DependencyDescriptor dd = node.getDependencyDescriptor(parent);
            if (dd != null && dd.isForce()
>>>>>>>>>                    && parent.getResolvedId().equals(dd.getParentRevisionId()))
                return Collections.singleton(node);

Note ">>>>" line: since "vendorlib" with "force" attribute comes from the base
module, dd.getParentRevisionId() returns "com.mycompany#base;trunk", but parent.getResolvedId()
returns "com.mycompany#extended;trunk", thus the last comparison  returns "false" and "force"
is lost.

If we move dependency with "force" to the extended module, it will work.


We use the "base" module as a template that fixes versions of libraries provided by the J2EE
application server we use. Based on that template, we create a number of extending web applications
that guarantee to use the libs that the application server provides. (The actual use case
is slightly more complicated, as e.g. "mylib" declares dependency on "vendorlib" version range
it supports, e.g. "[2.0,5.7]" range.)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message