Author: bentmann Date: Thu Oct 29 12:32:19 2009 New Revision: 830914 URL: http://svn.apache.org/viewvc?rev=830914&view=rev Log: [MNG-4416] [regression] Plugins are not properly ordered after merging with profile plugins
o Added IT Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4416PluginOrderAfterProfileInjectionTest.java (with props) maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4416/ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4416/pom.xml (with props) Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=830914&r1=830913&r2=830914&view=diff ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java (original) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Thu Oct 29 12:32:19 2009 @@ -85,6 +85,7 @@ // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class ); // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 + suite.addTestSuite( MavenITmng4416PluginOrderAfterProfileInjectionTest.class ); suite.addTestSuite( MavenITmng4415InheritedPluginOrderTest.class ); suite.addTestSuite( MavenITmng4413MirroringOfDependencyRepoTest.class ); suite.addTestSuite( MavenITmng4412OfflineModeInPluginTest.class ); Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4416PluginOrderAfterProfileInjectionTest.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4416PluginOrderAfterProfileInjectionTest.java?rev=830914&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4416PluginOrderAfterProfileInjectionTest.java (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4416PluginOrderAfterProfileInjectionTest.java Thu Oct 29 12:32:19 2009 @@ -0,0 +1,88 @@ +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.ArrayList; +import java.util.List; +import java.util.Properties; + +/** + * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4416">MNG-4416</a>. + * + * @author Benjamin Bentmann + */ +public class MavenITmng4416PluginOrderAfterProfileInjectionTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4416PluginOrderAfterProfileInjectionTest() + { + super( "[2.0.5,)" ); + } + + /** + * Test that merging of plugins during profile injection follows these rules regarding ordering: + * model: X -> A -> B -> D -> E + * profile: Y -> A -> C -> D -> F + * result: X -> Y -> A -> B -> C -> D -> E -> F + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4416" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + Properties props = verifier.loadProperties( "target/it.properties" ); + assertNotNull( props.getProperty( "project.build.plugins" ) ); + + List expected = new ArrayList(); + expected.add( "maven-it-plugin-error" ); + expected.add( "maven-it-plugin-configuration" ); + expected.add( "maven-it-plugin-dependency-resolution" ); + expected.add( "maven-it-plugin-packaging" ); + expected.add( "maven-it-plugin-log-file" ); + expected.add( "maven-it-plugin-expression" ); + expected.add( "maven-it-plugin-fork" ); + expected.add( "maven-it-plugin-touch" ); + + List actual = new ArrayList(); + + int count = Integer.parseInt( props.getProperty( "project.build.plugins" ) ); + for ( int i = 0; i < count; i++ ) + { + actual.add( props.getProperty( "project.build.plugins." + i + ".artifactId" ) ); + } + + actual.retainAll( expected ); + + assertEquals( actual, expected ); + } + +} Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4416PluginOrderAfterProfileInjectionTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4416PluginOrderAfterProfileInjectionTest.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4416/pom.xml URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4416/pom.xml?rev=830914&view=auto ============================================================================== --- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4416/pom.xml (added) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4416/pom.xml Thu Oct 29 12:32:19 2009 @@ -0,0 +1,133 @@ +<?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.mng4416</groupId> + <artifactId>test</artifactId> + <version>0.1</version> + + <name>Maven Integration Test :: MNG-4416</name> + <description> + Test that merging of plugins during profile injection follows these rules regarding ordering: + model: X -> A -> B -> D -> E + profile: Y -> A -> C -> D -> F + result: X -> Y -> A -> B -> C -> D -> E -> F + </description> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-error</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-dependency-resolution</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-packaging</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-fork</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>test</id> + <activation> + <property> + <name>!skip-mng4416</name> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-configuration</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-dependency-resolution</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-log-file</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <logFile>target/it.properties</logFile> + </configuration> + <executions> + <execution> + <id>first</id> + <phase>validate</phase> + <goals> + <goal>reset</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-expression</artifactId> + <version>2.1-SNAPSHOT</version> + <configuration> + <outputFile>target/it.properties</outputFile> + <expressions> + <expression>project/build/plugins</expression> + </expressions> + </configuration> + <executions> + <execution> + <id>second</id> + <phase>validate</phase> + <goals> + <goal>eval</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.its.plugins</groupId> + <artifactId>maven-it-plugin-touch</artifactId> + <version>2.1-SNAPSHOT</version> + </plugin> + </plugins> + </build> + </profile> + </profiles> +</project> Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4416/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4416/pom.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision