Return-Path: Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: (qmail 68035 invoked from network); 8 Oct 2010 07:04:53 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Oct 2010 07:04:53 -0000 Received: (qmail 18207 invoked by uid 500); 8 Oct 2010 07:04:53 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 18128 invoked by uid 500); 8 Oct 2010 07:04:52 -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 18121 invoked by uid 99); 8 Oct 2010 07:04:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Oct 2010 07:04:51 +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; Fri, 08 Oct 2010 07:04:51 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o9874U1H015020 for ; Fri, 8 Oct 2010 07:04:30 GMT Message-ID: <8825953.37581286521470649.JavaMail.jira@thor> Date: Fri, 8 Oct 2010 03:04:30 -0400 (EDT) From: "Tom Liu (JIRA)" To: notifications@ant.apache.org Subject: [jira] Updated: (IVY-1236) Dynamic version resolution result is incorrect when ivy metadata contains extra attributes. In-Reply-To: <12466009.35861286509530560.JavaMail.jira@thor> 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-1236?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tom Liu updated IVY-1236: ------------------------- Attachment: dynamic_version_bug.zip > Dynamic version resolution result is incorrect when ivy metadata contains extra attributes. > ------------------------------------------------------------------------------------------- > > Key: IVY-1236 > URL: https://issues.apache.org/jira/browse/IVY-1236 > Project: Ivy > Issue Type: Bug > Components: Core > Affects Versions: 2.2.0 > Reporter: Tom Liu > Attachments: dynamic_version_bug.zip > > > Ivy resolution is incorrect given the following configuration: > ivy metadata of logging#slf4j;1.6.1 > > > Front end logging API. > > > > > > > > > > > > > > > > ivy metadata of logging#logback;0.9.24 ivy: > > > Back end logging implementation that implements SLF4J (successor to Log4J). > > > > > > > > > > > > > Dependencies to resolve: > > > I would expect the following jars of slf4j are resolved: > slf4-api-1.6.1.jar, jcl-over-slf4j-1.6.1.jar, jul-to-slf4j-1.6.1.jar, log4j-over-slf4j-1.6.1.jar > However, only slf4j-api-1.6.1.jar is resolved. > A eclipse project is attached to demonstrate the issue. > ivy metadata for slf4j 1.6.1: repo\logging\slf4j\1.6.1\ivy.xml) > ivy metadata for logback 0.9.24: repo\logging\logback\0.9.24\ivy.xml > I've debugged through and found that VisitNode does not deal with dynamic version correctly, so that when slf4j contains extra attributes, it behaves incorrectly: > org.apache.ivy.core.resolve.VisitNode: line 286 - 302 > public boolean loadData(String conf, boolean shouldBePublic) { > boolean loaded = node.loadData( > rootModuleConf, getParentNode(), parentConf, conf, shouldBePublic, getUsage()); > if (loaded) { > useRealNode(); > // if the loaded revision is different from original one > // we now register this node on the new resolved id > // this includes two cases: > // - the id refers to a dynamic revision, which has beenresolved by loadData > // - the loaded module descriptor has extra attributes in his info tag which are not > // used when declaring the dependency > if (data.getNode(node.getResolvedId()) == null || !data.getNode(node.getResolvedId()).getId().equals(node.getResolvedId())) > { > data.register(node.getResolvedId(), this); > > /** If node's id is dynamic, e.g. logging#slf4j;[1.6.1, 1.6.2], then the VisitNode will not be associated with it because only resolvedId is considered here*/ > /** The following fix associates dynamic id with VisitData as well */ > /** FIX START **/ > if(!node.getResolvedId().equals(node.getId())) { > ModuleRevisionId resolvedId = node.getResolvedId(); > data.register(ModuleRevisionId.newInstance(resolvedId.getOrganisation(), resolvedId.getName(), resolvedId.getBranch(), resolvedId.getRevision()), this); > } > /** FIX END **/ > } > } > return loaded; > } > I've applied this fix to handle dynamic version and then the resolution works fine. > Thanks, > Tom -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.