Details
Description
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 https://issues.apache.org/jira/browse/IVY-966 .
The ivy.xml of direct dependency to retrieve has:
<dependencies>
<dependency org="javax.mail" name="javamail" rev="[1.4,2.0[" conf="mail->default"/>
<dependency org="javax.jms" name="jms" rev="[1.1,2.0[" conf="jms->default"/>
<dependency org="javax.management" name="jmx" rev="[1.2.1,2.0[" conf="jmx->default,tools"/>
</dependencies>
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)
to try compare Infos for 1.2.1 and 2.0 for <dependency org="javax.management" name="jmx" rev="[1.2.1,2.0[" conf="jmx->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)
with
foundMrid javax.management#jmx;1.2.1
mRevId javax.management#jmx;2.0
Also it would be nice to have some tests for org.apache.ivy.plugins.latest.LatestTimeStrategy .