[MNG-2591] Plugins are merged incorrectly

o Extended UT to exhibit negative side-effects of profile injection

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@758436 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-03-25 21:06:56 +00:00
parent 9ce8c65d58
commit ff898bffd3
5 changed files with 189 additions and 4 deletions

View File

@ -761,11 +761,25 @@ public class PomConstructionTest
assertEquals( "PASSED-4", pom.getValue( prefix + "listParam/listParam[4]" ) );
}
/* FIXME: MNG-2591*/
public void testAppendOfInheritedPluginConfiguration()
/* MNG-2591 */
public void testAppendOfInheritedPluginConfigurationWithNoProfile()
throws Exception
{
PomTestWrapper pom = buildPom( "plugin-config-append/subproject" );
testAppendOfInheritedPluginConfiguration( "no-profile" );
}
/* FIXME: MNG-2591
public void testAppendOfInheritedPluginConfigurationWithActiveProfile()
throws Exception
{
testAppendOfInheritedPluginConfiguration( "with-profile" );
}
//*/
private void testAppendOfInheritedPluginConfiguration( String test )
throws Exception
{
PomTestWrapper pom = buildPom( "plugin-config-append/" + test + "/subproject" );
String prefix = "build/plugins[1]/configuration/";
assertEquals( "PARENT-1", pom.getValue( prefix + "stringParams/stringParam[1]" ) );
@ -776,6 +790,7 @@ public class PomConstructionTest
assertEquals( "CHILD-3", pom.getValue( prefix + "stringParams/stringParam[6]" ) );
assertEquals( "CHILD-2", pom.getValue( prefix + "stringParams/stringParam[7]" ) );
assertEquals( "CHILD-4", pom.getValue( prefix + "stringParams/stringParam[8]" ) );
assertEquals( null, pom.getValue( prefix + "stringParams/stringParam[9]" ) );
assertEquals( "PARENT-1", pom.getValue( prefix + "listParam/listParam[1]" ) );
assertEquals( "PARENT-3", pom.getValue( prefix + "listParam/listParam[2]" ) );
assertEquals( "PARENT-2", pom.getValue( prefix + "listParam/listParam[3]" ) );
@ -784,8 +799,8 @@ public class PomConstructionTest
assertEquals( "CHILD-3", pom.getValue( prefix + "listParam/listParam[6]" ) );
assertEquals( "CHILD-2", pom.getValue( prefix + "listParam/listParam[7]" ) );
assertEquals( "CHILD-4", pom.getValue( prefix + "listParam/listParam[8]" ) );
assertEquals( null, pom.getValue( prefix + "listParam/listParam[9]" ) );
}
//*/
/* MNG-4000 */
public void testMultiplePluginExecutionsWithAndWithoutIdsWithoutPluginManagement()

View File

@ -0,0 +1,90 @@
<?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.mng2591</groupId>
<artifactId>parent</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>Maven Integration Test :: MNG-2591</name>
<description>
Test aggregation of list configuration items for build plugins when using
'combine.children=append' attribute.
</description>
<modules>
<module>subproject</module>
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<!-- inherit via <pluginManagement> -->
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-configuration</artifactId>
<version>2.1-SNAPSHOT</version>
<inherited>true</inherited>
<configuration>
<listParam>
<!-- NOTE: These values are deliberately not in alpha order! -->
<listParam>PARENT-1</listParam>
<listParam>PARENT-3</listParam>
<listParam>PARENT-2</listParam>
<listParam>PARENT-4</listParam>
</listParam>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<!-- inherit not via <pluginManagement> -->
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-configuration</artifactId>
<version>2.1-SNAPSHOT</version>
<inherited>true</inherited>
<configuration>
<stringParams>
<!-- NOTE: These values are deliberately not in alpha order! -->
<stringParam>PARENT-1</stringParam>
<stringParam>PARENT-3</stringParam>
<stringParam>PARENT-2</stringParam>
<stringParam>PARENT-4</stringParam>
</stringParams>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- an active but empty profile to ensure profile injection does not interfere with plugin configuration -->
<id>parent</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,80 @@
<?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.mng2591</groupId>
<artifactId>parent</artifactId>
<version>1.0</version>
</parent>
<artifactId>subproject</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.its.plugins</groupId>
<artifactId>maven-it-plugin-configuration</artifactId>
<version>2.1-SNAPSHOT</version>
<configuration>
<propertiesFile>target/config.properties</propertiesFile>
<stringParams combine.children="append">
<!-- NOTE: These values are deliberately not in alpha order! -->
<stringParam>CHILD-1</stringParam>
<stringParam>CHILD-3</stringParam>
<stringParam>CHILD-2</stringParam>
<stringParam>CHILD-4</stringParam>
</stringParams>
<listParam combine.children="append">
<!-- NOTE: These values are deliberately not in alpha order! -->
<listParam>CHILD-1</listParam>
<listParam>CHILD-3</listParam>
<listParam>CHILD-2</listParam>
<listParam>CHILD-4</listParam>
</listParam>
</configuration>
<executions>
<execution>
<id>test</id>
<phase>validate</phase>
<goals>
<goal>config</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- an active but empty profile to ensure profile injection does not interfere with plugin configuration -->
<id>child</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
</project>