diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java index 3c2452a9fd..c7f62b20d0 100644 --- a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java @@ -85,6 +85,7 @@ public class IntegrationTestSuite // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class ); // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 + suite.addTestSuite( MavenITmng4357LifecycleMappingDiscoveryInReactorTest.class ); suite.addTestSuite( MavenITmng4355ExtensionAutomaticVersionResolutionTest.class ); suite.addTestSuite( MavenITmng4353PluginDependencyResolutionFromPomRepoTest.class ); suite.addTestSuite( MavenITmng4350LifecycleMappingExecutionOrderTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4357LifecycleMappingDiscoveryInReactorTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4357LifecycleMappingDiscoveryInReactorTest.java new file mode 100644 index 0000000000..ba6b724d51 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4357LifecycleMappingDiscoveryInReactorTest.java @@ -0,0 +1,72 @@ +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.Properties; + +/** + * This is a test set for MNG-4357. + * + * @author Benjamin Bentmann + */ +public class MavenITmng4357LifecycleMappingDiscoveryInReactorTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4357LifecycleMappingDiscoveryInReactorTest() + { + super( "[2.1.0,)" ); + } + + /** + * Test that different projects in a reactor build can use different versions of the same extension. + * This should still hold true if the two versions of the extension provide the same set of components. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4357" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteDirectory( "mod-a/target" ); + verifier.deleteDirectory( "mod-b/target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng4357" ); + Properties filterProps = verifier.newDefaultFilterProperties(); + verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", filterProps ); + verifier.getCliOptions().add( "--settings" ); + verifier.getCliOptions().add( "settings.xml" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + verifier.assertFilePresent( "mod-a/target/old.txt" ); + verifier.assertFileNotPresent( "mod-a/target/new.txt" ); + + verifier.assertFileNotPresent( "mod-b/target/old.txt" ); + verifier.assertFilePresent( "mod-b/target/new.txt" ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-4357/mod-a/pom.xml b/its/core-it-suite/src/test/resources/mng-4357/mod-a/pom.xml new file mode 100644 index 0000000000..c6df928259 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4357/mod-a/pom.xml @@ -0,0 +1,46 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4357 + mod-a + 0.1 + maven-core-it + + Maven Integration Test :: MNG-4357 :: Module A + + Test that different projects in a reactor build can use different versions of the same extension. + This should still hold true if the two versions of the extension provide the same set of components. + + + + + + org.apache.maven.its.mng4357 + extension + 0.1 + true + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4357/mod-b/pom.xml b/its/core-it-suite/src/test/resources/mng-4357/mod-b/pom.xml new file mode 100644 index 0000000000..0e91da9d71 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4357/mod-b/pom.xml @@ -0,0 +1,46 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4357 + mod-b + 0.1 + maven-core-it + + Maven Integration Test :: MNG-4357 :: Module B + + Test that different projects in a reactor build can use different versions of the same extension. + This should still hold true if the two versions of the extension provide the same set of components. + + + + + + org.apache.maven.its.mng4357 + extension + 0.2 + true + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4357/pom.xml b/its/core-it-suite/src/test/resources/mng-4357/pom.xml new file mode 100644 index 0000000000..b4aa3f16e0 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4357/pom.xml @@ -0,0 +1,40 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4357 + test + 0.1 + pom + + Maven Integration Test :: MNG-4357 + + Test that different projects in a reactor build can use different versions of the same extension. + This should still hold true if the two versions of the extension provide the same set of components. + + + + mod-a + mod-b + + diff --git a/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/0.1/extension-0.1.jar b/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/0.1/extension-0.1.jar new file mode 100644 index 0000000000..85506d674b Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/0.1/extension-0.1.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/0.1/extension-0.1.pom b/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/0.1/extension-0.1.pom new file mode 100644 index 0000000000..3d0d6ae10f --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/0.1/extension-0.1.pom @@ -0,0 +1,70 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4357 + extension + 0.1 + maven-plugin + + Maven Integration Test :: MNG-4357 :: Extension + + Test that different projects in a reactor build can use different versions of the same extension. + This should still hold true if the two versions of the extension provide the same set of components. + + 2009 + + + true + + + + + maven-core-it + file:///${basedir}/repo + + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/0.2/extension-0.2.jar b/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/0.2/extension-0.2.jar new file mode 100644 index 0000000000..22f34a99d9 Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/0.2/extension-0.2.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/0.2/extension-0.2.pom b/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/0.2/extension-0.2.pom new file mode 100644 index 0000000000..865bc81b25 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/0.2/extension-0.2.pom @@ -0,0 +1,70 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4357 + extension + 0.2 + maven-plugin + + Maven Integration Test :: MNG-4357 :: Extension + + Test that different projects in a reactor build can use different versions of the same extension. + This should still hold true if the two versions of the extension provide the same set of components. + + 2009 + + + true + + + + + maven-core-it + file:///${basedir}/repo + + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/maven-metadata.xml new file mode 100644 index 0000000000..4b84b226be --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/extension/maven-metadata.xml @@ -0,0 +1,15 @@ + + + org.apache.maven.its.mng4357 + extension + 0.1 + + 0.2 + 0.2 + + 0.1 + 0.2 + + 20090914144616 + + diff --git a/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/maven-metadata.xml new file mode 100644 index 0000000000..83b1ca62e5 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4357/repo/org/apache/maven/its/mng4357/maven-metadata.xml @@ -0,0 +1,10 @@ + + + + + Maven Integration Test :: MNG-4357 :: Extension + extension + extension + + + diff --git a/its/core-it-suite/src/test/resources/mng-4357/settings-template.xml b/its/core-it-suite/src/test/resources/mng-4357/settings-template.xml new file mode 100644 index 0000000000..cde4215860 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4357/settings-template.xml @@ -0,0 +1,55 @@ + + + + + + + + maven-core-it-repo + + + maven-core-it + @baseurl@/repo + + ignore + + + false + + + + + + maven-core-it + @baseurl@/repo + + ignore + + + false + + + + + + + maven-core-it-repo + +