Author: hibou
Date: Thu Oct 21 16:45:31 2010
New Revision: 1026063
URL: http://svn.apache.org/viewvc?rev=1026063&view=rev
Log:
IVY-1240: a fix, and a unit test that doesn't test much unfortunately...
Added:
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/ivys/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/ivys/ivy-1.0.xml
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/jars/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/jars/mod1-1.0.jar
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/ivys/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/ivys/ivy-1.0.xml
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/jars/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/jars/mod2-1.0.jar
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/ivys/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/ivys/ivy-1.0.xml
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/jars/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/jars/mod3-1.0.jar
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/ivys/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/ivys/ivy-1.0.xml
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/jars/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/jars/mod31-1.0.jar
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/ivys/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/ivys/ivy-1.0.xml
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/jars/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/jars/mod32-1.0.jar
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/ivys/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/ivys/ivy-1.0.xml
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/jars/
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/jars/mod33-1.0.jar
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.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=1026063&r1=1026062&r2=1026063&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Thu Oct 21 16:45:31 2010
@@ -117,6 +117,7 @@ for detailed view of each issue, please
- FIX: Cached ivy.xml is invalid if the description contains the ampersand
entity (&) (IVY-1237)
- FIX: Couldn't authenticate against sites having the same address as the
proxy server (IVY-1234)
- FIX: OutOfMemoryError when uploading large files using commons-httpclient
(IVY-1197) (thanks to Torkild U. Resheim)
+- FIX: Only the last dependency descriptor is taken into account on the same
module (IVY-1240)
2.2.0
=====================================
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java?rev=1026063&r1=1026062&r2=1026063&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java Thu
Oct 21 16:45:31 2010
@@ -312,7 +312,7 @@ public class IvyNode implements Comparab
"impossible to get dependencies when data has not been
loaded");
}
DependencyDescriptor[] dds = md.getDependencies();
- Collection dependencies = new LinkedHashSet(); // it's important to
respect order
+ Map dependencies = new LinkedHashMap(); // it's important to respect
order
for (int i = 0; i < dds.length; i++) {
DependencyDescriptor dd = data.mediate(dds[i]);
String[] dependencyConfigurations =
dd.getDependencyConfigurations(conf, requestedConf);
@@ -328,9 +328,12 @@ public class IvyNode implements Comparab
Message.verbose("excluding " + dd + " in " + conf);
continue;
}
- IvyNode depNode = data.getNode(
- requestedDependencyRevisionId);
-
+
+ IvyNode depNode = (IvyNode)
dependencies.get(requestedDependencyRevisionId);
+ if (depNode == null) {
+ depNode = data.getNode(requestedDependencyRevisionId);
+ }
+
if (depNode == null) {
depNode = new IvyNode(data, this, dd);
} else {
@@ -349,9 +352,9 @@ public class IvyNode implements Comparab
depNode.usage.setRequiredConfs(this, conf, confs);
depNode.addCaller(rootModuleConf, this, conf, requestedConf,
dependencyConfigurations, dd);
- dependencies.add(depNode);
+ dependencies.put(requestedDependencyRevisionId, depNode);
}
- return dependencies;
+ return dependencies.values();
}
private void addDependencyDescriptor(IvyNode parent, DependencyDescriptor
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=1026063&r1=1026062&r2=1026063&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
Thu Oct 21 16:45:31 2010
@@ -3629,6 +3629,24 @@ public class ResolveTest extends TestCas
assertTrue(getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2",
"jar", "jar").exists());
}
+ public void testResolveMultipleSameDependency() throws Exception {
+ ResolveReport report = ivy.resolve(new
File("test/repositories/1/multiple-same-deps/mod1/ivys/ivy-1.0.xml").toURL(),
+ getResolveOptions(new String[] {"*"}));
+
+ assertTrue(getArchiveFileInCache("multiple-same-deps", "mod31", "1.0",
"mod31", "jar", "jar").exists());
+ assertTrue(getArchiveFileInCache("multiple-same-deps", "mod32", "1.0",
"mod32", "jar", "jar").exists());
+ assertTrue(getArchiveFileInCache("multiple-same-deps", "mod33", "1.0",
"mod33", "jar", "jar").exists());
+
+ ConfigurationResolveReport runtimeReport =
report.getConfigurationReport("runtime");
+
runtimeReport.getModuleRevisionIds().contains(ModuleRevisionId.parse("multiple-same-deps#mod31;1.0"));
+
runtimeReport.getModuleRevisionIds().contains(ModuleRevisionId.parse("multiple-same-deps#mod32;1.0"));
+
runtimeReport.getModuleRevisionIds().contains(ModuleRevisionId.parse("multiple-same-deps#mod33;1.0"));
+ ConfigurationResolveReport compileReport =
report.getConfigurationReport("compile");
+
runtimeReport.getModuleRevisionIds().contains(ModuleRevisionId.parse("multiple-same-deps#mod31;1.0"));
+
runtimeReport.getModuleRevisionIds().contains(ModuleRevisionId.parse("multiple-same-deps#mod32;1.0"));
+
runtimeReport.getModuleRevisionIds().contains(ModuleRevisionId.parse("multiple-same-deps#mod33;1.0"));
+ }
+
public void testResolveTransitiveExcludesSimple() throws Exception {
// mod2.5 depends on mod2.3 and excludes one artifact from mod2.1
// mod2.3 depends on mod2.1
Added:
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/ivys/ivy-1.0.xml
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/ivys/ivy-1.0.xml?rev=1026063&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/ivys/ivy-1.0.xml
(added)
+++
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/ivys/ivy-1.0.xml
Thu Oct 21 16:45:31 2010
@@ -0,0 +1,31 @@
+<!--
+ 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="multiple-same-deps" module="mod1" revision="1.0" />
+ <configurations>
+ <conf name="default" extends="war" />
+ <conf name="compile" />
+ <conf name="runtime" />
+ <conf name="test" extends="compile,runtime" />
+ <conf name="war" />
+ </configurations>
+ <dependencies>
+ <dependency org="multiple-same-deps" name="mod2" rev="1.0"
conf="compile,runtime->default" />
+ </dependencies>
+</ivy-module>
Added:
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/jars/mod1-1.0.jar
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/jars/mod1-1.0.jar?rev=1026063&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/jars/mod1-1.0.jar
(added)
+++
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod1/jars/mod1-1.0.jar
Thu Oct 21 16:45:31 2010
@@ -0,0 +1 @@
+.
\ No newline at end of file
Added:
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/ivys/ivy-1.0.xml
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/ivys/ivy-1.0.xml?rev=1026063&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/ivys/ivy-1.0.xml
(added)
+++
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/ivys/ivy-1.0.xml
Thu Oct 21 16:45:31 2010
@@ -0,0 +1,32 @@
+<!--
+ 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="multiple-same-deps" module="mod2" revision="1.0" />
+ <configurations>
+ <conf name="default" extends="runtime" />
+ <conf name="compile" />
+ <conf name="runtime" />
+ <conf name="test" extends="compile,runtime" />
+ </configurations>
+ <dependencies>
+ <dependency org="multiple-same-deps" name="mod3" rev="1.0"
conf="compile,runtime->conf1" />
+ <dependency org="multiple-same-deps" name="mod3" rev="1.0"
conf="compile,runtime->conf2" />
+ <dependency org="multiple-same-deps" name="mod3" rev="1.0"
conf="compile,runtime->conf3" />
+ </dependencies>
+</ivy-module>
Added:
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/jars/mod2-1.0.jar
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/jars/mod2-1.0.jar?rev=1026063&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/jars/mod2-1.0.jar
(added)
+++
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod2/jars/mod2-1.0.jar
Thu Oct 21 16:45:31 2010
@@ -0,0 +1 @@
+.
\ No newline at end of file
Added:
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/ivys/ivy-1.0.xml
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/ivys/ivy-1.0.xml?rev=1026063&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/ivys/ivy-1.0.xml
(added)
+++
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/ivys/ivy-1.0.xml
Thu Oct 21 16:45:31 2010
@@ -0,0 +1,33 @@
+<!--
+ 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="multiple-same-deps" module="mod3" revision="1.0" />
+ <configurations>
+ <conf name="default" />
+ <conf name="common" />
+ <conf name="conf1" extends="common" />
+ <conf name="conf2" extends="common" />
+ <conf name="conf3" extends="common" />
+ </configurations>
+ <dependencies>
+ <dependency org="multiple-same-deps" name="mod31" rev="1.0"
conf="conf1->default" />
+ <dependency org="multiple-same-deps" name="mod32" rev="1.0"
conf="conf2->default" />
+ <dependency org="multiple-same-deps" name="mod33" rev="1.0"
conf="conf3->default" />
+ </dependencies>
+</ivy-module>
Added:
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/jars/mod3-1.0.jar
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/jars/mod3-1.0.jar?rev=1026063&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/jars/mod3-1.0.jar
(added)
+++
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod3/jars/mod3-1.0.jar
Thu Oct 21 16:45:31 2010
@@ -0,0 +1 @@
+.
\ No newline at end of file
Added:
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/ivys/ivy-1.0.xml
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/ivys/ivy-1.0.xml?rev=1026063&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/ivys/ivy-1.0.xml
(added)
+++
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/ivys/ivy-1.0.xml
Thu Oct 21 16:45:31 2010
@@ -0,0 +1,26 @@
+<!--
+ 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="multiple-same-deps" module="mod31" revision="1.0" />
+ <configurations>
+ <conf name="default" />
+ </configurations>
+ <dependencies>
+ </dependencies>
+</ivy-module>
Added:
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/jars/mod31-1.0.jar
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/jars/mod31-1.0.jar?rev=1026063&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/jars/mod31-1.0.jar
(added)
+++
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod31/jars/mod31-1.0.jar
Thu Oct 21 16:45:31 2010
@@ -0,0 +1 @@
+.
\ No newline at end of file
Added:
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/ivys/ivy-1.0.xml
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/ivys/ivy-1.0.xml?rev=1026063&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/ivys/ivy-1.0.xml
(added)
+++
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/ivys/ivy-1.0.xml
Thu Oct 21 16:45:31 2010
@@ -0,0 +1,26 @@
+<!--
+ 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="multiple-same-deps" module="mod32" revision="1.0" />
+ <configurations>
+ <conf name="default" />
+ </configurations>
+ <dependencies>
+ </dependencies>
+</ivy-module>
Added:
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/jars/mod32-1.0.jar
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/jars/mod32-1.0.jar?rev=1026063&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/jars/mod32-1.0.jar
(added)
+++
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod32/jars/mod32-1.0.jar
Thu Oct 21 16:45:31 2010
@@ -0,0 +1 @@
+.
\ No newline at end of file
Added:
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/ivys/ivy-1.0.xml
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/ivys/ivy-1.0.xml?rev=1026063&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/ivys/ivy-1.0.xml
(added)
+++
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/ivys/ivy-1.0.xml
Thu Oct 21 16:45:31 2010
@@ -0,0 +1,26 @@
+<!--
+ 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="multiple-same-deps" module="mod33" revision="1.0" />
+ <configurations>
+ <conf name="default" />
+ </configurations>
+ <dependencies>
+ </dependencies>
+</ivy-module>
Added:
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/jars/mod33-1.0.jar
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/jars/mod33-1.0.jar?rev=1026063&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/jars/mod33-1.0.jar
(added)
+++
ant/ivy/core/trunk/test/repositories/1/multiple-same-deps/mod33/jars/mod33-1.0.jar
Thu Oct 21 16:45:31 2010
@@ -0,0 +1 @@
+.
\ No newline at end of file