ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten Coene <maarten_co...@yahoo.com>
Subject Re: Need StrictConflictManager to respect force
Date Mon, 20 Dec 2010 12:54:40 GMT
If possible, could you create a JIRA issue for this and attach a patch file to 
it?
https://issues.apache.org/jira/browse/IVY

thanks,
Maarten




----- Original Message ----
From: "Burcher, Greg" <Gregory.Burcher@netapp.com>
To: ivy-user@ant.apache.org
Sent: Fri, December 17, 2010 8:53:24 PM
Subject: Need StrictConflictManager to respect force

Neither StrictConflictManager nor LatestCompatibleConflictManager appear
to respect the 'force="true" attribute value on dependency. We would
like to have the behavior of StrictConflictManager with the enhancement
that it would recognize the dependency force attribute as an override to
strict conflict resolution. This appears to be fairly easy to code by
extending StrictConflictManager something like this:



public class StrictPlusForceConflictManager extends
StrictConflictManager {



    @Override

    public Collection resolveConflicts(IvyNode parent, Collection
conflicts) {

        /*

         * Before using algorithm of StrictConflictManager,

         * first check for "force" revision  using code from
LatestConflictManager.

         */

        if (conflicts.size() < 2) {

            return conflicts;

        }

        for (Iterator iter = conflicts.iterator(); iter.hasNext();) {

            IvyNode node = (IvyNode) iter.next();

            DependencyDescriptor dd =
node.getDependencyDescriptor(parent);

            if (dd != null && dd.isForce()

                    &&
parent.getResolvedId().equals(dd.getParentRevisionId())) {

                return Collections.singleton(node);

            }

        }

        return super.resolveConflicts(parent, conflicts);

    }

}



We have not yet tested because it is a non-trivial task to create our
own ConflictManager subclass, configure to ivy, and deploy the compiled
class into an appropriate classpath for our build process. For now we
are working around this issue by using a strategy based on the
dependency exclude attribute. However, this strategy is not as clean for
us as it would be to use the dependency force attribute.



Is it possible that combined strict/force conflict management support
could be added to Ivy? Or maybe someone can suggest a strategy to
achieve something similar using support already provided?



Thanks,



Greg Burcher


      

Mime
View raw message