Return-Path: X-Original-To: apmail-ant-notifications-archive@minotaur.apache.org Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 88987F102 for ; Tue, 7 May 2013 09:01:26 +0000 (UTC) Received: (qmail 28825 invoked by uid 500); 7 May 2013 09:01:25 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 28713 invoked by uid 500); 7 May 2013 09:01:25 -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 28692 invoked by uid 99); 7 May 2013 09:01:24 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 May 2013 09:01:24 +0000 Date: Tue, 7 May 2013 09:01:20 +0000 (UTC) From: "Vitaliy Sapounov (JIRA)" To: notifications@ant.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (IVY-1422) Dependency "force" does not work if comes from extended module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IVY-1422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vitaliy Sapounov updated IVY-1422: ---------------------------------- Description: *ENVIRONMENT* 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): {code:xml} {code} 2) There is an extending module that extends the base and includes our library "mylib": {code:xml} {code} 3) Finally, our library "mylib" also depends on "vendorlib", revision 2.0 (i.e. there is another dependency on "vendorlib" with revision 2.0): {code:xml} {code} 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* LatestConflictManager.java 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) iter.next(); 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. *REAL-LIFE APPLICABILITY* 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.) was: *ENVIRONMENT:* 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): {{monospaced}} {{monospaced}} 2) There is an extending module that extends the base and includes our library "mylib": 3) Finally, our library "mylib" also depends on "vendorlib", revision 2.0 (i.e. there is another dependency on "vendorlib" with revision 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: LatestConflictManager.java 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) iter.next(); 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. ***** REAL-LIFE APPLICABILITY: 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.) > Dependency "force" does not work if comes from extended module > -------------------------------------------------------------- > > Key: IVY-1422 > URL: https://issues.apache.org/jira/browse/IVY-1422 > Project: Ivy > Issue Type: Bug > Components: Core > Affects Versions: 2.3.0 > Reporter: Vitaliy Sapounov > > *ENVIRONMENT* > 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): > {code:xml} > > > > > > > {code} > 2) There is an extending module that extends the base and includes our library "mylib": > {code:xml} > > > > > > > > > {code} > 3) Finally, our library "mylib" also depends on "vendorlib", revision 2.0 (i.e. there is another dependency on "vendorlib" with revision 2.0): > {code:xml} > > > > > > > {code} > 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* > LatestConflictManager.java 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) iter.next(); > 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. > *REAL-LIFE APPLICABILITY* > 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: http://www.atlassian.com/software/jira