mirror of https://github.com/apache/maven.git
o Created UT from MNG-3845
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@729505 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3dd7dcecbc
commit
abc85c68f4
|
@ -320,6 +320,22 @@ public class PomConstructionTest
|
|||
assertEquals( "http://parent.url/download", pom.getValue( "distributionManagement/downloadUrl" ) );
|
||||
}
|
||||
|
||||
public void testNonInheritedElementsInSubtreesOverriddenByChild()
|
||||
throws Exception
|
||||
{
|
||||
PomTestWrapper pom = buildPom( "limited-inheritance/child" );
|
||||
assertEquals( null, pom.getValue( "organization/url" ) );
|
||||
assertEquals( null, pom.getValue( "issueManagement/system" ) );
|
||||
assertEquals( 0, ( (List<?>) pom.getValue( "ciManagement/notifiers" ) ).size() );
|
||||
assertEquals( null, pom.getValue( "distributionManagement/repository/name" ) );
|
||||
assertEquals( true, pom.getValue( "distributionManagement/repository/uniqueVersion" ) );
|
||||
assertEquals( "default", pom.getValue( "distributionManagement/repository/layout" ) );
|
||||
assertEquals( null, pom.getValue( "distributionManagement/snapshotRepository/name" ) );
|
||||
assertEquals( true, pom.getValue( "distributionManagement/snapshotRepository/uniqueVersion" ) );
|
||||
assertEquals( "default", pom.getValue( "distributionManagement/snapshotRepository/layout" ) );
|
||||
assertEquals( null, pom.getValue( "distributionManagement/site/name" ) );
|
||||
}
|
||||
|
||||
private PomArtifactResolver artifactResolver( String basedir )
|
||||
{
|
||||
return new FileBasedPomArtifactResolver( new File( BASE_POM_DIR, basedir ) );
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
<?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>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.mng3845</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>0.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>child</artifactId>
|
||||
|
||||
<organization>
|
||||
<name>child-org</name>
|
||||
</organization>
|
||||
|
||||
<scm>
|
||||
<developerConnection>https://child.url/scm</developerConnection>
|
||||
</scm>
|
||||
<issueManagement>
|
||||
<url>http://child.url/issues</url>
|
||||
</issueManagement>
|
||||
<ciManagement>
|
||||
<system>child-ci</system>
|
||||
<url>http://child.url/ci</url>
|
||||
</ciManagement>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>child-distros</id>
|
||||
<url>ssh://child.url/distros</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>child-snaps</id>
|
||||
<url>ssh://child.url/snaps</url>
|
||||
</snapshotRepository>
|
||||
<site>
|
||||
<id>child-site</id>
|
||||
<url>scp://child.url/site</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
</project>
|
|
@ -0,0 +1,87 @@
|
|||
<?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>
|
||||
|
||||
<groupId>org.apache.maven.its.mng3845</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>0.1</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Maven Integration Test :: MNG-3845</name>
|
||||
<description>
|
||||
Test that inheritance is all-or-nothing for certain sub-trees of the POM.
|
||||
</description>
|
||||
|
||||
<organization>
|
||||
<name>parent-org</name>
|
||||
<url>http://parent.url/org</url>
|
||||
</organization>
|
||||
|
||||
<scm>
|
||||
<url>http://parent.url/viewvc</url>
|
||||
<connection>http://parent.url/scm</connection>
|
||||
<developerConnection>https://parent.url/scm</developerConnection>
|
||||
<tag>parent-tag</tag>
|
||||
</scm>
|
||||
<issueManagement>
|
||||
<system>parent-issues</system>
|
||||
<url>http://parent.url/issues</url>
|
||||
</issueManagement>
|
||||
<ciManagement>
|
||||
<system>parent-ci</system>
|
||||
<url>http://parent.url/ci</url>
|
||||
<notifiers>
|
||||
<notifier>
|
||||
<type>irc</type>
|
||||
<sendOnError>true</sendOnError>
|
||||
<sendOnFailure>true</sendOnFailure>
|
||||
<sendOnSuccess>false</sendOnSuccess>
|
||||
<sendOnWarning>false</sendOnWarning>
|
||||
<configuration>
|
||||
<address>irc://parent.url/#ci</address>
|
||||
</configuration>
|
||||
</notifier>
|
||||
</notifiers>
|
||||
</ciManagement>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>parent-distros</id>
|
||||
<name>parent-distros</name>
|
||||
<url>ssh://parent.url/distros</url>
|
||||
<uniqueVersion>false</uniqueVersion>
|
||||
<layout>legacy</layout>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>parent-snaps</id>
|
||||
<name>parent-snaps</name>
|
||||
<url>ssh://parent.url/snaps</url>
|
||||
<uniqueVersion>false</uniqueVersion>
|
||||
<layout>legacy</layout>
|
||||
</snapshotRepository>
|
||||
<site>
|
||||
<id>parent-site</id>
|
||||
<name>parent-site</name>
|
||||
<url>scp://parent.url/site</url>
|
||||
</site>
|
||||
</distributionManagement>
|
||||
</project>
|
Loading…
Reference in New Issue