diff --git a/CHANGES.txt b/CHANGES.txt index 29f0b28..c17b738 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -48,7 +48,7 @@ for detailed view of each issue, please consult http://issues.apache.org/jira/br John Gibson Mitch Gitman Scott Goldstein - Pierre Hägnestrand + Pierre H�gnestrand Scott Hebert Tobias Himstedt Aaron Hachez @@ -736,7 +736,7 @@ for detailed view of each issue, please consult http://issues.apache.org/jira/br - FIX: IOException during publish causes NullPointerException (IVY-371) - FIX: Comments in ivy.xml duplicated (IVY-336) (thanks to Gilles Scokart) - FIX: Ivy failure when the ivy.xml file contains non US-ASCII characters (IVY-346) (thanks to Gilles Scokart) -- FIX: Urlresolver is not possible to use dynamic revisions on nonstandard repository structure (IVY-350) (thanks to Pierre Hägnestrand) +- FIX: Urlresolver is not possible to use dynamic revisions on nonstandard repository structure (IVY-350) (thanks to Pierre H�gnestrand) version 1.4.1 - 2006-11-09 diff --git a/src/java/org/apache/ivy/core/settings/typedef.properties b/src/java/org/apache/ivy/core/settings/typedef.properties index b486b38..7305c55 100644 --- a/src/java/org/apache/ivy/core/settings/typedef.properties +++ b/src/java/org/apache/ivy/core/settings/typedef.properties @@ -63,3 +63,4 @@ cache = org.apache.ivy.core.cache.DefaultRepositoryCacheManager pgp = org.apache.ivy.plugins.signer.bouncycastle.OpenPGPSignatureGenerator osgi-manifest-parser = org.apache.ivy.osgi.core.OSGiManifestParser +cudf-parser = org.apache.ivy.plugins.parser.cudf.CUDFModuleDescriptorParser diff --git a/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java b/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java index 24f162e..1e5f113 100644 --- a/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java +++ b/src/java/org/apache/ivy/plugins/parser/ModuleDescriptorParserRegistry.java @@ -28,6 +28,7 @@ import java.util.List; import org.apache.ivy.core.module.descriptor.ModuleDescriptor; import org.apache.ivy.osgi.core.OSGiManifestParser; +import org.apache.ivy.plugins.parser.cudf.CUDFModuleDescriptorParser; import org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser; import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser; import org.apache.ivy.plugins.repository.Resource; diff --git a/src/java/org/apache/ivy/plugins/parser/cudf/CUDFModuleDescriptorParser.java b/src/java/org/apache/ivy/plugins/parser/cudf/CUDFModuleDescriptorParser.java new file mode 100644 index 0000000..f160f2e --- /dev/null +++ b/src/java/org/apache/ivy/plugins/parser/cudf/CUDFModuleDescriptorParser.java @@ -0,0 +1,156 @@ +/* + * 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. + */ + +package org.apache.ivy.plugins.parser.cudf; + +import org.apache.ivy.core.IvyContext; +import org.apache.ivy.core.module.descriptor.Artifact; +import org.apache.ivy.core.module.descriptor.Configuration; +import org.apache.ivy.core.module.descriptor.DefaultArtifact; +import org.apache.ivy.core.module.descriptor.DefaultDependencyArtifactDescriptor; +import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor; +import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor; +import org.apache.ivy.core.module.descriptor.DependencyArtifactDescriptor; +import org.apache.ivy.core.module.descriptor.ModuleDescriptor; +import org.apache.ivy.core.module.id.ModuleRevisionId; +import org.apache.ivy.core.resolve.ResolveData; +import org.apache.ivy.plugins.parser.ModuleDescriptorParser; +import org.apache.ivy.plugins.parser.ParserSettings; +import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorWriter; +import org.apache.ivy.plugins.repository.Resource; +import org.apache.ivy.plugins.repository.url.URLResource; +import org.apache.ivy.util.Message; +import org.apache.ivy.util.url.URLHandlerRegistry; + +import java.io.*; +import java.net.URL; +import java.text.ParseException; +import java.util.Date; +import java.util.List; + +/** + * CUDFModuleDescriptorParser + * + * @author Antoine ROUAZE + */ +public class CUDFModuleDescriptorParser implements ModuleDescriptorParser { + + private static final CUDFModuleDescriptorParser INSTANCE = new CUDFModuleDescriptorParser(); + + public static CUDFModuleDescriptorParser getInstance() { + return INSTANCE; + } + + public CUDFModuleDescriptorParser() { + } + + public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL descriptorURL, boolean validate) + throws ParseException, IOException { + URLResource resource = new URLResource(descriptorURL); + return parseDescriptor(ivySettings, descriptorURL, resource, validate); + } + + public ModuleDescriptor parseDescriptor(ParserSettings ivySettings, URL descriptorURL, Resource res, + boolean validate) throws ParseException, IOException { + IvyContext context = IvyContext.getContext(); + ResolveData resolveData = context.getResolveData(); + + CUDFParser parser = new CUDFParser(""); + List artifacts = parser.parse(URLHandlerRegistry.getDefault().openStream(descriptorURL)); + Artifact rootArtifact = (Artifact) artifacts.get(0); + DefaultModuleDescriptor moduleDescriptor = new DefaultModuleDescriptor(this, res); + moduleDescriptor.setResolvedPublicationDate(new Date(res.getLastModified())); + addConfigurations(resolveData.getCurrentVisitNode().getConfsToFetch(), moduleDescriptor); + moduleDescriptor.addArtifact("master", rootArtifact); + ModuleRevisionId moduleRevisionId = rootArtifact.getModuleRevisionId(); + for (int i = 1; i < artifacts.size(); i++) { + Artifact dep = (Artifact) artifacts.get(i); + DefaultDependencyDescriptor dependencyDescriptor = + new DefaultDependencyDescriptor(moduleDescriptor, dep.getModuleRevisionId(), true, false, true); + dependencyDescriptor.addDependencyConfiguration("master", "master(*)"); + DependencyArtifactDescriptor dependencyArtifactDescriptor = + new DefaultDependencyArtifactDescriptor(dependencyDescriptor, + dependencyDescriptor.getDependencyId().getName(), + dep.getType(), dep.getExt(), dep.getUrl(), + dep.getExtraAttributes() + ); + // TODO: verified scope name + dependencyDescriptor.addDependencyArtifact("master", dependencyArtifactDescriptor); + moduleDescriptor.addDependency(dependencyDescriptor); + // TODO found the current configuration name!!! + } + moduleDescriptor.setModuleRevisionId(moduleRevisionId); + return moduleDescriptor; + } + + private void addConfigurations(String[] cheatConfs, DefaultModuleDescriptor moduleDescriptor) { + moduleDescriptor.addConfiguration(new Configuration("master")); + for (int i = 0, cheatConfsLength = cheatConfs.length; i < cheatConfsLength; i++) { + String cheatConf = cheatConfs[i]; + moduleDescriptor.addConfiguration( + new Configuration(cheatConf, Configuration.Visibility.PUBLIC, "Parents conf", + new String[]{"master"}, false, null + ) + ); +// moduleDescriptor.addConfiguration(new Configuration(cheatConf)); + } + } + + public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md) + throws ParseException, IOException { + try { + XmlModuleDescriptorWriter.write(md, destFile); + } finally { + if (is != null) { + is.close(); + } + } + } + + public boolean accept(Resource res) { + BufferedReader reader = null; + try { + reader = new BufferedReader(new InputStreamReader(res.openStream())); + String preamble = reader.readLine(); + return preamble.startsWith("preamble:"); + } catch (IOException e) { + throw new RuntimeException("Unable to read resource named " + res.getName(), e); + } finally { + if (reader != null) { + try { + reader.close(); + } catch (IOException e) { + Message.warn("Unable to close stream resource"); + } + } + } + } + + public String getType() { + return "cudf"; + } + + public Artifact getMetadataArtifact(ModuleRevisionId mrid, Resource res) { + return new DefaultArtifact(mrid, new Date(res.getLastModified()), mrid.getName(), "cudf", "cudf", true); + } + + public String toString() { + return "CUDF parser"; + } +} diff --git a/src/java/org/apache/ivy/plugins/parser/cudf/CUDFParser.java b/src/java/org/apache/ivy/plugins/parser/cudf/CUDFParser.java new file mode 100644 index 0000000..1aa8b4f --- /dev/null +++ b/src/java/org/apache/ivy/plugins/parser/cudf/CUDFParser.java @@ -0,0 +1,149 @@ +/* + * 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. + */ +package org.apache.ivy.plugins.parser.cudf; + +import org.apache.ivy.core.module.descriptor.Artifact; +import org.apache.ivy.core.module.descriptor.DefaultArtifact; +import org.apache.ivy.core.module.id.ModuleRevisionId; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +/** + * @author Adrien Lecharpentier + */ +public class CUDFParser { + private static final String PACKAGE_START_LINE = "package: "; + + private static final String NUMBER_START_LINE = "number: "; + + private static final String SEPARATOR = "%3a"; + + private static final String TYPE_START_LINE = "type: "; + + private static final String VERSION_START_LINE = "version: "; + + private final String baseURL; + + public CUDFParser(String baseServerURL) { + this.baseURL = baseServerURL; + } + + /** + * Returns a list of Artifacts fetch from a CUDF formatted InputStream. + *

+ * The List returned will never be null but at worst it will be empty (contract). + * + * @param inputStream + * the stream to parse + * @return a list of Artifact that are all needed. The list will never be null but at worst an empty list. + * @throws MalformedURLException + * if the url in the cudf output is not correct. + */ + public List/**/ parse(InputStream inputStream) + throws MalformedURLException { + if (inputStream == null) { + throw new IllegalStateException(); + } + List artifacts = new ArrayList(); + BufferedReader reader = null; + try { + reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); + String next = reader.readLine(); + String packageLine = null; + String versionLine = null; + String typeLine = null; + String cudfVersion = null; + while (true) { + String line = next; + for (next = reader.readLine(); next != null && next.length() > 1 && next.charAt(0) == ' '; + next = reader.readLine()) { + line = line + next.substring(1); + } + + if (line == null || (line != null && line.length() == 0)) { + if (cudfVersion != null && !"0".equals( + versionLine.substring(VERSION_START_LINE.length()).trim() + )) { + validateArtifact(packageLine, versionLine, typeLine, artifacts); + } + packageLine = versionLine = typeLine = cudfVersion = null; + if (line == null) { + break; + } + } + + if (line.startsWith("#") || line.startsWith("preamble:") || line.startsWith("property: ") + || line.startsWith("univ-checksum: ") || (line.length() > 0 && line.charAt(0) == ' ')) { + continue; + } + + line = line.trim(); + if (line.startsWith(PACKAGE_START_LINE)) { + packageLine = line; + } else if (line.startsWith(NUMBER_START_LINE)) { + versionLine = line; + } else if (line.startsWith(TYPE_START_LINE)) { + typeLine = line; + } else if (line.startsWith(VERSION_START_LINE)) { + cudfVersion = line; + } + } + } catch (MalformedURLException e) { + throw e; + } catch (IOException e) { + return Collections.emptyList(); + } finally { + if (reader != null) { + try { + reader.close(); + } catch (IOException e) { + return Collections.emptyList(); + } + } + } + return artifacts; + } + + private void validateArtifact(String packageLine, String versionLine, String typeLine, List artifacts) + throws MalformedURLException { + if (packageLine == null || versionLine == null) { + return; + } + String strPackage = packageLine.substring(PACKAGE_START_LINE.length()).trim(); + if (!strPackage.contains(SEPARATOR)) { + throw new IllegalArgumentException("The line \"package\" must have a colon separator to " + + "differentiate the organization and the name"); + } + String[] info = packageLine.substring(PACKAGE_START_LINE.length()).trim().split(SEPARATOR); + String version = versionLine.substring(NUMBER_START_LINE.length()).trim(); + String type = typeLine == null || typeLine.isEmpty() ? "jar" : typeLine.substring(TYPE_START_LINE.length()).trim(); + Artifact artifact = + new DefaultArtifact(ModuleRevisionId.newInstance(info[0], info[1], version), new Date(), info[1], + type, type); + artifacts.add(artifact); + } +} diff --git a/test/java/org/apache/ivy/core/resolve/ResolveTest.java b/test/java/org/apache/ivy/core/resolve/ResolveTest.java index 183cf02..e22ff3b 100644 --- a/test/java/org/apache/ivy/core/resolve/ResolveTest.java +++ b/test/java/org/apache/ivy/core/resolve/ResolveTest.java @@ -17,25 +17,7 @@ */ package org.apache.ivy.core.resolve; -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - import junit.framework.TestCase; - import org.apache.ivy.Ivy; import org.apache.ivy.TestHelper; import org.apache.ivy.core.cache.ArtifactOrigin; @@ -66,12 +48,30 @@ import org.apache.ivy.plugins.resolver.DependencyResolver; import org.apache.ivy.plugins.resolver.DualResolver; import org.apache.ivy.plugins.resolver.FileSystemResolver; import org.apache.ivy.util.CacheCleaner; +import org.apache.ivy.util.DefaultMessageLogger; import org.apache.ivy.util.FileUtil; +import org.apache.ivy.util.Message; import org.apache.ivy.util.MockMessageLogger; import org.apache.ivy.util.StringUtils; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * */ @@ -4330,7 +4330,7 @@ public class ResolveTest extends TestCase { assertTrue(getArchiveFileInCache(ivy, "org.apache", "test-classifier", "1.0", "test-classifier", "jar", "jar").exists()); } - + public void testResolveMaven2ParentPomChainResolver() throws Exception { // test has a dependency on test2 but there is no version listed. test has a parent of parent(2.0) // then parent2. Both parents have a dependencyManagement element for test2, and each list the version as diff --git a/test/java/org/apache/ivy/plugins/parser/cudf/CUDFParserTest.java b/test/java/org/apache/ivy/plugins/parser/cudf/CUDFParserTest.java new file mode 100644 index 0000000..568b545 --- /dev/null +++ b/test/java/org/apache/ivy/plugins/parser/cudf/CUDFParserTest.java @@ -0,0 +1,76 @@ +/* + * 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. + */ +package org.apache.ivy.plugins.parser.cudf; + +import junit.framework.TestCase; +import org.apache.ivy.core.module.descriptor.Artifact; +import org.apache.ivy.core.module.id.ModuleRevisionId; + +import java.net.MalformedURLException; +import java.util.List; + +/** + * @author Adrien Lecharpentier + * @since 2012-04-23 15:21 + */ +public class CUDFParserTest extends TestCase { + + private CUDFParser parser; + + public void setUp() throws Exception { + parser = new CUDFParser(""); + } + + public void testParser() throws MalformedURLException { + List artifacts = parser.parse( + this.getClass().getResourceAsStream("/org/apache/ivy/plugins/resolver/util/testdownload.cudf")); + assertEquals(3, artifacts.size()); + for (int i = 0; i < artifacts.size(); i++) { + assertNotNull("Error: an null artifact is in the list.", artifacts.get(i)); + Artifact artifact = (Artifact) artifacts.get(i); + assertArtifactIsValid(artifact); + } + } + + private void assertArtifactIsValid(Artifact artifact) { + assertNotNull("Error: the name of the artifact is null", artifact.getName()); + assertNotNull("Error: the type of the artifact is null", artifact.getType()); + assertNotNull("Error: the module revision id of the artifact is null", artifact.getModuleRevisionId()); + ModuleRevisionId moduleRevisionId = artifact.getModuleRevisionId(); + assertNotNull("Error: the organisation name of the module revision id is null", + moduleRevisionId.getOrganisation()); + assertNotNull("Error: the name of the module revision id is null", moduleRevisionId.getName()); + assertNotNull("Error: the version of the module revision id null", moduleRevisionId.getRevision()); + } + + public void testEmptyCUFDParsing() throws MalformedURLException { + List artifacts = + parser.parse(this.getClass().getResourceAsStream("/org/apache/ivy/plugins/resolver/util/empty.cudf")); + assertTrue(artifacts.isEmpty()); + } + + public void testNullResourceParsing() throws MalformedURLException { + try { + parser.parse(null); + fail("Give a null parameter should've thrown an exception"); + } catch (IllegalStateException e) { + + } + } +} diff --git a/test/java/org/apache/ivy/plugins/resolver/CUDFIntegrationTest.java b/test/java/org/apache/ivy/plugins/resolver/CUDFIntegrationTest.java new file mode 100644 index 0000000..cab0922 --- /dev/null +++ b/test/java/org/apache/ivy/plugins/resolver/CUDFIntegrationTest.java @@ -0,0 +1,85 @@ +/* + * 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. + */ +package org.apache.ivy.plugins.resolver; + +import junit.framework.TestCase; +import org.apache.ivy.Ivy; +import org.apache.ivy.core.report.ResolveReport; +import org.apache.ivy.core.settings.IvySettings; +import org.apache.ivy.util.CacheCleaner; +import org.apache.ivy.util.DefaultMessageLogger; +import org.apache.ivy.util.FileUtil; +import org.apache.ivy.util.Message; + +import java.io.File; + +/** + * @author Antoine ROUAZE + */ +public class CUDFIntegrationTest extends TestCase { + + private Ivy ivy; + + private File cache; + + protected void setUp() throws Exception { + cache = new File("build/cache"); + System.setProperty("ivy.cache.dir", cache.getAbsolutePath()); + createCache(); + + ivy = Ivy.newInstance(); + } + + private void createCache() { + cache.mkdirs(); + } + + protected void tearDown() throws Exception { + CacheCleaner.deleteDir(cache); + } + + public void testCUDFIntegration() throws Exception{ + ivy.configure(new File("test/test-cudf/ivysettings.xml")); + ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_DEBUG)); + ResolveReport report = ivy.resolve(new File("test/test-cudf/ivy.xml")); + assertEquals(4, report.getArtifacts().size()); + } + + public void testCUDFIntegrationWithoutUrl() throws Exception { + ivy.configure(new File("test/test-cudf/ivysettings-without-url.xml")); + ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_DEBUG)); + ResolveReport report = ivy.resolve(new File("test/test-cudf/ivy.xml")); + assertEquals(report.getArtifacts().size(), 4); + } + + public void testCUDFCacheIntegration() throws Exception{ + ivy.configure(new File("test/test-cudf/ivysettings.xml")); + ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_DEBUG)); + ResolveReport report = ivy.resolve(new File("test/test-cudf/ivy.xml")); + assertTrue(report.getDownloadSize() > 0); + ResolveReport report1 = ivy.resolve(new File("test/test-cudf/ivy.xml")); + assertEquals(report1.getDownloadSize(), 0); + } + + public void testCUDFIntegration1() throws Exception{ + ivy.configure(new File("test/test-cudf/ivysettings.xml")); + ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_DEBUG)); + ivy.resolve(new File("src/example/configurations/multi-projects/filter-framework/ivy.xml")); + } +} diff --git a/test/java/org/apache/ivy/plugins/resolver/util/bad-url.cudf b/test/java/org/apache/ivy/plugins/resolver/util/bad-url.cudf new file mode 100644 index 0000000..82d13f3 --- /dev/null +++ b/test/java/org/apache/ivy/plugins/resolver/util/bad-url.cudf @@ -0,0 +1,16 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: org.springframework%3aspring-core +number: 3.1.1.RELEASE +version: 5 +depends: org.springframework%3aspring-asm = 3, commons-logging%3acommons-logging = 5 + +package: org.springframework%3aspring-asm +number: 3.1.1.RELEASE +version: 3 + +package: commons-logging%3acommons-logging +number: 1.1.1 +version: 5 diff --git a/test/java/org/apache/ivy/plugins/resolver/util/bad.cudf b/test/java/org/apache/ivy/plugins/resolver/util/bad.cudf new file mode 100644 index 0000000..caa9e13 --- /dev/null +++ b/test/java/org/apache/ivy/plugins/resolver/util/bad.cudf @@ -0,0 +1,19 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: org.springframework%3aspring-core +nmber: 3.1.1.RELEASE +version: 5 +url: http%3a//localhost%3a9091/archiva/repository/toto/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.jar +depends: org.springframework%3aspring-asm = 3, commons-logging%3acommons-logging = 5 + +pacage: org.springframework%3aspring-asm +number: 3.1.1.RELEASE +version: 3 +url: http%3a//localhost%3a9091/archiva/repository/toto/org/springframework/spring-asm/3.1.1.RELEASE/spring-asm-3.1.1.RELEASE.jar + +package: commons-logging%3acommons-logging +number: 1.1.1 +vesion: 5 +url: http%3a//localhost%3a9091/archiva/repository/toto/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar diff --git a/test/java/org/apache/ivy/plugins/resolver/util/bad2.cudf b/test/java/org/apache/ivy/plugins/resolver/util/bad2.cudf new file mode 100644 index 0000000..73e88ea --- /dev/null +++ b/test/java/org/apache/ivy/plugins/resolver/util/bad2.cudf @@ -0,0 +1,18 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: org.springframework%3aspring-core +version: 5 +url: http%3a//localhost%3a9091/archiva/repository/toto/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.jar +depends: org.springframework%3aspring-asm = 3, commons-logging%3acommons-logging = 5 + +package: org.springframework%3aspring-asm +number: 3.1.1.RELEASE +version: 3 +url: http%3a//localhost%3a9091/archiva/repository/toto/org/springframework/spring-asm/3.1.1.RELEASE/spring-asm-3.1.1.RELEASE.jar + +package: commons-logging%3acommons-logging +number: 1.1.1 +version: 5 +url: http%3a//localhost%3a9091/archiva/repository/toto/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar diff --git a/test/java/org/apache/ivy/plugins/resolver/util/empty.cudf b/test/java/org/apache/ivy/plugins/resolver/util/empty.cudf new file mode 100644 index 0000000..5bd3196 --- /dev/null +++ b/test/java/org/apache/ivy/plugins/resolver/util/empty.cudf @@ -0,0 +1,3 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] diff --git a/test/java/org/apache/ivy/plugins/resolver/util/testdownload.cudf b/test/java/org/apache/ivy/plugins/resolver/util/testdownload.cudf new file mode 100644 index 0000000..7f43aef --- /dev/null +++ b/test/java/org/apache/ivy/plugins/resolver/util/testdownload.cudf @@ -0,0 +1,16 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: org.springframework%3aspring-core +number: 3.1.1.RELEASE +version: 5 +depends: org.springframework%3aspring-asm = 3, commons-logging%3acommons-logging = 5 + +package: org.springframework%3aspring-asm +number: 3.1.1.RELEASE +version: 3 + +package: commons-logging%3acommons-logging +number: 1.1.1 +version: 5 \ No newline at end of file diff --git a/test/test-cudf/build.xml b/test/test-cudf/build.xml new file mode 100644 index 0000000..a78c330 --- /dev/null +++ b/test/test-cudf/build.xml @@ -0,0 +1,26 @@ + + + a simple project to test ivy + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/test-cudf/ivy.xml b/test/test-cudf/ivy.xml new file mode 100644 index 0000000..6200c4f --- /dev/null +++ b/test/test-cudf/ivy.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/test/test-cudf/ivysettings-without-url.xml b/test/test-cudf/ivysettings-without-url.xml new file mode 100644 index 0000000..b1aeb65 --- /dev/null +++ b/test/test-cudf/ivysettings-without-url.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/test/test-cudf/ivysettings.xml b/test/test-cudf/ivysettings.xml new file mode 100644 index 0000000..b4789d9 --- /dev/null +++ b/test/test-cudf/ivysettings.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/test/test-cudf/repositories/cudf-with-url/commons-collections/commons-collections/3.1/commons-collections-3.1.cudf b/test/test-cudf/repositories/cudf-with-url/commons-collections/commons-collections/3.1/commons-collections-3.1.cudf new file mode 100644 index 0000000..49873dd --- /dev/null +++ b/test/test-cudf/repositories/cudf-with-url/commons-collections/commons-collections/3.1/commons-collections-3.1.cudf @@ -0,0 +1,8 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: commons-collections%3acommons-collections +number: 3.1 +version: 5 +type: jar \ No newline at end of file diff --git a/test/test-cudf/repositories/cudf-with-url/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.cudf b/test/test-cudf/repositories/cudf-with-url/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.cudf new file mode 100644 index 0000000..73d22e1 --- /dev/null +++ b/test/test-cudf/repositories/cudf-with-url/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.cudf @@ -0,0 +1,8 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: commons-httpclient%3acommons-httpclient +number: 3.1 +version: 5 +type: jar \ No newline at end of file diff --git a/test/test-cudf/repositories/cudf-with-url/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.cudf b/test/test-cudf/repositories/cudf-with-url/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.cudf new file mode 100644 index 0000000..51ff6a0 --- /dev/null +++ b/test/test-cudf/repositories/cudf-with-url/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.cudf @@ -0,0 +1,8 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: commons-logging%3acommons-logging +number: 1.1.1 +version: 5 +type: jar \ No newline at end of file diff --git a/test/test-cudf/repositories/cudf-with-url/junit/junit/3.8/junit-3.8.cudf b/test/test-cudf/repositories/cudf-with-url/junit/junit/3.8/junit-3.8.cudf new file mode 100644 index 0000000..2dcd3cd --- /dev/null +++ b/test/test-cudf/repositories/cudf-with-url/junit/junit/3.8/junit-3.8.cudf @@ -0,0 +1,9 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: junit%3ajunit +number: 3.8 +version: 5 +type: jar +url: http%3a//repo1.maven.org/maven2/junit/junit/3.8/junit-3.1.jar \ No newline at end of file diff --git a/test/test-cudf/repositories/cudf-with-url/org/apache/test/1.0 b/test/test-cudf/repositories/cudf-with-url/org/apache/test/1.0 new file mode 100644 index 0000000..25f0007 --- /dev/null +++ b/test/test-cudf/repositories/cudf-with-url/org/apache/test/1.0 @@ -0,0 +1,19 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: org.apache%3atest +number: 1.0 +version: 5 +url: http%3a//localhost%3a9091/archiva/repository/toto/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.jar +depends: org.springframework%3aspring-asm = 3, commons-logging%3acommons-logging = 5 + +package: org.springframework%3aspring-asm +number: 3.1.1.RELEASE +version: 3 +url: http%3a//localhost%3a9091/archiva/repository/toto/org/springframework/spring-asm/3.1.1.RELEASE/spring-asm-3.1.1.RELEASE.jar + +package: commons-logging%3acommons-logging +number: 1.1.1 +version: 5 +url: http%3a//localhost%a39091/archiva/repository/toto/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar diff --git a/test/test-cudf/repositories/cudf-with-url/org/springframework/spring-asm/3.1.1.RELEASE/spring-asm-3.1.1.RELEASE.cudf b/test/test-cudf/repositories/cudf-with-url/org/springframework/spring-asm/3.1.1.RELEASE/spring-asm-3.1.1.RELEASE.cudf new file mode 100644 index 0000000..3abbf62 --- /dev/null +++ b/test/test-cudf/repositories/cudf-with-url/org/springframework/spring-asm/3.1.1.RELEASE/spring-asm-3.1.1.RELEASE.cudf @@ -0,0 +1,9 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: org.springframework%3aspring-asm +number: 3.1.1.RELEASE +version: 5 +type: jar +url: http%3a//repo1.maven.org/maven2/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.jar diff --git a/test/test-cudf/repositories/cudf-with-url/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.cudf b/test/test-cudf/repositories/cudf-with-url/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.cudf new file mode 100644 index 0000000..5f10ad6 --- /dev/null +++ b/test/test-cudf/repositories/cudf-with-url/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.cudf @@ -0,0 +1,22 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: org.springframework%3aspring-core +number: 3.1.1.RELEASE +version: 5 +type: jar +url: http%3a//repo1.maven.org/maven2/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.jar +depends: org.springframework%3aspring-asm = 3, commons-logging%3acommons-logging = 5 + +package: org.springframework%3aspring-asm +number: 3.1.1.RELEASE +version: 3 +type: jar +url: http%3a//repo1.maven.org/maven2/org/springframework/spring-asm/3.1.1.RELEASE/spring-asm-3.1.1.RELEASE.jar + +package: commons-logging%3acommons-logging +number: 1.1.1 +version: 5 +type: jar +url: http%3a//repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar diff --git a/test/test-cudf/repositories/cudf-without-url/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.cudf b/test/test-cudf/repositories/cudf-without-url/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.cudf new file mode 100644 index 0000000..73d22e1 --- /dev/null +++ b/test/test-cudf/repositories/cudf-without-url/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.cudf @@ -0,0 +1,8 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: commons-httpclient%3acommons-httpclient +number: 3.1 +version: 5 +type: jar \ No newline at end of file diff --git a/test/test-cudf/repositories/cudf-without-url/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.cudf b/test/test-cudf/repositories/cudf-without-url/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.cudf new file mode 100644 index 0000000..51ff6a0 --- /dev/null +++ b/test/test-cudf/repositories/cudf-without-url/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.cudf @@ -0,0 +1,8 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: commons-logging%3acommons-logging +number: 1.1.1 +version: 5 +type: jar \ No newline at end of file diff --git a/test/test-cudf/repositories/cudf-without-url/org/apache/test/1.0 b/test/test-cudf/repositories/cudf-without-url/org/apache/test/1.0 new file mode 100644 index 0000000..163cc1c --- /dev/null +++ b/test/test-cudf/repositories/cudf-without-url/org/apache/test/1.0 @@ -0,0 +1,16 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: org.apache%3atest +number: 1.0 +version: 5 +depends: org.springframework%3aspring-asm = 3, commons-logging%3acommons-logging = 5 + +package: org.springframework%3aspring-asm +number: 3.1.1.RELEASE +version: 3 + +package: commons-logging%3acommons-logging +number: 1.1.1 +version: 5 diff --git a/test/test-cudf/repositories/cudf-without-url/org/springframework/spring-asm/3.1.1.RELEASE/spring-asm-3.1.1.RELEASE.cudf b/test/test-cudf/repositories/cudf-without-url/org/springframework/spring-asm/3.1.1.RELEASE/spring-asm-3.1.1.RELEASE.cudf new file mode 100644 index 0000000..3abbf62 --- /dev/null +++ b/test/test-cudf/repositories/cudf-without-url/org/springframework/spring-asm/3.1.1.RELEASE/spring-asm-3.1.1.RELEASE.cudf @@ -0,0 +1,9 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: org.springframework%3aspring-asm +number: 3.1.1.RELEASE +version: 5 +type: jar +url: http%3a//repo1.maven.org/maven2/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.jar diff --git a/test/test-cudf/repositories/cudf-without-url/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.cudf b/test/test-cudf/repositories/cudf-without-url/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.cudf new file mode 100644 index 0000000..5f10ad6 --- /dev/null +++ b/test/test-cudf/repositories/cudf-without-url/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.cudf @@ -0,0 +1,22 @@ +preamble: +property: number: string, recommends: vpkgformula = [true!], suggests: vpkglist = [], + url: string = [""] + +package: org.springframework%3aspring-core +number: 3.1.1.RELEASE +version: 5 +type: jar +url: http%3a//repo1.maven.org/maven2/org/springframework/spring-core/3.1.1.RELEASE/spring-core-3.1.1.RELEASE.jar +depends: org.springframework%3aspring-asm = 3, commons-logging%3acommons-logging = 5 + +package: org.springframework%3aspring-asm +number: 3.1.1.RELEASE +version: 3 +type: jar +url: http%3a//repo1.maven.org/maven2/org/springframework/spring-asm/3.1.1.RELEASE/spring-asm-3.1.1.RELEASE.jar + +package: commons-logging%3acommons-logging +number: 1.1.1 +version: 5 +type: jar +url: http%3a//repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar