diff --git a/src/java/org/apache/ivy/core/resolve/IvyNode.java b/src/java/org/apache/ivy/core/resolve/IvyNode.java index 8fa19e07..23ba2f11 100644 --- a/src/java/org/apache/ivy/core/resolve/IvyNode.java +++ b/src/java/org/apache/ivy/core/resolve/IvyNode.java @@ -20,6 +20,7 @@ package org.apache.ivy.core.resolve; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; diff --git a/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java b/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java index 30a959c7..1f2cee3b 100644 --- a/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java +++ b/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java @@ -221,6 +221,10 @@ public abstract class BasicResolver extends AbstractResolver { } return null; } else { + long lastModified = artifactRef.getLastModified(); + if (lastModified != 0 && md instanceof DefaultModuleDescriptor) { + ((DefaultModuleDescriptor) md).setLastModified(lastModified); + } Message.verbose("\t"+getName()+": no ivy file found for "+mrid+": using default data"); logIvyNotFound(mrid); if (isDynamic) { diff --git a/test/java/org/apache/ivy/plugins/conflict/LatestConflictManagerTest.java b/test/java/org/apache/ivy/plugins/conflict/LatestConflictManagerTest.java index d7ec5cde..bbdeb6ed 100644 --- a/test/java/org/apache/ivy/plugins/conflict/LatestConflictManagerTest.java +++ b/test/java/org/apache/ivy/plugins/conflict/LatestConflictManagerTest.java @@ -30,15 +30,23 @@ import org.apache.ivy.core.report.ConfigurationResolveReport; import org.apache.ivy.core.report.ResolveReport; import org.apache.ivy.core.resolve.IvyNode; import org.apache.ivy.core.resolve.ResolveOptions; +import org.apache.ivy.util.FileUtil; public class LatestConflictManagerTest extends TestCase { private Ivy ivy; + private File _cache; protected void setUp() throws Exception { ivy = new Ivy(); ivy.configure(LatestConflictManagerTest.class .getResource("ivyconf-latest.xml")); + _cache = new File("build/cache"); + _cache.mkdirs(); + } + + protected void tearDown() throws Exception { + FileUtil.forceDelete(_cache); } // Test case for issue IVY-388 diff --git a/test/java/org/apache/ivy/plugins/conflict/RegexpConflictManagerTest.java b/test/java/org/apache/ivy/plugins/conflict/RegexpConflictManagerTest.java index f7ef89fc..5189a4c3 100644 --- a/test/java/org/apache/ivy/plugins/conflict/RegexpConflictManagerTest.java +++ b/test/java/org/apache/ivy/plugins/conflict/RegexpConflictManagerTest.java @@ -21,23 +21,33 @@ package org.apache.ivy.plugins.conflict; * @author Anders janmyr */ +import java.io.File; + import junit.framework.TestCase; import org.apache.ivy.Ivy; import org.apache.ivy.core.cache.CacheManager; import org.apache.ivy.core.resolve.ResolveOptions; +import org.apache.ivy.util.FileUtil; public class RegexpConflictManagerTest extends TestCase { private Ivy ivy; + private File _cache; protected void setUp() throws Exception { ivy = new Ivy(); ivy.configure( RegexpConflictManagerTest.class .getResource( "ivyconf-regexp-test.xml" ) ); + _cache = new File("build/cache"); + _cache.mkdirs(); } + + protected void tearDown() throws Exception { + FileUtil.forceDelete(_cache); + } public void testNoApiConflictResolve() throws Exception { diff --git a/test/java/org/apache/ivy/plugins/conflict/StrictConflictManagerTest.java b/test/java/org/apache/ivy/plugins/conflict/StrictConflictManagerTest.java index 968481f1..5ef4504e 100644 --- a/test/java/org/apache/ivy/plugins/conflict/StrictConflictManagerTest.java +++ b/test/java/org/apache/ivy/plugins/conflict/StrictConflictManagerTest.java @@ -17,18 +17,29 @@ */ package org.apache.ivy.plugins.conflict; +import java.io.File; + import junit.framework.TestCase; import org.apache.ivy.Ivy; import org.apache.ivy.core.cache.CacheManager; import org.apache.ivy.core.resolve.ResolveOptions; +import org.apache.ivy.util.FileUtil; public class StrictConflictManagerTest extends TestCase { private Ivy ivy; + private File _cache; + protected void setUp() throws Exception { ivy = new Ivy(); ivy.configure(StrictConflictManagerTest.class.getResource("ivyconf-strict-test.xml")); + _cache = new File("build/cache"); + _cache.mkdirs(); } + + protected void tearDown() throws Exception { + FileUtil.forceDelete(_cache); + } public void testInitFromConf() throws Exception { ConflictManager cm = ivy.getSettings().getDefaultConflictManager(); diff --git a/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time-transitivity.xml b/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time-transitivity.xml index 3ab29c5f..59906826 100644 --- a/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time-transitivity.xml +++ b/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time-transitivity.xml @@ -1,6 +1,6 @@ - + diff --git a/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time.xml b/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time.xml index b2dd5eb7..a5aa6842 100644 --- a/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time.xml +++ b/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest-time.xml @@ -1,6 +1,6 @@ - + diff --git a/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest.xml b/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest.xml index d872ff97..87860d2e 100644 --- a/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest.xml +++ b/test/java/org/apache/ivy/plugins/conflict/ivyconf-latest.xml @@ -1,6 +1,6 @@ - + diff --git a/test/java/org/apache/ivy/plugins/conflict/ivyconf-regexp-test.xml b/test/java/org/apache/ivy/plugins/conflict/ivyconf-regexp-test.xml index 7f5b65c4..642a5c21 100644 --- a/test/java/org/apache/ivy/plugins/conflict/ivyconf-regexp-test.xml +++ b/test/java/org/apache/ivy/plugins/conflict/ivyconf-regexp-test.xml @@ -1,6 +1,7 @@ - diff --git a/test/java/org/apache/ivy/plugins/conflict/ivyconf-strict-test.xml b/test/java/org/apache/ivy/plugins/conflict/ivyconf-strict-test.xml index 189a405f..291ba68c 100644 --- a/test/java/org/apache/ivy/plugins/conflict/ivyconf-strict-test.xml +++ b/test/java/org/apache/ivy/plugins/conflict/ivyconf-strict-test.xml @@ -1,6 +1,7 @@ -