You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2008/12/19 11:23:53 UTC
svn commit: r727996 - in
/maven/core-integration-testing/trunk/core-it-suite/src/test:
java/org/apache/maven/it/ resources/mng-3925/ resources/mng-3925/test-1/
resources/mng-3925/test-1/sub/ resources/mng-3925/test-2/
resources/mng-3925/test-2/sub/
Author: bentmann
Date: Fri Dec 19 02:23:52 2008
New Revision: 727996
URL: http://svn.apache.org/viewvc?rev=727996&view=rev
Log:
[MNG-3925] [regression] Wrong order of plugin executions after merge with executions inherted from parent
o Added IT
Added:
maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3925MergedPluginExecutionOrderTest.java (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/pom.xml (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/sub/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/sub/pom.xml (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/pom.xml (with props)
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/sub/
maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/sub/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=727996&r1=727995&r2=727996&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 Fri Dec 19 02:23:52 2008
@@ -90,6 +90,7 @@
// suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
+ suite.addTestSuite( MavenITmng3925MergedPluginExecutionOrderTest.class );
suite.addTestSuite( MavenITmng3916PluginExecutionInheritanceTest.class );
suite.addTestSuite( MavenITmng3906MergedPluginClassPathOrderingTest.class );
suite.addTestSuite( MavenITmng3904NestedBuildDirInterpolationTest.class );
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3925MergedPluginExecutionOrderTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3925MergedPluginExecutionOrderTest.java?rev=727996&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3925MergedPluginExecutionOrderTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3925MergedPluginExecutionOrderTest.java Fri Dec 19 02:23:52 2008
@@ -0,0 +1,81 @@
+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.Arrays;
+import java.util.List;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-3925">MNG-3925</a>.
+ *
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class MavenITmng3925MergedPluginExecutionOrderTest
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng3925MergedPluginExecutionOrderTest()
+ {
+ }
+
+ /**
+ * Test that multiple plugin executions bound to the same phase by child and parent are executed in the proper
+ * order when no <pluginManagement> is involved.
+ */
+ public void testitWithoutPluginManagement()
+ throws Exception
+ {
+ testitMNG3925( "test-1" );
+ }
+
+ /**
+ * Test that multiple plugin executions bound to the same phase by child and parent are executed in the proper
+ * order when <pluginManagement> is involved.
+ */
+ public void testitWithPluginManagement()
+ throws Exception
+ {
+ testitMNG3925( "test-2" );
+ }
+
+ private void testitMNG3925( String project )
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3925" );
+
+ Verifier verifier = new Verifier( new File( new File( testDir, project ), "sub" ).getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "target" );
+ verifier.executeGoal( "validate" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ List lines = verifier.loadLines( "target/exec.log", "UTF-8" );
+ // Order is parent first and child appended, unless child overrides parent execution via equal id
+ List expected = Arrays.asList( new String[] { "parent-1", "parent-2", "child-default", "child-1", "child-2" } );
+ assertEquals( expected, lines );
+ }
+
+}
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3925MergedPluginExecutionOrderTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3925MergedPluginExecutionOrderTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/pom.xml?rev=727996&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/pom.xml Fri Dec 19 02:23:52 2008
@@ -0,0 +1,81 @@
+<?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.mng3925</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1</version>
+ <packaging>pom</packaging>
+
+ <name>Maven Integration Test :: MNG-3925</name>
+ <description>
+ Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with
+ parent executions.
+ </description>
+
+ <build>
+ <!-- This project does not use plugin management for the test plugin -->
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-log-file</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>parent-1</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/exec.log</logFile>
+ <string>parent-1</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>parent-2</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/exec.log</logFile>
+ <string>parent-2</string>
+ </configuration>
+ </execution>
+ <execution>
+ <!-- NOTE: <id> deliberately omitted to use default value -->
+ <phase>validate</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/exec.log</logFile>
+ <string>parent-default</string>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/sub/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/sub/pom.xml?rev=727996&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/sub/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/sub/pom.xml Fri Dec 19 02:23:52 2008
@@ -0,0 +1,83 @@
+<?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.mng3925</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1</version>
+ </parent>
+
+ <artifactId>child</artifactId>
+
+ <name>Maven Integration Test :: MNG-3925</name>
+ <description>
+ Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with
+ parent executions.
+ </description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-log-file</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>child-1</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/exec.log</logFile>
+ <string>child-1</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>child-2</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/exec.log</logFile>
+ <string>child-2</string>
+ </configuration>
+ </execution>
+ <execution>
+ <!-- NOTE: <id> deliberately omitted to use default value -->
+ <phase>validate</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/exec.log</logFile>
+ <string>child-default</string>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/sub/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-1/sub/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/pom.xml?rev=727996&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/pom.xml Fri Dec 19 02:23:52 2008
@@ -0,0 +1,83 @@
+<?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.mng3925</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1</version>
+ <packaging>pom</packaging>
+
+ <name>Maven Integration Test :: MNG-3925</name>
+ <description>
+ Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with
+ parent executions.
+ </description>
+
+ <build>
+ <!-- This project uses plugin management for the test plugin -->
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-log-file</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>parent-1</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/exec.log</logFile>
+ <string>parent-1</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>parent-2</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/exec.log</logFile>
+ <string>parent-2</string>
+ </configuration>
+ </execution>
+ <execution>
+ <!-- NOTE: <id> deliberately omitted to use default value -->
+ <phase>validate</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/exec.log</logFile>
+ <string>parent-default</string>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/sub/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/sub/pom.xml?rev=727996&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/sub/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/sub/pom.xml Fri Dec 19 02:23:52 2008
@@ -0,0 +1,83 @@
+<?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.mng3925</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.1</version>
+ </parent>
+
+ <artifactId>child</artifactId>
+
+ <name>Maven Integration Test :: MNG-3925</name>
+ <description>
+ Test that plugin executions (in the same phase) are properly ordered after inheritance/merge with
+ parent executions.
+ </description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.its.plugins</groupId>
+ <artifactId>maven-it-plugin-log-file</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>child-1</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/exec.log</logFile>
+ <string>child-1</string>
+ </configuration>
+ </execution>
+ <execution>
+ <id>child-2</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/exec.log</logFile>
+ <string>child-2</string>
+ </configuration>
+ </execution>
+ <execution>
+ <!-- NOTE: <id> deliberately omitted to use default value -->
+ <phase>validate</phase>
+ <goals>
+ <goal>log-string</goal>
+ </goals>
+ <configuration>
+ <logFile>target/exec.log</logFile>
+ <string>child-default</string>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/sub/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-3925/test-2/sub/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision