You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by si...@apache.org on 2009/04/08 08:01:07 UTC
svn commit: r763117 - in /maven/components/trunk:
maven-project-builder/src/main/java/org/apache/maven/project/processor/
maven-project/src/test/java/org/apache/maven/project/
maven-project/src/test/resources-project-builder/pom-inheritance/
maven-proj...
Author: sisbell
Date: Wed Apr 8 06:01:06 2009
New Revision: 763117
URL: http://svn.apache.org/viewvc?rev=763117&view=rev
Log:
[MNG-3843] - inheritance of pom description.
Added:
maven/components/trunk/maven-project/src/test/resources-project-builder/pom-inheritance/
maven/components/trunk/maven-project/src/test/resources-project-builder/pom-inheritance/pom.xml
maven/components/trunk/maven-project/src/test/resources-project-builder/pom-inheritance/sub/
maven/components/trunk/maven-project/src/test/resources-project-builder/pom-inheritance/sub/pom.xml
Modified:
maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ModelProcessor.java
maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java
Modified: maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ModelProcessor.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ModelProcessor.java?rev=763117&r1=763116&r2=763117&view=diff
==============================================================================
--- maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ModelProcessor.java (original)
+++ maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/processor/ModelProcessor.java Wed Apr 8 06:01:06 2009
@@ -111,6 +111,10 @@
{
t.setDescription( c.getDescription() );
}
+ else if(p != null && p.getDescription() != null)
+ {
+ t.setDescription(p.getDescription());
+ }
if ( c.getInceptionYear() != null )
{
Modified: maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java?rev=763117&r1=763116&r2=763117&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java (original)
+++ maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java Wed Apr 8 06:01:06 2009
@@ -1026,6 +1026,13 @@
assertEquals("child", pom.getValue( "properties/pomProfile" ) );
}
+ public void testPomInheritance()
+ throws Exception
+ {
+ PomTestWrapper pom = buildPom( "pom-inheritance/sub" );
+ assertEquals("parent-description", pom.getValue("description"));
+ }
+
public void testCompleteModelWithoutParent()
throws Exception
{
Added: maven/components/trunk/maven-project/src/test/resources-project-builder/pom-inheritance/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources-project-builder/pom-inheritance/pom.xml?rev=763117&view=auto
==============================================================================
--- maven/components/trunk/maven-project/src/test/resources-project-builder/pom-inheritance/pom.xml (added)
+++ maven/components/trunk/maven-project/src/test/resources-project-builder/pom-inheritance/pom.xml Wed Apr 8 06:01:06 2009
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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>
+
+ <!--
+ This parent POM overrides most super POM defaults to test inheritance in child modules.
+ -->
+
+ <groupId>org.apache.maven.its.mng3843</groupId>
+ <artifactId>parent-1</artifactId>
+ <version>0.1</version>
+ <packaging>pom</packaging>
+
+ <name>parent-name</name>
+ <description>parent-description</description>
+ <url>http://parent.url/</url>
+ <inceptionYear>2008</inceptionYear>
+ <organization>
+ <name>parent-org</name>
+ <url>http://parent-org.url/</url>
+ </organization>
+ <licenses>
+ <license>
+ <name>parent-license</name>
+ <url>http://parent.url/license</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <developers>
+ <developer>
+ <name>parent-developer</name>
+ </developer>
+ </developers>
+ <contributors>
+ <contributor>
+ <name>parent-contributor</name>
+ </contributor>
+ </contributors>
+
+ <mailingLists>
+ <mailingList>
+ <name>parent-mailing-list</name>
+ </mailingList>
+ </mailingLists>
+
+ <prerequisites>
+ <maven>2.0</maven>
+ </prerequisites>
+
+ <modules>
+ <module>child-1</module>
+ <module>child-2</module>
+ </modules>
+
+ <scm>
+ <url>http://parent.url/trunk</url>
+ <connection>http://parent.url/scm</connection>
+ <developerConnection>https://parent.url/scm</developerConnection>
+ </scm>
+ <issueManagement>
+ <url>http://parent.url/issues</url>
+ </issueManagement>
+ <ciManagement>
+ <url>http://parent.url/ci</url>
+ </ciManagement>
+ <distributionManagement>
+ <repository>
+ <url>http://parent.url/dist</url>
+ <id>parent.distros</id>
+ </repository>
+ <snapshotRepository>
+ <url>http://parent.url/snaps</url>
+ <id>parent.snaps</id>
+ </snapshotRepository>
+ <site>
+ <url>http://parent.url/site</url>
+ <id>parent.site</id>
+ </site>
+ <downloadUrl>http://parent.url/download</downloadUrl>
+ <relocation>
+ <message>parent-reloc-msg</message>
+ </relocation>
+ </distributionManagement>
+
+ <properties>
+ <parentProperty>parent-property</parentProperty>
+ <overriddenProperty>parent-property</overriddenProperty>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.mng3843</groupId>
+ <artifactId>parent-dep-a</artifactId>
+ <version>1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.mng3843</groupId>
+ <artifactId>parent-dep-b</artifactId>
+ <version>1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>parent-remote-repo</id>
+ <url>http://parent.url/remote</url>
+ </repository>
+ </repositories>
+
+ <build>
+ <defaultGoal>initialize</defaultGoal>
+ <directory>out</directory>
+ <sourceDirectory>src/main</sourceDirectory>
+ <scriptSourceDirectory>src/scripts</scriptSourceDirectory>
+ <testSourceDirectory>src/test</testSourceDirectory>
+ <outputDirectory>out/main</outputDirectory>
+ <testOutputDirectory>out/test</testOutputDirectory>
+ <resources>
+ <resource>
+ <directory>res/main</directory>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <directory>res/test</directory>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-expression</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>eval</goal>
+ </goals>
+ <configuration>
+ <outputFile>target/pom.properties</outputFile>
+ <expressions>
+ <expression>project</expression>
+ </expressions>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <excludeDefaults>true</excludeDefaults>
+ <outputDirectory>site</outputDirectory>
+ </reporting>
+
+ <profiles>
+ <profile>
+ <id>parent-profile</id>
+ </profile>
+ </profiles>
+</project>
Added: maven/components/trunk/maven-project/src/test/resources-project-builder/pom-inheritance/sub/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources-project-builder/pom-inheritance/sub/pom.xml?rev=763117&view=auto
==============================================================================
--- maven/components/trunk/maven-project/src/test/resources-project-builder/pom-inheritance/sub/pom.xml (added)
+++ maven/components/trunk/maven-project/src/test/resources-project-builder/pom-inheritance/sub/pom.xml Wed Apr 8 06:01:06 2009
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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>
+
+ <!--
+ This minimalistic POM tests mere inheritance from its parent.
+ -->
+
+ <parent>
+ <groupId>org.apache.maven.its.mng3843</groupId>
+ <artifactId>parent-1</artifactId>
+ <version>0.1</version>
+ </parent>
+
+ <artifactId>child-1</artifactId>
+</project>