Return-Path: Delivered-To: apmail-ant-ivy-user-archive@www.apache.org Received: (qmail 25551 invoked from network); 21 Dec 2010 16:53:52 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Dec 2010 16:53:52 -0000 Received: (qmail 31266 invoked by uid 500); 21 Dec 2010 16:53:52 -0000 Delivered-To: apmail-ant-ivy-user-archive@ant.apache.org Received: (qmail 31005 invoked by uid 500); 21 Dec 2010 16:53:50 -0000 Mailing-List: contact ivy-user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ivy-user@ant.apache.org Delivered-To: mailing list ivy-user@ant.apache.org Received: (qmail 30997 invoked by uid 99); 21 Dec 2010 16:53:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Dec 2010 16:53:49 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=10.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Gregory.Burcher@netapp.com designates 216.240.18.37 as permitted sender) Received: from [216.240.18.37] (HELO mx2.netapp.com) (216.240.18.37) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Dec 2010 16:53:42 +0000 X-IronPort-AV: E=Sophos;i="4.60,208,1291622400"; d="scan'208";a="497460678" Received: from smtp2.corp.netapp.com ([10.57.159.114]) by mx2-out.netapp.com with ESMTP; 21 Dec 2010 08:53:19 -0800 Received: from sacrsexc1-prd.hq.netapp.com (sacrsexc1-prd.hq.netapp.com [10.99.115.27]) by smtp2.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id oBLGrJ78000603 for ; Tue, 21 Dec 2010 08:53:19 -0800 (PST) Received: from rtprsexc2-prd.hq.netapp.com ([10.100.161.115]) by sacrsexc1-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 21 Dec 2010 08:53:19 -0800 Received: from RTPMVEXC1-PRD.hq.netapp.com ([10.100.161.112]) by rtprsexc2-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 21 Dec 2010 11:53:18 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable x-cr-hashedpuzzle: AOsD AbcG BnEE CNG7 C3uH C9dt E/TW Fntx F4Ga GEeL GmTm HYJK Hq32 J3SD Kfuu LI60;1;aQB2AHkALQB1AHMAZQByAEAAYQBuAHQALgBhAHAAYQBjAGgAZQAuAG8AcgBnAA==;Sosha1_v1;7;{55E445F9-1BE2-4E56-87A7-E56558174137};ZwByAGUAZwBvAHIAeQAuAGIAdQByAGMAaABlAHIAQABuAGUAdABhAHAAcAAuAGMAbwBtAA==;Tue, 21 Dec 2010 16:53:14 GMT;UgBFADoAIABOAGUAZQBkACAAUwB0AHIAaQBjAHQAQwBvAG4AZgBsAGkAYwB0AE0AYQBuAGEAZwBlAHIAIAB0AG8AIAByAGUAcwBwAGUAYwB0ACAAZgBvAHIAYwBlAA== x-cr-puzzleid: {55E445F9-1BE2-4E56-87A7-E56558174137} Content-class: urn:content-classes:message Subject: RE: Need StrictConflictManager to respect force Date: Tue, 21 Dec 2010 11:53:14 -0500 Message-ID: <486C9312BAA03A49AB752011C85A27500534D1D1@RTPMVEXC1-PRD.hq.netapp.com> In-Reply-To: <891803.91519.qm@web30808.mail.mud.yahoo.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Need StrictConflictManager to respect force Thread-Index: AcugmiPlUpxqypgDSlmE7G8slxgYHwAk/RUw References: <486C9312BAA03A49AB752011C85A27500534C70E@RTPMVEXC1-PRD.hq.netapp.com> <589320.69477.qm@web30805.mail.mud.yahoo.com> <486C9312BAA03A49AB752011C85A27500534CD14@RTPMVEXC1-PRD.hq.netapp.com> <603952.50533.qm@web30802.mail.mud.yahoo.com> <486C9312BAA03A49AB752011C85A27500534CEC8@RTPMVEXC1-PRD.hq.netapp.com> <891803.91519.qm@web30808.mail.mud.yahoo.com> From: "Burcher, Greg" To: X-OriginalArrivalTime: 21 Dec 2010 16:53:18.0169 (UTC) FILETIME=[9131DC90:01CBA12F] X-Virus-Checked: Checked by ClamAV on apache.org I'm having some trouble because I do not understand the internals of how Ivy handles the dependency metadata. I copied the algorithm from LatestConflictManager for resolution of conflict via the "force" attribute: for (Iterator iter =3D conflicts.iterator(); iter.hasNext();) { IvyNode node =3D (IvyNode) iter.next(); DependencyDescriptor dd =3D node.getDependencyDescriptor(parent); if (dd !=3D null && dd.isForce() && parent.getResolvedId().equals(dd.getParentRevisionId())) { return Collections.singleton(node); } } I have looked some into the Ivy code, but it is difficult to tell exactly how this algorithm relates to the ivy.xml metadata that I need to provide, specifically where to place my "force" attribute to force resolution to a specific revision of a module. Looking instead from the outside in, I tried to infer the algorithm by watching what Ivy did with various attempts to place the "force" attribute in different places. In general, it seems that I need to place the "force" attribute in the ivy.xml dependencies for the IvyNode passed as parent to the resolveConflicts() method. BTW, it might be nice to include trace of the parent name in the StrictConflictException. I was thinking I should put the "force" in the root IvyNode, but this does not seem to work. Placing the "force" in the IvyNode passed as parent seems to work most of the time. The curious part is I'm not sure what is the meaning of "parent" as opposed to "root" and why placing the "force" at the root would not carry down through all transitive dependencies. In some cases, I have found that even placing the "force" at the IvyNode passed as parent does not work. In fact, I cannot find any place to put the "force" that resolves the conflict. Is it possible that the algorithm to utilize "force" could be changed to make this process easier for the user? Could someone offer an explanation of the algorithm that does not presume intimate understanding of the Ivy code? Thanks, Greg > -----Original Message----- > From: Maarten Coene [mailto:maarten_coene@yahoo.com] > Sent: Monday, December 20, 2010 6:03 PM > To: ivy-user@ant.apache.org > Subject: Re: Need StrictConflictManager to respect force >=20 > Excellent news! :-) >=20 > thanks, > Maarten >=20 >=20 >=20 >=20 > ----- Original Message ---- > From: "Burcher, Greg" > To: ivy-user@ant.apache.org > Sent: Mon, December 20, 2010 10:33:43 PM > Subject: RE: Need StrictConflictManager to respect force >=20 > Thanks Maarten. That was exactly the bit of information that I needed. > All appears to be working now. Once I have the solution fully verified, > I will post to the ivy jira. >=20 > Greg >=20 > > -----Original Message----- > > From: Maarten Coene [mailto:maarten_coene@yahoo.com] > > Sent: Monday, December 20, 2010 4:18 PM > > To: ivy-user@ant.apache.org > > Subject: Re: Need StrictConflictManager to respect force > > > > You have to add your custom conflictmanager using the > > element in > > your settings.xml. > > > > Here you can find a little example for adding a custom resolver: > > http://ant.apache.org/ivy/history/latest- > > milestone/settings/classpath.html > > > > hope this helps you getting started... > > > > regards, > > Maarten > > > > > > > > ----- Original Message ---- > > From: "Burcher, Greg" > > To: ivy-user@ant.apache.org > > Sent: Mon, December 20, 2010 7:55:15 PM > > Subject: RE: Need StrictConflictManager to respect force > > > > We actually need this immediately so I will fully implement/verify > and > > then I will also submit to jira. I could do with some help with a > > problem that I am having trouble resolving. I have coded my > > StrictConflictManager subclass and added my code in a jar in the > > ivy.classpath. I have actually added my jar to the org.apache.ivy > > v2.1.0 > > module and added my jar as a publication in the ivy.xml for the ivy > > module. > > > > The Ivy configuration documentation does not have examples, nor could > I > > find any, on the exact syntax to set define a custom conflict > manager. > > > > This is what I have in my ivysettings.xml: > > > > > classname=3D"com.netapp.common.ivy.StrictWithForceConflictManager"/> > > > > > > > > > > Later, in my project ivy.xml file, I have this: > > > > > > > > Does this all look correct in terms of syntax? > > > > When I run my build.xml from the linux command line, the xml in the > > ivysettings.xml file seems to parse and be handled fine. However, I > get > > this error when my ivy.xml file is parsed: > > > > /u/burcher/myproject/build.xml:332: The following error occurred > while > > executing this line: > > /u/burcher/myproject/build.xml:150: impossible to parse ivy file for > > /u/burcher/myproject/build.xml: = ivyfile=3D/u/burcher/myproject/ivy.xml > > exception=3Djava.text.ParseException: [unknown conflict manager: > > strict-with-force in file:/u/burcher/myproject/ivy.xml > > ] > > at > > > org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser$AbstractPa > > r > > ser.checkErrors(AbstractModuleDescriptorParser.java:89) > > at > > > org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser$AbstractPa > > r > > ser.getModuleDescriptor(AbstractModuleDescriptorParser.java:342) > > at > > > org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser.parseDescri > > p > > tor(XmlModuleDescriptorParser.java:103) > > at > > > org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry.parseDescr > > i > > ptor(ModuleDescriptorParserRegistry.java:86) > > at > > > org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser.parseDescr > > i > > ptor(AbstractModuleDescriptorParser.java:48) > > at > > > com.netapp.common.module.ParallelSubAnt.buildModuleItems(ParallelSubAnt > > . > > java:736) > > at > > > com.netapp.common.module.ParallelSubAnt.doExecute(ParallelSubAnt.java:6 > > 9 > > 7) > > at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277) > > at > > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) > > at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown > Source) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso > > r > > Impl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:597) > > at > > > org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java: > > 1 > > 06) > > at org.apache.tools.ant.Task.perform(Task.java:348) > > at > > org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68) > > at ... > > > > Running my build.xml instead in eclipse, I see this error message: > > > > Error while resolving the ivy instance for ivy.xml in 'myproject': > > The ivy settings file > > 'file:h:/p4/netapp_ivy_repo/main/ivysettings.xml' could not be > parsed: > > failed to load settings from > > file:/h:/p4/netapp_ivy_repo/main/ivysettings.xml: impossible to > define > > new type: class not found: > > com.netapp.common.ivy.StrictWithForceConflictManager in [] nor Ivy > > classloader > > Error while resolving the ivy instance for ivy.xml in 'dfm-common': > > > > Here the error is in the ivysettings.xml file, as though my custom > > class > > cannot be found. > > > > I will continue to dig into these problems, but any suggestions would > > be > > appreciated. > > > > Thanks, > > > > Greg > > > > > -----Original Message----- > > > From: Maarten Coene [mailto:maarten_coene@yahoo.com] > > > Sent: Monday, December 20, 2010 7:55 AM > > > To: ivy-user@ant.apache.org > > > Subject: Re: Need StrictConflictManager to respect force > > > > > > 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" > > > 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=3D"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 =3D conflicts.iterator(); iter.hasNext();) > { > > > > > > IvyNode node =3D (IvyNode) iter.next(); > > > > > > DependencyDescriptor dd =3D > > > node.getDependencyDescriptor(parent); > > > > > > if (dd !=3D 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 > > > > > > > > > > > > > > > > > >=20 >=20 >=20 >=20