Return-Path: Delivered-To: apmail-ant-notifications-archive@locus.apache.org Received: (qmail 98469 invoked from network); 6 Nov 2008 19:51:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Nov 2008 19:51:09 -0000 Received: (qmail 56966 invoked by uid 500); 6 Nov 2008 19:51:16 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 56948 invoked by uid 500); 6 Nov 2008 19:51:16 -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 56925 invoked by uid 99); 6 Nov 2008 19:51:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Nov 2008 11:51:15 -0800 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Nov 2008 19:50:06 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 75E1E234C284 for ; Thu, 6 Nov 2008 11:50:48 -0800 (PST) Message-ID: <991000479.1226001048481.JavaMail.jira@brutus> Date: Thu, 6 Nov 2008 11:50:48 -0800 (PST) From: "Juliano DeCarvalho (JIRA)" To: notifications@ant.apache.org Subject: [jira] Created: (IVY-966) Problem resolving latest jar from multiple repositories containing same jar with different versions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Problem resolving latest jar from multiple repositories containing same jar with different versions --------------------------------------------------------------------------------------------------- Key: IVY-966 URL: https://issues.apache.org/jira/browse/IVY-966 Project: Ivy Issue Type: Bug Affects Versions: 2.0-RC2 Environment: Windows XP SP2, JDK 1.6.0.05 Reporter: Juliano DeCarvalho This problem may be related to my configuration, but if it is, I'm not sure how to fix it. My project has a dependency on a jar that I build with another project. This jar can be found in two different maven repositories, one local and one shared. The jars have different modification dates but the same revision (SNAPSHOT) in either repository. I need Ivy to find the latest of the two jars. Both repositories are located on my local filesystem, for testing purposes. Ivy does not seem to return the latest of the two jars. It seems to randomly select one, from what I can see. I have debugged into the code and I think I found the problem, but not the cause or a solution. My configuration: *Ant:* {quote} {quote} *ivy.xml:* {quote} {quote} *ivysettings.xml:* {quote} {quote} Here are the sequence of events which occur to cause this problem: - Code enters AbstractResolver.checkLatest(ResolvedModuleRevision, ResolveData), passing in the local artifact - Code returns artifact as latest since its the first one found - Code enters the checkLatest method again with the second (and newer by modification date) artifact - Code calls isAfter(newModuleFound, previousModuleFound, data.getDate()) - newModuleFound is the second artifact, newer by date - previousModuleFound is the first artifact, which is older - data.getDate() is null - isAfter() creates an array [ newModuleFound, previousModuleFound ] and passes that to LatestRevisionStrategy.findLatest() - findLatest() iterates over the array backwards - findLatest() states that it iterates backwards because, and I quote: "the latest revision comes last, use a ListIterator to iterate the sorted list in the reverse direction.". Now, this is incorrect in my case since the array passed in clearly has the newer module found (the jar with the newer modification date) in slot 0 - findLatest() returns the older revision artifact because the assumptions it makes about the array are wrong I hope that makes sense. If there's anything else that you need to replicate this problem, please let me know. Thank you, - Juliano DeCarvalho -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.