mirror of https://github.com/apache/maven.git
[MNG-3843] - inheritance of pom description.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@763117 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9c56369edd
commit
2cb49a84ac
|
@ -111,6 +111,10 @@ public class ModelProcessor
|
|||
{
|
||||
t.setDescription( c.getDescription() );
|
||||
}
|
||||
else if(p != null && p.getDescription() != null)
|
||||
{
|
||||
t.setDescription(p.getDescription());
|
||||
}
|
||||
|
||||
if ( c.getInceptionYear() != null )
|
||||
{
|
||||
|
|
|
@ -1026,6 +1026,13 @@ public class PomConstructionTest
|
|||
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
|
||||
{
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
Loading…
Reference in New Issue