You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by ma...@apache.org on 2007/05/21 21:36:50 UTC

svn commit: r540308 - in /incubator/ivy/core/trunk: ./ src/java/org/apache/ivy/plugins/parser/m2/ test/java/org/apache/ivy/core/resolve/ test/java/org/apache/ivy/plugins/parser/m2/ test/repositories/m2/org/apache/test-version/ test/repositories/m2/org/...

Author: maartenc
Date: Mon May 21 14:36:49 2007
New Revision: 540308

URL: http://svn.apache.org/viewvc?view=rev&rev=540308
Log:
FIX: ${revision} property not recognized in poms (IVY-512)

Added:
    incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-version.pom
    incubator/ivy/core/trunk/test/repositories/m2/org/apache/test-version/
    incubator/ivy/core/trunk/test/repositories/m2/org/apache/test-version/1.0/
    incubator/ivy/core/trunk/test/repositories/m2/org/apache/test-version/1.0/test-version-1.0.jar
    incubator/ivy/core/trunk/test/repositories/m2/org/apache/test-version/1.0/test-version-1.0.pom
Modified:
    incubator/ivy/core/trunk/CHANGES.txt
    incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
    incubator/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
    incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java

Modified: incubator/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/CHANGES.txt?view=diff&rev=540308&r1=540307&r2=540308
==============================================================================
--- incubator/ivy/core/trunk/CHANGES.txt (original)
+++ incubator/ivy/core/trunk/CHANGES.txt Mon May 21 14:36:49 2007
@@ -52,6 +52,7 @@
 - IMPROVEMENT: Allow "main" parameters to be passed directly (instead of using -args flag) (IVY-480) (thanks to Archie Cobbs)
 - IMPROVEMENT: Remove @author tags (thanks to Stephane Bailliez)
 
+- FIX: ${revision} property not recognized in poms (IVY-512)
 - FIX: Bug on handling dependency artifacts when a module configuration is specified (IVY-507)
 - FIX: Configure fails when having httpclient in classpath without commons-logging (IVY-502)
 - FIX: packaging data not parsed in maven 2 pom (IVY-500) (thanks to Jeffrey Blattman)

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?view=diff&rev=540308&r1=540307&r2=540308
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java Mon May 21 14:36:49 2007
@@ -139,6 +139,7 @@
             _properties.put("project.artifactId", _module);
             _properties.put("project.version", _revision);
             _properties.put("pom.version", _revision);
+            _properties.put("version", _revision);
             _md.setModuleRevisionId(mrid);
             if (_type == null) {
                 _type = _ext = "jar";

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java?view=diff&rev=540308&r1=540307&r2=540308
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java (original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java Mon May 21 14:36:49 2007
@@ -2536,6 +2536,24 @@
         assertTrue(TestHelper.getArchiveFileInCache(ivy, _cache, "org.apache", "test-classified", "1.0", "test-classified", "jar", "jar").exists());
     }
     
+    public void testResolveMaven2WithVersionProperty() throws Exception {
+        Ivy ivy = new Ivy();
+        ivy.configure(new File("test/repositories/m2/ivysettings.xml"));
+        ResolveReport report = ivy.resolve(new File("test/repositories/m2/org/apache/test-version/1.0/test-version-1.0.pom").toURL(),
+                getResolveOptions(new String[] {"*"}));
+        assertNotNull(report);
+        ModuleDescriptor md = report.getModuleDescriptor();
+        assertNotNull(md);
+        ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test-version", "1.0");
+        assertEquals(mrid, md.getModuleRevisionId());
+        
+        assertTrue(ivy.getCacheManager(_cache).getResolvedIvyFileInCache(mrid).exists());
+        
+        // dependencies
+        assertTrue(ivy.getCacheManager(_cache).getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test-classifier", "1.0")).exists());
+        assertTrue(TestHelper.getArchiveFileInCache(ivy, _cache, "org.apache", "test-classifier", "1.0", "test-classifier", "jar", "jar").exists());
+    }
+    
     public void testNamespaceMapping() throws Exception {
         // the dependency is in another namespace
         Ivy ivy = new Ivy();

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java?view=diff&rev=540308&r1=540307&r2=540308
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java (original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java Mon May 21 14:36:49 2007
@@ -140,6 +140,16 @@
         assertEquals(extraAtt, dds[0].getAllDependencyArtifacts()[0].getExtraAttributes());
     }
     
+    public void testWithVersionProperty() throws Exception {
+        ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(new IvySettings(), getClass().getResource("test-version.pom"), false);
+        assertNotNull(md);
+        
+        DependencyDescriptor[] dds = md.getDependencies();
+        assertNotNull(dds);
+        assertEquals(1, dds.length);
+        assertEquals(ModuleRevisionId.newInstance("org.apache", "test-other", "1.0"), dds[0].getDependencyRevisionId());
+    }
+    
     // IVY-392
     public void testDependenciesWithProfile() throws Exception {
         ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(new IvySettings(), getClass().getResource("test-dependencies-with-profile.pom"), false);

Added: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-version.pom
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-version.pom?view=auto&rev=540308
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-version.pom (added)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-version.pom Mon May 21 14:36:49 2007
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+   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.    
+-->
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache</groupId>
+  <artifactId>test-version</artifactId>
+  <name>Test Module for Ivy M2 parsing</name>
+  <version>1.0</version>
+  <url>http://incubator.apache.org/ivy</url>
+  <organization>
+    <name>Apache</name>
+    <url>http://www.apache.org/</url>
+  </organization>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache</groupId>
+      <artifactId>test-other</artifactId>
+      <version>${version}</version>
+    </dependency>
+  </dependencies>
+</project>

Added: incubator/ivy/core/trunk/test/repositories/m2/org/apache/test-version/1.0/test-version-1.0.jar
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/repositories/m2/org/apache/test-version/1.0/test-version-1.0.jar?view=auto&rev=540308
==============================================================================
--- incubator/ivy/core/trunk/test/repositories/m2/org/apache/test-version/1.0/test-version-1.0.jar (added)
+++ incubator/ivy/core/trunk/test/repositories/m2/org/apache/test-version/1.0/test-version-1.0.jar Mon May 21 14:36:49 2007
@@ -0,0 +1 @@
+ 

Added: incubator/ivy/core/trunk/test/repositories/m2/org/apache/test-version/1.0/test-version-1.0.pom
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/repositories/m2/org/apache/test-version/1.0/test-version-1.0.pom?view=auto&rev=540308
==============================================================================
--- incubator/ivy/core/trunk/test/repositories/m2/org/apache/test-version/1.0/test-version-1.0.pom (added)
+++ incubator/ivy/core/trunk/test/repositories/m2/org/apache/test-version/1.0/test-version-1.0.pom Mon May 21 14:36:49 2007
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+   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.    
+-->
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache</groupId>
+  <artifactId>test-version</artifactId>
+  <name>Test Module for Ivy M2 parsing</name>
+  <version>1.0</version>
+  <url>http://incubator.apache.org/ivy</url>
+  <organization>
+    <name>Apache</name>
+    <url>http://www.apache.org/</url>
+  </organization>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache</groupId>
+      <artifactId>test-classifier</artifactId>
+      <version>${version}</version>
+    </dependency>
+  </dependencies>
+</project>