Author: maartenc Date: Wed Jan 14 13:22:01 2009 New Revision: 734517 URL: http://svn.apache.org/viewvc?rev=734517&view=rev Log: FIX: Ivy deliver fails to replace dynamic revision (IVY-999) (thanks to Martin Eigenbrodt)
Added: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ivy-999.xml (with props) ant/ivy/core/trunk/test/repositories/IVY-999/ ant/ivy/core/trunk/test/repositories/IVY-999/ivysettings.xml (with props) ant/ivy/core/trunk/test/repositories/IVY-999/junit/ ant/ivy/core/trunk/test/repositories/IVY-999/junit/junit/ ant/ivy/core/trunk/test/repositories/IVY-999/junit/junit/ivy-3.8.xml (with props) ant/ivy/core/trunk/test/repositories/IVY-999/junit/junit/ivy-4.4.xml (with props) ant/ivy/core/trunk/test/repositories/IVY-999/test/ ant/ivy/core/trunk/test/repositories/IVY-999/test/a/ ant/ivy/core/trunk/test/repositories/IVY-999/test/a/ivy-1.xml (with props) ant/ivy/core/trunk/test/repositories/IVY-999/test/b/ ant/ivy/core/trunk/test/repositories/IVY-999/test/b/ivy-1.5.xml (with props) Modified: ant/ivy/core/trunk/CHANGES.txt ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestConflictManager.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=734517&r1=734516&r2=734517&view=diff ============================================================================== --- ant/ivy/core/trunk/CHANGES.txt (original) +++ ant/ivy/core/trunk/CHANGES.txt Wed Jan 14 13:22:01 2009 @@ -27,6 +27,7 @@ Kristian Cibulskis Andrea Bernardo Ciddio Archie Cobbs + Martin Eigenbrodt Danno Ferrin Benjamin Francisoud Jacob Grydholt Jensen @@ -89,6 +90,7 @@ - FIX: Listing of URL's under a given URL does not handle fully specified URL's (IVY-959) (thanks to Randy Nott) - FIX: <ivy:buildnumber> returns wrong result when resolve fails (IVY-970) - FIX: listing possible token values doesn't work properly for the ibiblio resolver +- FIX: Ivy deliver fails to replace dynamic revision (IVY-999) (thanks to Martin Eigenbrodt) 2.0.0 ===================================== Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java?rev=734517&r1=734516&r2=734517&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java Wed Jan 14 13:22:01 2009 @@ -1169,6 +1169,7 @@ public ConflictManager getDefaultConflictManager() { if (defaultConflictManager == null) { defaultConflictManager = new LatestConflictManager(getDefaultLatestStrategy()); + ((LatestConflictManager) defaultConflictManager).setSettings(this); } return defaultConflictManager; } Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestConflictManager.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestConflictManager.java?rev=734517&r1=734516&r2=734517&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestConflictManager.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestConflictManager.java Wed Jan 14 13:22:01 2009 @@ -24,6 +24,7 @@ import java.util.List; import org.apache.ivy.core.module.descriptor.DependencyDescriptor; +import org.apache.ivy.core.module.id.ModuleRevisionId; import org.apache.ivy.core.resolve.IvyNode; import org.apache.ivy.plugins.latest.ArtifactInfo; import org.apache.ivy.plugins.latest.LatestStrategy; @@ -89,6 +90,20 @@ return Collections.singleton(node); } } + + /* + * If the list of conflicts contains dynamic revisions, delay the conflict + * calculation until they are resolved. + * TODO: we probably could already evict some of the dynamic revisions! + */ + for (Iterator iter = conflicts.iterator(); iter.hasNext();) { + IvyNode node = (IvyNode) iter.next(); + ModuleRevisionId modRev = node.getResolvedId(); + if (getSettings().getVersionMatcher().isDynamic(modRev)) { + return null; + } + } + try { IvyNodeArtifactInfo latest = (IvyNodeArtifactInfo) getStrategy().findLatest(toArtifactInfo(conflicts), null); 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=734517&r1=734516&r2=734517&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 Wed Jan 14 13:22:01 2009 @@ -18,6 +18,7 @@ package org.apache.ivy.core.resolve; import java.io.File; +import java.io.FileInputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -25,8 +26,10 @@ import java.util.Date; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Properties; import java.util.Set; import javax.xml.parsers.SAXParser; @@ -3088,6 +3091,19 @@ .exists()); } + public void testIVY999() throws Exception { + Ivy ivy = new Ivy(); + ivy.configure(new File("test/repositories/ivy-999/ivysettings.xml")); + ivy.getSettings().setDefaultCache(cache); + + ResolveReport rr = ivy.resolve(ResolveTest.class.getResource("ivy-999.xml"), getResolveOptions(new String[] {"*"})); + ConfigurationResolveReport crr = rr.getConfigurationReport("default"); + Set modRevIds = crr.getModuleRevisionIds(); + + assertTrue(modRevIds.contains(ModuleRevisionId.newInstance("junit", "junit", "4.4"))); + assertFalse(modRevIds.contains(ModuleRevisionId.newInstance("junit", "junit", "3.8"))); + } + public void testBadFiles() throws Exception { Ivy ivy = new Ivy(); ivy.configure(new File("test/repositories/badfile/ivysettings.xml")); Added: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ivy-999.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ivy-999.xml?rev=734517&view=auto ============================================================================== --- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ivy-999.xml (added) +++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ivy-999.xml Wed Jan 14 13:22:01 2009 @@ -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="apache" module="IVY-999" revision="1.0"/> + <dependencies> + <dependency org="test" name="a" rev="latest.integration"/> + <dependency org="test" name="b" rev="latest.integration"/> + <dependency org="junit" name="junit" rev="latest.integration"/> + </dependencies> +</ivy-module> Propchange: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ivy-999.xml ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ant/ivy/core/trunk/test/repositories/IVY-999/ivysettings.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/IVY-999/ivysettings.xml?rev=734517&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/IVY-999/ivysettings.xml (added) +++ ant/ivy/core/trunk/test/repositories/IVY-999/ivysettings.xml Wed Jan 14 13:22:01 2009 @@ -0,0 +1,27 @@ +<!-- + 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. +--> +<ivysettings> + <settings defaultResolver="local" /> + <resolvers> + <filesystem name="local" > + <ivy pattern="${ivy.settings.dir}/[organisation]/[module]/ivy-[revision].xml"/> + <artifact pattern="${ivy.settings.dir}/[organisation]/[module]/[artifact]-[revision].[ext]"/> + </filesystem> + </resolvers> +</ivysettings> Propchange: ant/ivy/core/trunk/test/repositories/IVY-999/ivysettings.xml ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ant/ivy/core/trunk/test/repositories/IVY-999/junit/junit/ivy-3.8.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/IVY-999/junit/junit/ivy-3.8.xml?rev=734517&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/IVY-999/junit/junit/ivy-3.8.xml (added) +++ ant/ivy/core/trunk/test/repositories/IVY-999/junit/junit/ivy-3.8.xml Wed Jan 14 13:22:01 2009 @@ -0,0 +1,22 @@ +<!-- + 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="junit" module="junit" revision="3.8" status="integration" publication="20090108103716"/> + <publications/> +</ivy-module> Propchange: ant/ivy/core/trunk/test/repositories/IVY-999/junit/junit/ivy-3.8.xml ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ant/ivy/core/trunk/test/repositories/IVY-999/junit/junit/ivy-4.4.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/IVY-999/junit/junit/ivy-4.4.xml?rev=734517&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/IVY-999/junit/junit/ivy-4.4.xml (added) +++ ant/ivy/core/trunk/test/repositories/IVY-999/junit/junit/ivy-4.4.xml Wed Jan 14 13:22:01 2009 @@ -0,0 +1,22 @@ +<!-- + 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="junit" module="junit" revision="4.4" status="integration" publication="20090108103715"/> + <publications/> +</ivy-module> Propchange: ant/ivy/core/trunk/test/repositories/IVY-999/junit/junit/ivy-4.4.xml ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ant/ivy/core/trunk/test/repositories/IVY-999/test/a/ivy-1.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/IVY-999/test/a/ivy-1.xml?rev=734517&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/IVY-999/test/a/ivy-1.xml (added) +++ ant/ivy/core/trunk/test/repositories/IVY-999/test/a/ivy-1.xml Wed Jan 14 13:22:01 2009 @@ -0,0 +1,25 @@ +<!-- + 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.4"> + <info organisation="test" module="a" revision="1" status="integration" publication="20090108103716"/> + <publications/> + <dependencies> + <dependency org="junit" name="junit" rev="4.4"/> + </dependencies> +</ivy-module> Propchange: ant/ivy/core/trunk/test/repositories/IVY-999/test/a/ivy-1.xml ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ant/ivy/core/trunk/test/repositories/IVY-999/test/b/ivy-1.5.xml URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/repositories/IVY-999/test/b/ivy-1.5.xml?rev=734517&view=auto ============================================================================== --- ant/ivy/core/trunk/test/repositories/IVY-999/test/b/ivy-1.5.xml (added) +++ ant/ivy/core/trunk/test/repositories/IVY-999/test/b/ivy-1.5.xml Wed Jan 14 13:22:01 2009 @@ -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="test" module="b" revision="1.5" status="integration" publication="20090108103716"/> + <!-- uispec4j --> + <publications/> + <dependencies> + <dependency org="junit" name="junit" rev="3.8+" conf="default"/> + </dependencies> +</ivy-module> Propchange: ant/ivy/core/trunk/test/repositories/IVY-999/test/b/ivy-1.5.xml ------------------------------------------------------------------------------ svn:mime-type = text/plain