Index: test/java/org/apache/ivy/core/resolve/ResolveTest.java =================================================================== --- test/java/org/apache/ivy/core/resolve/ResolveTest.java (revision 1867376) +++ test/java/org/apache/ivy/core/resolve/ResolveTest.java (working copy) @@ -2313,6 +2313,34 @@ assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.0", "art51B", "jar", "jar").exists()); } + public void testEvictWithConf4() throws Exception { + // same as previous one but with inversed order + // test case for IVY-681 + + // mod6.1 r1.6 depends on + // mod5.1 r4.0 conf A + // mod5.2 r1.1 which depends on mod5.1 r4.3 conf A + // + // mod5.1 r4.3 has only conf A, not B + ResolveReport report = ivy.resolve(new File("test/repositories/2/mod6.1/ivy-1.6.xml"), + getResolveOptions(new String[] {"*"})); + assertFalse(report.hasError()); + + // dependencies + assertTrue( + getIvyFileInCache(ModuleRevisionId.newInstance("org5", "mod5.1", "4.3")).exists()); + assertTrue(getArchiveFileInCache("org5", "mod5.1", "4.3", "art51A", "jar", "jar").exists()); + + assertTrue( + getIvyFileInCache(ModuleRevisionId.newInstance("org5", "mod5.2", "1.1")).exists()); + assertTrue(getArchiveFileInCache("org5", "mod5.2", "1.1", "mod5.2", "jar", "jar").exists()); + + assertFalse( + getArchiveFileInCache("org5", "mod5.1", "4.0.1", "art51A", "jar", "jar").exists()); + assertFalse( + getArchiveFileInCache("org5", "mod5.1", "4.0.1", "art51B", "jar", "jar").exists()); + } + public void testFailWithMissingConf() throws Exception { // test case for IVY-861 Index: test/repositories/2/mod5.1/ivy-4.0.1.xml =================================================================== --- test/repositories/2/mod5.1/ivy-4.0.1.xml (revision 0) +++ test/repositories/2/mod5.1/ivy-4.0.1.xml (revision 0) @@ -0,0 +1,34 @@ + + + + + + + + + + + + Index: test/repositories/2/mod5.2/ivy-1.1.xml =================================================================== --- test/repositories/2/mod5.2/ivy-1.1.xml (revision 0) +++ test/repositories/2/mod5.2/ivy-1.1.xml (revision 0) @@ -0,0 +1,29 @@ + + + + + + + Index: test/repositories/2/mod6.1/ivy-1.6.xml =================================================================== --- test/repositories/2/mod6.1/ivy-1.6.xml (revision 0) +++ test/repositories/2/mod6.1/ivy-1.6.xml (revision 0) @@ -0,0 +1,30 @@ + + + + + + + +