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 7288bcc20f..2564b1f751 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 @@ -91,6 +91,7 @@ public class IntegrationTestSuite // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class ); // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 + suite.addTestSuite( MavenITmng4203TransitiveDependencyExclusionTest.class ); suite.addTestSuite( MavenITmng4199CompileMeetsRuntimeScopeTest.class ); suite.addTestSuite( MavenITmng4196ExclusionOnPluginDepTest.class ); suite.addTestSuite( MavenITmng4193UniqueRepoIdTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4203TransitiveDependencyExclusionTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4203TransitiveDependencyExclusionTest.java new file mode 100644 index 0000000000..efc7d95dd3 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4203TransitiveDependencyExclusionTest.java @@ -0,0 +1,76 @@ +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.Collections; +import java.util.List; + +/** + * This is a test set for MNG-4203. + * + * @author Benjamin Bentmann + */ +public class MavenITmng4203TransitiveDependencyExclusionTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4203TransitiveDependencyExclusionTest() + { + super( ALL_MAVEN_VERSIONS ); + } + + /** + * Test that exclusions defined on a dependency apply to its transitive dependencies as well. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4203" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng4203" ); + verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.getCliOptions().add( "-s" ); + verifier.getCliOptions().add( "settings.xml" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + List artifacts = verifier.loadLines( "target/artifacts.txt", "UTF-8" ); + Collections.sort( artifacts ); + + List expected = new ArrayList(); + expected.add( "org.apache.maven.its.mng4203:b:jar:0.1" ); + expected.add( "org.apache.maven.its.mng4203:c:jar:0.1" ); + + assertEquals( expected, artifacts ); + + verifier.assertArtifactNotPresent( "org.apache.maven.its.mng4203", "a", "0.1", "pom" ); + verifier.assertArtifactNotPresent( "org.apache.maven.its.mng4203", "a", "0.1", "jar" ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-4203/pom.xml b/its/core-it-suite/src/test/resources/mng-4203/pom.xml new file mode 100644 index 0000000000..13f987c15b --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4203/pom.xml @@ -0,0 +1,72 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4203 + test + 0.1 + + Maven Integration Test :: MNG-4203 + + Test that exclusions defined on a dependency apply to its transitive dependencies as well. + + + + + org.apache.maven.its.mng4203 + c + 0.1 + + + + org.apache.maven.its.mng4203 + a + + + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-dependency-resolution + 2.1-SNAPSHOT + + + test + validate + + target/artifacts.txt + + + test + + + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/a/0.1/a-0.1.jar b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/a/0.1/a-0.1.jar new file mode 100644 index 0000000000..70f769b0b0 Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/a/0.1/a-0.1.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/a/0.1/a-0.1.pom b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/a/0.1/a-0.1.pom new file mode 100644 index 0000000000..7f1da477bc --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/a/0.1/a-0.1.pom @@ -0,0 +1,36 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4203 + a + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/a/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/a/maven-metadata.xml new file mode 100644 index 0000000000..a31e266134 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/a/maven-metadata.xml @@ -0,0 +1,13 @@ + + + org.apache.maven.its.mng4203 + a + 0.1 + + + 0.1 + + 20090616192508 + + diff --git a/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/b/0.1/b-0.1.jar b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/b/0.1/b-0.1.jar new file mode 100644 index 0000000000..f9c20340d5 Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/b/0.1/b-0.1.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/b/0.1/b-0.1.pom b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/b/0.1/b-0.1.pom new file mode 100644 index 0000000000..404a37f713 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/b/0.1/b-0.1.pom @@ -0,0 +1,44 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4203 + b + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + + + + org.apache.maven.its.mng4203 + a + 0.1 + + + diff --git a/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/b/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/b/maven-metadata.xml new file mode 100644 index 0000000000..dab0a47451 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/b/maven-metadata.xml @@ -0,0 +1,13 @@ + + + org.apache.maven.its.mng4203 + b + 0.1 + + + 0.1 + + 20090616192638 + + diff --git a/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/c/0.1/c-0.1.jar b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/c/0.1/c-0.1.jar new file mode 100644 index 0000000000..835f7a1108 Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/c/0.1/c-0.1.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/c/0.1/c-0.1.pom b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/c/0.1/c-0.1.pom new file mode 100644 index 0000000000..df614b7df0 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/c/0.1/c-0.1.pom @@ -0,0 +1,44 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4203 + c + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + + + + org.apache.maven.its.mng4203 + b + 0.1 + + + diff --git a/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/c/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/c/maven-metadata.xml new file mode 100644 index 0000000000..6a94969db9 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4203/repo/org/apache/maven/its/mng4203/c/maven-metadata.xml @@ -0,0 +1,13 @@ + + + org.apache.maven.its.mng4203 + c + 0.1 + + + 0.1 + + 20090616192658 + + diff --git a/its/core-it-suite/src/test/resources/mng-4203/settings-template.xml b/its/core-it-suite/src/test/resources/mng-4203/settings-template.xml new file mode 100644 index 0000000000..cde4215860 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4203/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 + +