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 2011/10/09 21:32:11 UTC

svn commit: r1180698 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-5137/ resources/mng-5137/consumer/ resources/mng-5137/producer/

Author: bentmann
Date: Sun Oct  9 19:32:10 2011
New Revision: 1180698

URL: http://svn.apache.org/viewvc?rev=1180698&view=rev
Log:
[MNG-5137] Reactor resolution does not work for forked multi module builds

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5137ReactorResolutionInForkedBuildTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/consumer/   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/consumer/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/producer/   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/producer/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=1180698&r1=1180697&r2=1180698&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 Sun Oct  9 19:32:10 2011
@@ -83,6 +83,7 @@ public class IntegrationTestSuite
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng5137ReactorResolutionInForkedBuildTest.class );
         suite.addTestSuite( MavenITmng5135AggregatorDepResolutionModuleExtensionTest.class );
         suite.addTestSuite( MavenITmng5096ExclusionAtDependencyWithImpliedClassifierTest.class );
         suite.addTestSuite( MavenITmng5064SuppressSnapshotUpdatesTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5137ReactorResolutionInForkedBuildTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5137ReactorResolutionInForkedBuildTest.java?rev=1180698&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5137ReactorResolutionInForkedBuildTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5137ReactorResolutionInForkedBuildTest.java Sun Oct  9 19:32:10 2011
@@ -0,0 +1,68 @@
+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.List;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-5137">MNG-5137</a>.
+ * 
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng5137ReactorResolutionInForkedBuildTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng5137ReactorResolutionInForkedBuildTest()
+    {
+        super( "[3.0.4,)" );
+    }
+
+    /**
+     * Verify that reactor resolution also works within a forked multi-module lifecycle, i.e. a lifecycle fork caused
+     * by an aggregator mojo. Here, reactor resolution needs to search the forked project instances for build output,
+     * not the project instances from the main build.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5137" );
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.deleteDirectory( "producer/target" );
+        verifier.deleteDirectory( "consumer/target" );
+        verifier.deleteArtifacts( "org.apache.maven.its.mng5137" );
+        verifier.executeGoal( 
+                "org.apache.maven.its.plugins:maven-it-plugin-fork:2.1-SNAPSHOT:fork-lifecycle-aggregator" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        List compile = verifier.loadLines( "consumer/target/compile.txt", "UTF-8" );
+
+        assertTrue( compile.toString(), compile.contains( "producer/pom.xml" ) );
+    }
+
+}

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5137ReactorResolutionInForkedBuildTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5137ReactorResolutionInForkedBuildTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/consumer/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/consumer/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/consumer/pom.xml?rev=1180698&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/consumer/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/consumer/pom.xml Sun Oct  9 19:32:10 2011
@@ -0,0 +1,67 @@
+<?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.mng5137</groupId>
+  <artifactId>consumer</artifactId>
+  <version>0.1</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-5137 :: Consumer</name>
+  <description>
+    Verify that reactor resolution also works within a forked multi-module lifecycle, i.e. a lifecycle fork caused
+    by an aggregator mojo. Here, reactor resolution needs to search the forked project instances for build output,
+    not the project instances from the main build.
+  </description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.its.mng5137</groupId>
+      <artifactId>producer</artifactId>
+      <version>0.1</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-dependency-resolution</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <compileClassPath>target/compile.txt</compileClassPath>
+          <significantPathLevels>2</significantPathLevels>
+        </configuration>
+        <executions>
+          <execution>
+            <id>resolve</id>
+            <phase>initialize</phase>
+            <goals>
+              <goal>compile</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/consumer/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/consumer/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/pom.xml?rev=1180698&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/pom.xml Sun Oct  9 19:32:10 2011
@@ -0,0 +1,41 @@
+<?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.mng5137</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-5137</name>
+  <description>
+    Verify that reactor resolution also works within a forked multi-module lifecycle, i.e. a lifecycle fork caused
+    by an aggregator mojo. Here, reactor resolution needs to search the forked project instances for build output,
+    not the project instances from the main build.
+  </description>
+
+  <modules>
+    <module>producer</module>
+    <module>consumer</module>
+  </modules>
+</project>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/producer/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/producer/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/producer/pom.xml?rev=1180698&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/producer/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/producer/pom.xml Sun Oct  9 19:32:10 2011
@@ -0,0 +1,58 @@
+<?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.mng5137</groupId>
+  <artifactId>producer</artifactId>
+  <version>0.1</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-5137 :: Producer</name>
+  <description>
+    Verify that reactor resolution also works within a forked multi-module lifecycle, i.e. a lifecycle fork caused
+    by an aggregator mojo. Here, reactor resolution needs to search the forked project instances for build output,
+    not the project instances from the main build.
+  </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-artifact</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>package</id>
+            <phase>initialize</phase>
+            <configuration>
+              <mainFile>pom.xml</mainFile>
+            </configuration>
+            <goals>
+              <goal>set</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/producer/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-5137/producer/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision