[MNG-2591] Plugins are merged incorrectly

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

git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@758437 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-03-25 21:09:53 +00:00
parent 7a77fab47b
commit 3e30408e37
5 changed files with 190 additions and 4 deletions

View File

@ -41,13 +41,29 @@ public class MavenITmng2591MergeInheritedPluginConfigTest
}
/**
* Test aggregation of list configuration items for build plugins when using
* 'combine.children=append' attribute.
* Test aggregation of list configuration items for build plugins when using 'combine.children=append' attribute.
* This variation of the test does not employ profiles.
*/
public void testitMNG2591()
public void testitNoProfile()
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2591" );
testit( "no-profile" );
}
/**
* Test aggregation of list configuration items for build plugins when using 'combine.children=append' attribute.
* This variation of the test employs active profiles which however are empty and should not change the result.
*/
public void testitWithProfile()
throws Exception
{
testit( "with-profile" );
}
private void testit( String project )
throws Exception
{
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2591/" + project );
Verifier verifier = new Verifier( testDir.getAbsolutePath() );
verifier.setAutoclean( false );
verifier.deleteDirectory( "subproject/target" );

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>