From 6ed90963b1f5682c22a9334f480768242cb0667d Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sat, 30 May 2009 12:00:12 +0000 Subject: [PATCH] [MNG-4180] [regression] Dependency exclusions are applied globally o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@780248 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/it/IntegrationTestSuite.java | 1 + ...nITmng4180PerDependencyExclusionsTest.java | 75 +++++++++++++++++ .../src/test/resources/mng-4180/pom.xml | 79 ++++++++++++++++++ .../apache/maven/its/mng4180/a/0.1/a-0.1.jar | Bin 0 -> 1928 bytes .../apache/maven/its/mng4180/a/0.1/a-0.1.pom | 36 ++++++++ .../maven/its/mng4180/a/maven-metadata.xml | 13 +++ .../apache/maven/its/mng4180/b/0.1/b-0.1.jar | Bin 0 -> 1930 bytes .../apache/maven/its/mng4180/b/0.1/b-0.1.pom | 36 ++++++++ .../maven/its/mng4180/b/maven-metadata.xml | 13 +++ .../apache/maven/its/mng4180/c/0.1/c-0.1.jar | Bin 0 -> 1969 bytes .../apache/maven/its/mng4180/c/0.1/c-0.1.pom | 44 ++++++++++ .../maven/its/mng4180/c/maven-metadata.xml | 13 +++ .../resources/mng-4180/settings-template.xml | 55 ++++++++++++ 13 files changed, 365 insertions(+) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4180PerDependencyExclusionsTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-4180/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/a/0.1/a-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/a/0.1/a-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/a/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/b/0.1/b-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/b/0.1/b-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/b/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/c/0.1/c-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/c/0.1/c-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/c/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4180/settings-template.xml 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 a77914a0ee..28cbfee20b 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( MavenITmng4180PerDependencyExclusionsTest.class ); suite.addTestSuite( MavenITmng4172EmptyDependencySetTest.class ); suite.addTestSuite( MavenITmng4167PluginAndCoordXFormPOMTest.class ); suite.addTestSuite( MavenITmng4150VersionRangeTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4180PerDependencyExclusionsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4180PerDependencyExclusionsTest.java new file mode 100644 index 0000000000..97b4705e51 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4180PerDependencyExclusionsTest.java @@ -0,0 +1,75 @@ +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-4180. + * + * @author Benjamin Bentmann + */ +public class MavenITmng4180PerDependencyExclusionsTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4180PerDependencyExclusionsTest() + { + super( "[2.0.5,)" ); + } + + /** + * Test that dependency exclusions are not applied globally but are limited to the sub tree that is rooted at the + * dependency they are declared on. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4180" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng4180" ); + 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.mng4180:a:jar:0.1" ); + expected.add( "org.apache.maven.its.mng4180:b:jar:0.1" ); + expected.add( "org.apache.maven.its.mng4180:c:jar:0.1" ); + + assertEquals( expected, artifacts ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-4180/pom.xml b/its/core-it-suite/src/test/resources/mng-4180/pom.xml new file mode 100644 index 0000000000..add85a4028 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4180/pom.xml @@ -0,0 +1,79 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4172 + test + 0.1 + + Maven Integration Test :: MNG-4172 + + Test that exclusions defined on a dependency only affect the transitive dependencies of this dependency and not + other dependencies of the project. + + + + + org.apache.maven.its.mng4180 + a + 0.1 + + + + org.apache.maven.its.mng4180 + b + + + + + org.apache.maven.its.mng4180 + c + 0.1 + + + + + + + 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-4180/repo/org/apache/maven/its/mng4180/a/0.1/a-0.1.jar b/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/a/0.1/a-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..d4a6059a44e12c4024c10ad9d293c9561ed7643b GIT binary patch literal 1928 zcmWIWW@h1H0D-C5`>enWD8UJ&eO*Hwbv^yu^aG&EI2fh?m7Tqn#*_+_t_ETeWM#gN zex7cw!6ACSZl8V6oc8h7)w{^+t*dqJ%=yhh23L$9JT21kI(I_HTi1z${mGKBDPr0O zR4R7P=?)V14hk-rtF=}{hFfT|agb<@@adq>Kp8LNVy^>_{MPxc6R7K27w%tz$H4p9wOvO5wit~%o^%4sblQUBFz`FG^ON#Y!^U_TW zEe!COq(`DjiEy(x7gXl zE^^3c+oFWFSqD8Qo%L(%Tj9V}BD-?Iv?-Il6Gh^;w&|@}D8C^{@tQ^tAA`}6eLrh9 z`mE1SJgdD*Z-?BfjEduD+l+R!`K=O<2v!agxzm>_THq*N%73U-WSUQ;naQ@BT5)+i zC;S8+^5$n;yEN%UnzcezhINlhU-ZpBk-i&!Nqer%F(>=*L}!(~4u z+G4M>u3?w*2yL@YdMKM|c|Na}Df_d$OKVi~A$i^KB`>qM*C^^(MhhP5DoqI8y6sEa zJtP%lCm{Y+a;{&O^hU`~9Dt z{$kdA)HX){nfXhj*fTFpnp6Hgv5LR^^DN5*mqms@u4!=3Hz-=IAm(1Zd3OHyMdhyM zGd`Q1@0_L)9i}v8Qd!)Mtr-DVW1^)^4{B!!X65~QdU4%n{^bWsYw9cbdncWrG5dy> z{MAhdvSQkQ*vw$Ntnue@-Ubb=sX4Q^bexHzL zk#o9OtNU_0E4#ZDQgd7%zOIvSUGbY+yEEy}nGg}VKIJKUO+!BRat0mUw}0QXMO@M= zEp0Ept#B^i(^0*l&hPw<=W1M)g&o^gb-gXS%+>b3ex1Z$)g8Y?Z@C3#G$%j*u>M-$ zk9d`qD*aFSu-wW4E^GeB6m2aACh;;LwjnF27Zl|eq!yKArWT8y*~rywAkgs8w%~oi z13A4{39QSNmO88dW(wcCOw#9x59|H7yZ;_O)|V4h3Q`OLOB&UIBwQO(!HUmfP^kw2AdB|_ znQ#+eWgyIY?4=+=^J`4a1j + + + + + 4.0.0 + + org.apache.maven.its.mng4180 + a + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/a/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/a/maven-metadata.xml new file mode 100644 index 0000000000..6662d108e7 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/a/maven-metadata.xml @@ -0,0 +1,13 @@ + + + org.apache.maven.its.mng4180 + a + 0.1 + + + 0.1 + + 20090530112840 + + diff --git a/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/b/0.1/b-0.1.jar b/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/b/0.1/b-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..20dbac19cc237210ae21b600076e3ecf2df09884 GIT binary patch literal 1930 zcmWIWW@h1H0D-yL`>enWD8UJ&eO*Hwbv^yu^aG&EI2h&tm7Tqn#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)llK4=hDmFD`nX1}!22r(- zMU240hmlEy8F%3c^b!yVFuZjH(MUxpOdIyX6r>mgmNcpZNw_woq7|RTpmGlaKo;)< zGT|n`NV5CC$PDI^H5^z4q3PfTJ@MdKLnZ^!;mcYW^nia$Y0Qp>pBme*a literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/b/0.1/b-0.1.pom b/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/b/0.1/b-0.1.pom new file mode 100644 index 0000000000..d903e9818e --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/b/0.1/b-0.1.pom @@ -0,0 +1,36 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4180 + b + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/b/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/b/maven-metadata.xml new file mode 100644 index 0000000000..620fe01446 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/b/maven-metadata.xml @@ -0,0 +1,13 @@ + + + org.apache.maven.its.mng4180 + b + 0.1 + + + 0.1 + + 20090530112856 + + diff --git a/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/c/0.1/c-0.1.jar b/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/c/0.1/c-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..32b15b2a8d910fa060fa315d84a697319bc96ee4 GIT binary patch literal 1969 zcmWIWW@h1H0D&#p`>enWD8UJ&eO*Hwbv^yu^aG&EI2bkqm7Tqn#*_+_t_ETeWM#gN zex7cw!6ACSZl8V6oc8h7)w{^+t*dqJ%=yhh23L$9JT21kI(I_HTi1z${mGKBDPr0O zR4R7P=?)V14hk-rt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u2rYqiLK3h}U|;|M17VdW literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/c/0.1/c-0.1.pom b/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/c/0.1/c-0.1.pom new file mode 100644 index 0000000000..44401a1b0f --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/c/0.1/c-0.1.pom @@ -0,0 +1,44 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4180 + c + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + + + + + + org.apache.maven.its.mng4180 + b + 0.1 + + + diff --git a/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/c/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/c/maven-metadata.xml new file mode 100644 index 0000000000..ab44958706 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4180/repo/org/apache/maven/its/mng4180/c/maven-metadata.xml @@ -0,0 +1,13 @@ + + + org.apache.maven.its.mng4180 + c + 0.1 + + + 0.1 + + 20090530112938 + + diff --git a/its/core-it-suite/src/test/resources/mng-4180/settings-template.xml b/its/core-it-suite/src/test/resources/mng-4180/settings-template.xml new file mode 100644 index 0000000000..cde4215860 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4180/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 + +