mirror of https://github.com/apache/maven.git
[MNG-3845] Unintended inheritance of parent elements overriden by children
o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@714252 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4a56a30a76
commit
3a9dc16e26
|
@ -88,6 +88,7 @@ public class IntegrationTestSuite
|
||||||
// suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
|
// suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
|
||||||
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
|
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
|
||||||
|
|
||||||
|
suite.addTestSuite( MavenITmng3845LimitedPomInheritanceTest.class );
|
||||||
suite.addTestSuite( MavenITmng3843PomInheritanceTest.class );
|
suite.addTestSuite( MavenITmng3843PomInheritanceTest.class );
|
||||||
suite.addTestSuite( MavenITmng3839PomParsingCoalesceTextTest.class );
|
suite.addTestSuite( MavenITmng3839PomParsingCoalesceTextTest.class );
|
||||||
suite.addTestSuite( MavenITmng3838EqualPluginDepsTest.class );
|
suite.addTestSuite( MavenITmng3838EqualPluginDepsTest.class );
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
package org.apache.maven.it;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import org.apache.maven.it.Verifier;
|
||||||
|
import org.apache.maven.it.util.ResourceExtractor;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is a test set for <a href="http://jira.codehaus.org/browse/MNG-3845">MNG-3845</a>.
|
||||||
|
*
|
||||||
|
* @author Benjamin Bentmann
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class MavenITmng3845LimitedPomInheritanceTest
|
||||||
|
extends AbstractMavenIntegrationTestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
public MavenITmng3845LimitedPomInheritanceTest()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that inheritance is all-or-nothing for certain sub-trees of the POM.
|
||||||
|
*/
|
||||||
|
public void testitMNG3845()
|
||||||
|
throws Exception
|
||||||
|
{
|
||||||
|
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3845" );
|
||||||
|
|
||||||
|
Verifier verifier = new Verifier( new File( testDir, "child" ).getAbsolutePath() );
|
||||||
|
verifier.setAutoclean( false );
|
||||||
|
verifier.deleteDirectory( "target" );
|
||||||
|
verifier.executeGoal( "validate" );
|
||||||
|
verifier.verifyErrorFreeLog();
|
||||||
|
verifier.resetStreams();
|
||||||
|
|
||||||
|
Properties props = verifier.loadProperties( "target/pom.properties" );
|
||||||
|
assertEquals( "", props.getProperty( "project.organization.url", "" ) );
|
||||||
|
assertEquals( "", props.getProperty( "project.issueManagement.system", "" ) );
|
||||||
|
assertEquals( "0", props.getProperty( "project.ciManagement.notifiers", "0" ) );
|
||||||
|
assertEquals( "", props.getProperty( "project.distributionManagement.repository.name", "" ) );
|
||||||
|
assertEquals( "true", props.getProperty( "project.distributionManagement.repository.uniqueVersion", "true" ) );
|
||||||
|
assertEquals( "default", props.getProperty( "project.distributionManagement.repository.layout", "default" ) );
|
||||||
|
assertEquals( "", props.getProperty( "project.distributionManagement.snapshotRepository.name", "" ) );
|
||||||
|
assertEquals( "true", props.getProperty( "project.distributionManagement.snapshotRepository.uniqueVersion", "true" ) );
|
||||||
|
assertEquals( "default", props.getProperty( "project.distributionManagement.snapshotRepository.layout", "default" ) );
|
||||||
|
assertEquals( "", props.getProperty( "project.distributionManagement.site.name", "" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
<?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>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<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/organization</expression>
|
||||||
|
<expression>project/scm</expression>
|
||||||
|
<expression>project/ciManagement</expression>
|
||||||
|
<expression>project/issueManagement</expression>
|
||||||
|
<expression>project/distributionManagement</expression>
|
||||||
|
</expressions>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</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