You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by xa...@apache.org on 2008/04/05 10:56:54 UTC
svn commit: r645050 - in /ant/ivy/core/trunk: ./
src/java/org/apache/ivy/core/resolve/
test/java/org/apache/ivy/core/resolve/ test/repositories/2/mod5.1/
test/repositories/2/mod6.1/
Author: xavier
Date: Sat Apr 5 01:56:51 2008
New Revision: 645050
URL: http://svn.apache.org/viewvc?rev=645050&view=rev
Log:
FIX: Ivy uses the first set of configurations it sees when resolving multiple versions of a module (IVY-681)
Added:
ant/ivy/core/trunk/test/repositories/2/mod5.1/art51A-4.3.jar (with props)
ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.3.xml (with props)
ant/ivy/core/trunk/test/repositories/2/mod6.1/ivy-1.4.xml (with props)
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/VisitNode.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=645050&r1=645049&r2=645050&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Sat Apr 5 01:56:51 2008
@@ -78,6 +78,7 @@
- IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more semantically correct name (IVY-297)
- IMPROVEMENT: Smarter determination if an expression is exact or not for RegexpPatternMatcher and GlobPatternMatcher
+- FIX: Ivy uses the first set of configurations it sees when resolving multiple versions of a module (IVY-681)
- FIX: Eviction fails for libs not providing their ivy configuration and providing artifacts named different between lib versions (IVY-537)
- FIX: Memory leak in ModuleRevisionId.java (IVY-791)
- FIX: conflict manager scoping does not work as expected (IVY-465)
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=645050&r1=645049&r2=645050&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 Sat Apr 5 01:56:51 2008
@@ -386,7 +386,11 @@
Configuration c = md.getConfiguration(confs[i]);
if (c == null) {
confsToFetch.remove(conf);
- if (!conf.equals(confs[i])) {
+ if (isConfRequiredByMergedUsageOnly(rootModuleConf, conf)) {
+ Message.verbose(
+ "configuration required by evicted revision is not available in "
+ + "selected revision. skipping " + conf + " in " + this);
+ } else if (!conf.equals(confs[i])) {
problem = new RuntimeException("configuration(s) not found in " + this
+ ": " + conf + ". Missing configuration: " + confs[i]
+ ". It was required from " + parent + " " + parentConf);
@@ -399,8 +403,14 @@
} else if (shouldBePublic && !isRoot()
&& c.getVisibility() != Configuration.Visibility.PUBLIC) {
confsToFetch.remove(conf);
- problem = new RuntimeException("configuration not public in " + this + ": " + c
- + ". It was required from " + parent + " " + parentConf);
+ if (isConfRequiredByMergedUsageOnly(rootModuleConf, conf)) {
+ Message.verbose(
+ "configuration required by evicted revision is not visible in "
+ + "selected revision. skipping " + conf + " in " + this);
+ } else {
+ problem = new RuntimeException("configuration not public in " + this + ": "
+ + c + ". It was required from " + parent + " " + parentConf);
+ }
return false;
}
if (loaded) {
@@ -521,6 +531,11 @@
addAllIfNotNull(depConfs, usage.getConfigurations(rootModuleConf));
}
return (String[]) depConfs.toArray(new String[depConfs.size()]);
+ }
+
+ protected boolean isConfRequiredByMergedUsageOnly(String rootModuleConf, String conf) {
+ Set confs = usage.getConfigurations(rootModuleConf);
+ return confs == null || !confs.contains(conf);
}
//This is never called. Could we remove it?
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java?rev=645050&r1=645049&r2=645050&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java Sat Apr 5 01:56:51 2008
@@ -656,10 +656,12 @@
private void doFetchDependencies(VisitNode node, String conf) {
Configuration c = node.getConfiguration(conf);
if (c == null) {
- Message.warn("configuration not found '" + conf + "' in " + node.getResolvedId()
- + ": ignoring");
- if (node.getParent() != null) {
- Message.warn("it was required from " + node.getParent().getResolvedId());
+ if (!node.isConfRequiredByMergedUsageOnly(conf)) {
+ Message.warn("configuration not found '" + conf + "' in " + node.getResolvedId()
+ + ": ignoring");
+ if (node.getParent() != null) {
+ Message.warn("it was required from " + node.getParent().getResolvedId());
+ }
}
return;
}
Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/VisitNode.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/VisitNode.java?rev=645050&r1=645049&r2=645050&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/VisitNode.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/VisitNode.java Sat Apr 5 01:56:51 2008
@@ -473,4 +473,8 @@
return node.toString();
}
+ public boolean isConfRequiredByMergedUsageOnly(String conf) {
+ return node.isConfRequiredByMergedUsageOnly(rootModuleConf, conf);
+ }
+
}
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=645050&r1=645049&r2=645050&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 Sat Apr 5 01:56:51 2008
@@ -1958,6 +1958,33 @@
assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.0", "art51B", "jar", "jar").exists());
}
+ public void testEvictWithConf3() throws Exception {
+ // same as first one but the conf requested in evicted module is no longer present in
+ // selected revision
+ // test case for IVY-681
+
+ // mod6.1 r1.4 depends on
+ // mod5.1 r4.3 conf A
+ // mod5.2 r1.0 which depends on mod5.1 r4.0 conf B
+ //
+ // mod5.1 r4.3 has only conf A, not B
+ ResolveReport report = ivy.resolve(new File("test/repositories/2/mod6.1/ivy-1.4.xml")
+ .toURL(), 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.0")).exists());
+ assertTrue(getArchiveFileInCache("org5", "mod5.2", "1.0", "mod5.2", "jar", "jar").exists());
+
+ assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.0", "art51A", "jar", "jar").exists());
+ assertFalse(getArchiveFileInCache("org5", "mod5.1", "4.0", "art51B", "jar", "jar").exists());
+ }
+
public void testEvictWithConfInMultiConf() throws Exception {
// same as preceding ones but the conflict appears in several root confs
// bug 105 - test #3
Added: ant/ivy/core/trunk/test/repositories/2/mod5.1/art51A-4.3.jar
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod5.1/art51A-4.3.jar?rev=645050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ant/ivy/core/trunk/test/repositories/2/mod5.1/art51A-4.3.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.3.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.3.xml?rev=645050&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.3.xml (added)
+++ ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.3.xml Sat Apr 5 01:56:51 2008
@@ -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="org5"
+ module="mod5.1"
+ revision="4.3"
+ status="integration"
+ publication="20070401110000"
+ />
+ <configurations>
+ <conf name="A"/>
+ </configurations>
+ <publications>
+ <artifact name="art51A" type="jar" conf="A"/>
+ </publications>
+</ivy-module>
Propchange: ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.3.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ant/ivy/core/trunk/test/repositories/2/mod5.1/ivy-4.3.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: ant/ivy/core/trunk/test/repositories/2/mod6.1/ivy-1.4.xml
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/2/mod6.1/ivy-1.4.xml?rev=645050&view=auto
==============================================================================
--- ant/ivy/core/trunk/test/repositories/2/mod6.1/ivy-1.4.xml (added)
+++ ant/ivy/core/trunk/test/repositories/2/mod6.1/ivy-1.4.xml Sat Apr 5 01:56:51 2008
@@ -0,0 +1,30 @@
+<!--
+ 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="org6"
+ module="mod6.1"
+ revision="1.4"
+ status="integration"
+ publication="20070401110000"
+ />
+ <dependencies>
+ <dependency org="org5" name="mod5.1" rev="4.3" conf="default->A"/>
+ <dependency org="org5" name="mod5.2" rev="1.0" conf="default"/>
+ </dependencies>
+</ivy-module>
Propchange: ant/ivy/core/trunk/test/repositories/2/mod6.1/ivy-1.4.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ant/ivy/core/trunk/test/repositories/2/mod6.1/ivy-1.4.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain