Author: maartenc
Date: Sun Oct 25 21:44:16 2009
New Revision: 829662
URL: http://svn.apache.org/viewvc?rev=829662&view=rev
Log:
FIX: <override> ignored in dynamic resolve mode (IVY-1131)
Added:
ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/ivys/ivy-0.6.xml (with
props)
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java
ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
Modified: ant/ivy/core/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=829662&r1=829661&r2=829662&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Sun Oct 25 21:44:16 2009
@@ -97,6 +97,7 @@
- IMPROVEMENT: Trace a message when a property file referenced from the
settings doesn't exixts (IVY-1074)
- IMPROVEMENT: use defaultconf in combination with defaultconfmapping
(IVY-1135) (thanks to Jon Schneider)
+- FIX: <override> ignored in dynamic resolve mode (IVY-1131)
- FIX: IvyNodeEviction.cleanEvicted has bad comparison logic (IVY-1118)
- FIX: ChainResolver doesn't pass the specified 'checkmodified' attribute to
the cache (IVY-1133)
- FIX: Ivy couldn't handle maven POMs that depend on theirselves
Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java?rev=829662&r1=829661&r2=829662&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java
Sun Oct 25 21:44:16 2009
@@ -214,10 +214,12 @@
public DependencyDescriptor mediate(DependencyDescriptor dd) {
+ DependencyDescriptor originalDD = dd;
+ dd = getEngine().mediate(dd, getOptions());
+
VisitNode current = getCurrentVisitNode();
if (current != null) {
// mediating dd through dependers stack
- DependencyDescriptor originalDD = dd;
List dependers = new ArrayList(current.getPath());
// the returned path contains the currently visited node, we are
only interested in
// the dependers, so we remove the currently visted node from the
end
@@ -231,12 +233,14 @@
dd = md.mediate(dd);
}
}
- if (originalDD != dd) {
- Message.verbose("dependency descriptor has been mediated: "
- + originalDD + " => " + dd);
- }
}
- return getEngine().mediate(dd, getOptions());
+
+ if (originalDD != dd) {
+ Message.verbose("dependency descriptor has been mediated: "
+ + originalDD + " => " + dd);
+ }
+
+ return dd;
}
/**
Modified:
ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java?rev=829662&r1=829661&r2=829662&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
(original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
Sun Oct 25 21:44:16 2009
@@ -1654,6 +1654,55 @@
assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2",
"jar", "jar").exists());
}
+ public void testResolveTransitiveDependenciesWithOverride() throws
Exception {
+ // mod2.1 depends on mod1.1 which depends on mod1.2
+ ResolveReport report = ivy.resolve(new File(
+ "test/repositories/1/org2/mod2.1/ivys/ivy-0.6.xml").toURL(),
+ getResolveOptions(new String[] {"*"}));
+ assertNotNull(report);
+ ModuleDescriptor md = report.getModuleDescriptor();
+ assertNotNull(md);
+ ModuleRevisionId mrid = ModuleRevisionId.newInstance("org2", "mod2.1",
"0.6");
+ assertEquals(mrid, md.getModuleRevisionId());
+
+ assertTrue(getResolvedIvyFileInCache(mrid).exists());
+
+ // dependencies
+ assertTrue(getIvyFileInCache(
+ ModuleRevisionId.newInstance("org1", "mod1.1", "1.0")).exists());
+ assertTrue(getArchiveFileInCache("org1", "mod1.1", "1.0", "mod1.1",
"jar", "jar").exists());
+
+ assertTrue(getIvyFileInCache(
+ ModuleRevisionId.newInstance("org1", "mod1.2", "1.0")).exists());
+ assertTrue(getArchiveFileInCache("org1", "mod1.2", "1.0", "mod1.2",
"jar", "jar").exists());
+ }
+
+ /**
+ * Testcase for IVY-1131.
+ */
+ public void
testResolveTransitiveDependenciesWithOverrideAndDynamicResolveMode() throws
Exception {
+ // mod2.1 depends on mod1.1 which depends on mod1.2
+ ResolveReport report = ivy.resolve(new File(
+ "test/repositories/1/org2/mod2.1/ivys/ivy-0.6.xml").toURL(),
+ getResolveOptions(new String[]
{"*"}).setResolveMode(ResolveOptions.RESOLVEMODE_DYNAMIC));
+ assertNotNull(report);
+ ModuleDescriptor md = report.getModuleDescriptor();
+ assertNotNull(md);
+ ModuleRevisionId mrid = ModuleRevisionId.newInstance("org2", "mod2.1",
"0.6");
+ assertEquals(mrid, md.getModuleRevisionId());
+
+ assertTrue(getResolvedIvyFileInCache(mrid).exists());
+
+ // dependencies
+ assertTrue(getIvyFileInCache(
+ ModuleRevisionId.newInstance("org1", "mod1.1", "1.0")).exists());
+ assertTrue(getArchiveFileInCache("org1", "mod1.1", "1.0", "mod1.1",
"jar", "jar").exists());
+
+ assertTrue(getIvyFileInCache(
+ ModuleRevisionId.newInstance("org1", "mod1.2", "1.0")).exists());
+ assertTrue(getArchiveFileInCache("org1", "mod1.2", "1.0", "mod1.2",
"jar", "jar").exists());
+ }
+
public void testResolveTransitiveDisabled() throws Exception {
// mod2.1 depends on mod1.1 which depends on mod1.2
ResolveReport report = ivy.resolve(new File(
@@ -4828,5 +4877,4 @@
private ResolveOptions getResolveOptions(IvySettings settings, String[]
confs) {
return new ResolveOptions().setConfs(confs);
}
-
}
Added: ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/ivys/ivy-0.6.xml
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/ivys/ivy-0.6.xml?rev=829662&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/ivys/ivy-0.6.xml (added)
+++ ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/ivys/ivy-0.6.xml Sun Oct
25 21:44:16 2009
@@ -0,0 +1,34 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<ivy-module version="1.0">
+ <info organisation="org2"
+ module="mod2.1"
+ revision="0.6"
+ status="integration"
+ publication="20041101110000"
+ />
+ <publications>
+ <artifact name="art21A" type="jar"/>
+ <artifact name="art21B" type="jar"/>
+ </publications>
+ <dependencies>
+ <dependency org="org1" name="mod1.1" rev="1.0"/>
+ <override org="org1" module="mod1.2" rev="1.0"/>
+ </dependencies>
+</ivy-module>
Propchange: ant/ivy/core/trunk/test/repositories/1/org2/mod2.1/ivys/ivy-0.6.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain