ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "K. Rekk (JIRA)" <>
Subject [jira] Created: (IVY-993) latest-time strategy not compatible with version ranges in transitiv dependencies
Date Tue, 06 Jan 2009 17:12:44 GMT
latest-time strategy not compatible with version ranges in transitiv dependencies

                 Key: IVY-993
             Project: Ivy
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0-RC2
         Environment: kubuntu 8.04, java 1.6, ant 1.7
            Reporter: K. Rekk

Using latest-time as defaultLatestStrategy="latest-time" would give errors on first level
transitiv dependency. Default strategy would do fine. It seems to be a similar problem as
in .

The ivy.xml of direct dependency to retrieve has:
        <dependency org="javax.mail" name="javamail" rev="[1.4,2.0[" conf="mail-&gt;default"/>
        <dependency org="javax.jms" name="jms" rev="[1.1,2.0[" conf="jms-&gt;default"/>
        <dependency org="" name="jmx" rev="[1.2.1,2.0[" conf="jmx-&gt;default,tools"/>


Although I am far away from understanding what exactly is going on (some further developer
docs would be great), here my observations:

Watching debug shows that all this boils down to call :

public class LatestTimeStrategy extends ComparatorLatestStrategy {
    private static final Comparator COMPARATOR = new Comparator() {
        public int compare(Object o1, Object o2) {
            long d1 = ((ArtifactInfo) o1).getLastModified();
            long d2 = ((ArtifactInfo) o2).getLastModified();
            return new Long(d1).compareTo(new Long(d2));

to try compare Infos for 1.2.1 and 2.0  for <dependency org="" name="jmx"
rev="[1.2.1,2.0[" conf="jmx-&gt;default,tools"/> . But getLastModified will give 0.
So sorting will fail.

This interesting thing starts from VersionRangeMatcher

    private boolean isLower(ModuleRevisionId askedMrid, String revision,
            ModuleRevisionId foundMrid, boolean inclusive) {
        ModuleRevisionId mRevId = ModuleRevisionId.newInstance(askedMrid, revision);
        int result =, foundMrid);        
        return result <= (inclusive ? 0 : -1);



Also it would be nice to have some tests for org.apache.ivy.plugins.latest.LatestTimeStrategy

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message