Author: maartenc
Date: Wed Feb 10 22:01:29 2010
New Revision: 908664
URL: http://svn.apache.org/viewvc?rev=908664&view=rev
Log:
FIX: parent.groupId is not resolved in maven 2 parser (IVY-1169) (thanks to
Achim Huegen)
Added:
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent.groupid.pom
Modified:
ant/ivy/core/trunk/CHANGES.txt
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
Modified: ant/ivy/core/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=908664&r1=908663&r2=908664&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Wed Feb 10 22:01:29 2010
@@ -45,6 +45,7 @@
Ben Hale
Peter Hayes
Scott Hebert
+ Achim Huegen
Matt Inger
Anders Janmyr
Steve Jones
@@ -107,6 +108,7 @@
- IMPROVEMENT: Trace a message when a property file referenced from the
settings doesn't exixts (IVY-1074)
- IMPROVEMENT: use defaultconf in combination with defaultconfmapping
(IVY-1135) (thanks to Jon Schneider)
+- FIX: parent.groupId is not resolved in maven 2 parser (IVY-1169) (thanks to
Achim Huegen)
- FIX: Creation of symlinks problematic in Windows with Cygwin 1.7 (IVY-1165)
- FIX: add ability to programmatically change default resolver (IVY-1163)
(thanks to Jason Trump)
- FIX: ivy.settings.dir space escaping problem (IVY-1162)
Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?rev=908664&r1=908663&r2=908664&view=diff
==============================================================================
---
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
(original)
+++
ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
Wed Feb 10 22:01:29 2010
@@ -116,7 +116,9 @@
try {
PomReader domReader = new PomReader(descriptorURL, res);
domReader.setProperty("parent.version",
domReader.getParentVersion());
+ domReader.setProperty("parent.groupId",
domReader.getParentGroupId());
domReader.setProperty("project.parent.version",
domReader.getParentVersion());
+ domReader.setProperty("project.parent.groupId",
domReader.getParentGroupId());
Map pomProperties = domReader.getPomProperties();
for (Iterator iter = pomProperties.entrySet().iterator();
iter.hasNext();) {
Modified:
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java?rev=908664&r1=908663&r2=908664&view=diff
==============================================================================
---
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
(original)
+++
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParserTest.java
Wed Feb 10 22:01:29 2010
@@ -221,6 +221,20 @@
assertEquals("test", artifact[0].getName());
}
+ public void testParentGroupId() throws Exception {
+ ModuleDescriptor md =
PomModuleDescriptorParser.getInstance().parseDescriptor(
+ settings, getClass().getResource("test-parent.groupid.pom"),
false);
+ assertNotNull(md);
+
+ ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache",
"test", "1.0");
+ assertEquals(mrid, md.getModuleRevisionId());
+
+ Artifact[] artifact = md.getArtifacts("master");
+ assertEquals(1, artifact.length);
+ assertEquals(mrid, artifact[0].getModuleRevisionId());
+ assertEquals("test", artifact[0].getName());
+ }
+
public void testProjectParentVersion() throws Exception {
ModuleDescriptor md =
PomModuleDescriptorParser.getInstance().parseDescriptor(
settings,
getClass().getResource("test-project.parent.version.pom"), false);
Added:
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent.groupid.pom
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent.groupid.pom?rev=908664&view=auto
==============================================================================
---
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent.groupid.pom
(added)
+++
ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/test-parent.groupid.pom
Wed Feb 10 22:01:29 2010
@@ -0,0 +1,36 @@
+<?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>
+ <parent>
+ <artifactId>test-parent</artifactId>
+ <groupId>org.apache</groupId>
+ <version>1.0</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>test</artifactId>
+ <name>Test Module for Ivy M2 parsing</name>
+ <groupId>${parent.groupId}</groupId>
+ <version>1.0</version>
+ <url>http://ivy.jayasoft.org/</url>
+ <organization>
+ <name>Jayasoft</name>
+ <url>http://www.jayasoft.org/</url>
+ </organization>
+</project>