o Fixed inheritance of <prerequisites>

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@783542 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-06-10 22:02:56 +00:00
parent 12bc6dad0e
commit 424b7ef1b0
4 changed files with 83 additions and 0 deletions

View File

@ -1512,6 +1512,14 @@ public class PomConstructionTest
}
}
/** MNG-3843 */
public void testPrerequisitesAreNotInherited()
throws Exception
{
PomTestWrapper pom = buildPom( "prerequisites-inheritance/child" );
assertSame( null, pom.getValue( "prerequisites" ) );
}
private void assertPathSuffixEquals( String expected, Object actual )
{
String a = actual.toString();

View File

@ -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. The <prerequisites> should not be inherited.
-->
<parent>
<groupId>org.apache.maven.its.mng3843</groupId>
<artifactId>parent-1</artifactId>
<version>0.1</version>
</parent>
<artifactId>child-1</artifactId>
</project>

View File

@ -0,0 +1,33 @@
<?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.mng3843</groupId>
<artifactId>parent-1</artifactId>
<version>0.1</version>
<packaging>pom</packaging>
<prerequisites>
<maven>2.0</maven>
</prerequisites>
</project>

View File

@ -166,6 +166,12 @@ public class MavenModelMerger
// neither inherited nor injected
}
@Override
protected void mergeModel_Prerequisites( Model target, Model source, boolean sourceDominant, Map<Object, Object> context )
{
// neither inherited nor injected
}
@Override
protected void mergeModelBase_Modules( ModelBase target, ModelBase source, boolean sourceDominant,
Map<Object, Object> context )