Return-Path: Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: (qmail 78899 invoked from network); 22 Dec 2010 16:43:30 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Dec 2010 16:43:30 -0000 Received: (qmail 42074 invoked by uid 500); 22 Dec 2010 16:43:28 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 41942 invoked by uid 500); 22 Dec 2010 16:43:26 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 41910 invoked by uid 99); 22 Dec 2010 16:43:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Dec 2010 16:43:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Dec 2010 16:43:23 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oBMGh1Gj022190 for ; Wed, 22 Dec 2010 16:43:01 GMT Message-ID: <1246884.271051293036181215.JavaMail.jira@thor> Date: Wed, 22 Dec 2010 11:43:01 -0500 (EST) From: "Greg Burcher (JIRA)" To: notifications@ant.apache.org Subject: [jira] Created: (IVY-1256) Create a StrictConflictManager that supports the force attribute MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Create a StrictConflictManager that supports the force attribute ---------------------------------------------------------------- Key: IVY-1256 URL: https://issues.apache.org/jira/browse/IVY-1256 Project: Ivy Issue Type: Improvement Components: Core Reporter: Greg Burcher Priority: Minor 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: /** * Extends the built-in StrictConflictManager to allow use of the force="true" attribute on individual dependencies. */ public class StrictWithForceConflictManager extends StrictConflictManager { public StrictWithForceConflictManager() { } @SuppressWarnings("unchecked") @Override public Collection resolveConflicts(IvyNode parent, Collection conflicts) { if (conflicts.size() < 2) { return conflicts; } Collection conflictNodes = conflicts; /* * First check for root level force dependency only. */ DependencyDescriptor[] rootDescriptors = parent.getRoot().getDescriptor().getDependencies(); for (IvyNode node : conflictNodes) { for (DependencyDescriptor dd : rootDescriptors) { if (dd.isForce() && dd.getDependencyRevisionId().equals(node.getResolvedId())) { return Collections.singleton(node); } } } /* * No root level force dependency. * Resolve any conflicts with a force attribute visible within the current parent node. * The following two blocks of code copied from LatestConflictManager. */ for (IvyNode node : conflictNodes) { DependencyDescriptor dd = node.getDependencyDescriptor(parent); if (dd != null && dd.isForce() && parent.getResolvedId().equals(dd.getParentRevisionId())) { return Collections.singleton(node); } } /* * Not resolvable via force within the current parent node. * If the list of conflicts contains dynamic revisions, delay the conflict resolution. */ for (IvyNode node : conflictNodes) { ModuleRevisionId modRev = node.getResolvedId(); if (getSettings().getVersionMatcher().isDynamic(modRev)) { return null; } } return super.resolveConflicts(parent, conflicts); } } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.