From 5f17d0be2645b36ff389d641f98dd172fec7eddd Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Thu, 8 Jul 2010 20:42:05 +0000 Subject: [PATCH] [MNG-4720] Create an integration test to capture effects of exclusions from dependency management in combination with exclusions from regular dependencies git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@961926 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/it/IntegrationTestSuite.java | 1 + ...ependencyManagementExclusionMergeTest.java | 72 ++++++++++++++ .../src/test/resources/mng-4720/pom.xml | 90 ++++++++++++++++++ .../apache/maven/its/mng4720/a/0.1/a-0.1.jar | Bin 0 -> 2182 bytes .../apache/maven/its/mng4720/a/0.1/a-0.1.pom | 75 +++++++++++++++ .../apache/maven/its/mng4720/b/0.1/b-0.1.jar | Bin 0 -> 1961 bytes .../apache/maven/its/mng4720/b/0.1/b-0.1.pom | 38 ++++++++ .../apache/maven/its/mng4720/c/0.1/c-0.1.jar | Bin 0 -> 2000 bytes .../apache/maven/its/mng4720/c/0.1/c-0.1.pom | 46 +++++++++ .../apache/maven/its/mng4720/d/0.1/d-0.1.jar | Bin 0 -> 1961 bytes .../apache/maven/its/mng4720/d/0.1/d-0.1.pom | 38 ++++++++ .../resources/mng-4720/settings-template.xml | 43 +++++++++ 12 files changed, 403 insertions(+) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4720DependencyManagementExclusionMergeTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-4720/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/a/0.1/a-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/a/0.1/a-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/b/0.1/b-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/b/0.1/b-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/c/0.1/c-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/c/0.1/c-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/d/0.1/d-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/d/0.1/d-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4720/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 f92d26149b..08697d238b 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 @@ -82,6 +82,7 @@ public class IntegrationTestSuite // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class ); // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 + suite.addTestSuite( MavenITmng4720DependencyManagementExclusionMergeTest.class ); suite.addTestSuite( MavenITmng4696MavenProjectDependencyArtifactsTest.class ); suite.addTestSuite( MavenITmng4684DistMngtOverridenByProfileTest.class ); suite.addTestSuite( MavenITmng4679SnapshotUpdateInPluginTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4720DependencyManagementExclusionMergeTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4720DependencyManagementExclusionMergeTest.java new file mode 100644 index 0000000000..359f9cac9c --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4720DependencyManagementExclusionMergeTest.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.List; + +/** + * This is a test set for MNG-4720. + * + * @author Benjamin Bentmann + */ +public class MavenITmng4720DependencyManagementExclusionMergeTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4720DependencyManagementExclusionMergeTest() + { + super( "[2.0.6,)" ); + } + + /** + * Verify the effective exclusions applied during transitive dependency resolution when both the regular + * dependency section and dependency management declare exclusions for a particular dependency. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4720" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteArtifacts( "org.apache.maven.its.mng4720" ); + verifier.getCliOptions().add( "-s" ); + verifier.getCliOptions().add( "settings.xml" ); + verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + List classpath = verifier.loadLines( "target/classpath.txt", "UTF-8" ); + + assertTrue( classpath.toString(), classpath.contains( "a-0.1.jar" ) ); + assertTrue( classpath.toString(), classpath.contains( "c-0.1.jar" ) ); + + assertFalse( classpath.toString(), classpath.contains( "b-0.1.jar" ) ); + + // should better have been excluded as well, now it's a matter of backward-compat + assertTrue( classpath.toString(), classpath.contains( "d-0.1.jar" ) ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-4720/pom.xml b/its/core-it-suite/src/test/resources/mng-4720/pom.xml new file mode 100644 index 0000000000..3a61fab93b --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4720/pom.xml @@ -0,0 +1,90 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4720 + test + 0.1 + jar + + Maven Integration Test :: MNG-4720 + + Verify the effective exclusions applied during transitive dependency resolution when both the regular + dependency section and dependency management declare exclusions for a particular dependency. + + + + + + org.apache.maven.its.mng4720 + a + 0.1 + + + org.apache.maven.its.mng4720 + b + + + + + + + + org.apache.maven.its.mng4720 + a + + + + org.apache.maven.its.mng4720 + void + + + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-dependency-resolution + 2.1-SNAPSHOT + + target/classpath.txt + 1 + + + + resolve + validate + + compile + + + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/a/0.1/a-0.1.jar b/its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/a/0.1/a-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..5398fd0ffd236181e6337637e0f603ed915424b9 GIT binary patch literal 2182 zcmWIWW@h1H0D-`bFKoaJD8UJ&eO*Hwbv^yu^aG&EI2Zze%3Ah6=gk00*8{N#vNB&s zKTkK;;1E4ux6i(3PWyQ4>RsgZ*3~+9=KSU$gDb`lo)+nNojal9t?R_W{$xqm6fx}s zDiu5DbO#B02L+eR)mkee!!0z~I7qZc_;k=`pp2JsvDbk|ek&^@J9o|u*eDXaeoD>+ z)@4;}AKlva#O#S-fVm9Q1N_J?%S|jx&4YUbQ?U-F;{2j?y~KjV5*tsBHSzv218)rUS#dCoy5$*kOqtZQYWPeO#$sc~zJ9$Et6KV$U$R>Imy?y1u#n?Wv!Y-_$nf-u_fyAalFwe6onB z+5*)Vwud&Q7}hGyd^Jn6WvWd_OQsjw`DqtlSzgfBn!uFnt)-#z^GHy}(QxT&VHR|Q^C45WWM537ah+Xnx~5%H1W7H zAKE68<|AnqvduRzNr>M3F6Y~y>1x{&)CGbLFFd4Z{2;k!soDaTRT{pW}H4wp?USSYKNCxUw{M_Zr4mUQ;V=4d2^-Et0)!#d7V3eTU3yE|Gtw54x&$ zSu<*LdY>t4F-SL^u}&&dYU9ePwJQ!Q&AuIW^|Y;6YDO@B&x=0U6@fh>Gj)|Y7EAuw z)pIC=PyW!`_p{q|Ya;I5*S~)IgIUvA+dX&J+;6>IuzA^jQJw4Zxv%>R{^s#{_%1T~ z5uwFA-=OHSqmNthJ;wnfXY7t9NGB`nO`*yyoTw+y9--ylB!Fdm+-lXm4^;RHj~T@B}~6X`3FE ztoNVWnq$K$)#m3@e*fXE?-fRK*b~sGn-`>jodzrX*@51H%VqYu|C%YYbE>cR_JNI8YK=tUf`h{4|K~q(M-UD79YP!SiUgz>1eP?a z14+0xq-q6W0%jQwD)1oyWbr{D6K(>m_{Z&PPz3-1AkFW9Of=1S;{>0xKotT6fK0Yv zB+X<{^#F4<_6h=K`jW;LlFf!z7sytC+5zav6JbRrE2+*$O{@XltZX3D*n!ZJiGjf! G%mV=aClLq$ literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/a/0.1/a-0.1.pom b/its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/a/0.1/a-0.1.pom new file mode 100644 index 0000000000..71eed1ca7d --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/a/0.1/a-0.1.pom @@ -0,0 +1,75 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4720 + a + 0.1 + jar + + Maven Integration Test :: MNG-4720 + + + + maven-core-it + file:///${basedir}/repo + + + + + + + org.apache.maven.its.mng4720 + c + 0.1 + + + org.apache.maven.its.mng4720 + d + + + + + + + + org.apache.maven.its.mng4720 + b + 0.1 + + + org.apache.maven.its.mng4720 + c + + + + org.apache.maven.its.mng4720 + void + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/b/0.1/b-0.1.jar b/its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/b/0.1/b-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..9946d780adf4b493c554f11fa3d431ca2e933f25 GIT binary patch literal 1961 zcmWIWW@h1H0D-F;Uf6&cP=XUk`?`iW>U#RQ=?6fSaWGr~Dr?#QoHqj~T@S<}$jW>j z{XE@VgG2Ou-9G!CIql=Et9OytTUYDcne&^246YbIcv__6b?$_Yx2_Wh`;#SMQ^d3n zs8sBn(;X!29TZ$LS8J_^47bo^;~>!*;nP8%fihmk#a;&<`K_#s?A$psV53Ov`YAaR zSeI3?eRONv6SF6V0p>DH5AY+qEH|+%H4p9$OvO5wit~%o^%4sblQUBFz`FG^ON#Y! z^U_VsjSTRZq(`DjNpQ0`7%l??SIPf})>bA4hWjiG45lQTRgj;nSCN}j8WQb4$3dh{ z{h|GwNp=~V4rKY^hFH3gKoYu{6G|pT|6fpPwUwxjTI&-$&#F>`U-xu*6 zd>S2kNPAVAcj3c16~XKQDMrs1?I@7DwDb4Hojkdxw>6co%Z}b|<9soJFRCd{`ApWd zi|P}#?;5rmOkaCq=CY&$6Ypoo9o$0{SZ_@W3GnPXx#U8ZezdRn(*XX6g#y|lyFM}q z9obj0$7Ato>4=Y$HWlCFiM+Dsah0#&o<_e_;t_$0)1KeilB!zZC?3jxXq$+bkEGd^ zZTB?d)|j5~6L@I4er0%;hstN&327SETU7d_Z}y4s-RM*DdGLFI^qi_-i$x5#i;kH; z{}DVtdLu8#%7wWF@sb~O4@U_HFoj-KO;=icXX4d$b_=VeyiY7m6FFNYq!8Yocwoy% z_Jp;iweNn%Uawrk{>n4-M|9FZ-AqY!bG=5>kNk^{EMsi7k6Pz(`6*k3Z-mh{l@`_4 z2UcX|yga+?-CU(sSHq2K)3U!W)U2Ml?Lf!7L-wU>OtY2&rb);n0VV$~7Yx4tZY#CK1uHfBw_0$3No;w;HKM&r? z`8|8*i`dMpGe5f0UA#qfwFS65jrGq&Tv?%YPeNL{Y5HY_keKg>FW_ECBXDw2E?F(30@XKvNGP>nWPWO2L(m>1*t_PnW@FWW&UTqb-i>veFHsKg?#YU z@jm*FIU}RwO;Heh0;4-~n{N$;Z{waOk z4?Y{u>U&-H*75K;=W+EktK{P8kwI&w&z_!_l*e*qQbfq4nbT&(Fon!Ga+(!bFflTT zFyk&;fnEXv0fx7ZAR6vFgf{GDEl4p4ENN5+l5lNEB`?AR%wi5yCPDzn;)6gY+yqz& ziQCnnG7 + + + + + 4.0.0 + + org.apache.maven.its.mng4720 + b + 0.1 + jar + + Maven Integration Test :: MNG-4720 + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/c/0.1/c-0.1.jar b/its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/c/0.1/c-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..c290a489be91a3db6c8d802020d7212d3fae307c GIT binary patch literal 2000 zcmWIWW@h1H0D(IjUf6&cP=XUk`?`iW>U#RQ=?6fSaWLElDr?#QoHqj~T@S<}$jW>j z{XE@VgG2Ou-9G!CIql=Et9OytTUYDcne&^246YbIcv__6b?$_Yx2_Wh`;#SMQ^d3n zs8sBn(;X!29TZ$LS8J_^47bo^;~>!*;nP8%fihmk#a;&<`K_#s?A$psV53Ov`YAaR zSeI3?eRONv6SF6V0p>DH5AY+qEH|+%H4p9$OvO5wit~%o^%4sblQUBFz`FG^ON#Y! z^U_VsjSTRZq(`Dj$#Anc7_I{Y*D7X~)g2}VhDEFl45lQTRgj;nSCN}DHN@Bdwu8Xl z=uh=C+-w^}ZZj%wU35%?^-@%;%b|rGkB`l>;QqF5_wIu(q5rGXbJY!9WvVun+1;OQ z{`kY6r8*BJr#=gs!`t`gB16CuqsL12(s$0P-+O+r@`=?t;kpkt*LObC&tjHmkb*{&FM4OunjVxKJ7BOjFC|%MN6y&4T8d$T@EJfp1)q$ech(!js z*gXVhKe~L=X5Wq`RecTX$GgrhdS+^_-St2!YvsHI&(?@(g}0}P9$=L`#n$p#k%W$hza) zg3r8s`%QML-foz{c1`O0RL1zAH9U-}0jZ${YC)&oM!bC`ysLd(ON@lu#WjkIMK}4G z)7IEAXeY0_tgzzst#sai_*FJHgt*sbPP_c%l=23%e|{n>Of~*&eb$w>>juMW4)0T9 zEgKR{Z>)@pl-jtmdTqubCHY-__fFjvPqkmBYq01x{{lzDpcDf?1wXbArE`v)6nOXe z=l7d;W!@d%zWwn_n|)phW!&PMU#8mhrw3R0CfL*#%$5K6rHI4Bd6C(VAWiQ121VA6 zXR4|)?D9|;0#wS((&S@vE>$sm#eYIlnjIsak*R_S`&^PyL4;R9^3~3HjUk)WxtWMT_U#dA_a$RX6i( zmPZaHth=>&?qaioDlYTO`ElLLINwYvs|tF-D{SIby~Wr0lh&Fg&q}V(KIddM&z09% zf9dV-J2;u=z1^D~>het`Bfq(Szj#lbZp>fKoP`D(&aEr@;Q!K~Lfo@kSX^C{KCI8pEPreqcSiRU&_~SY~-f!1Es@lZ#R&I@6w;z_{Ilx8MdtZTNCBSS_2E?H9 z3tnVFay;HloU9MZE(JyT1*t_PnW@FWW&UTqb-i>veFHsKg?#YU@jm*FIU}RwO;Heh0d^5dZ{N$;Z{waOk4?Y{u>U&-H*75K; z=W+EktK{P8kwI&w&z_!_l*e*qQbfq4nbT&(Fon!GbD9-celaqMFyk(QfnEXv0fx7Z zAR6vFgf{F&GDtB9ENN5+l5lNE1vJ70%+e54bV2~g;)6gY+yq!birdwoq7(u^n%@DL zXqxfH2|j0midF~!nQXyGn#rJo7UpW~MJ>$qC5Q XSOdIS*+8bT1ED3bzGwv27Yqyl= + + + + + 4.0.0 + + org.apache.maven.its.mng4720 + c + 0.1 + jar + + Maven Integration Test :: MNG-4720 + + + + maven-core-it + file:///${basedir}/repo + + + + + + org.apache.maven.its.mng4720 + d + 0.1 + + + diff --git a/its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/d/0.1/d-0.1.jar b/its/core-it-suite/src/test/resources/mng-4720/repo/org/apache/maven/its/mng4720/d/0.1/d-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..a0183f31ea56d8b49c01d92dc7207e98085c9d64 GIT binary patch literal 1961 zcmWIWW@h1H0DU#RQ=?6fSaWE_cDr?#QoHqj~T@S<}$jW>j z{XE@VgG2Ou-9G!CIql=Et9OytTUYDcne&^246YbIcv__6b?$_Yx2_Wh`;#SMQ^d3n zs8sBn(;X!29TZ$LS8J_^47bo^;~>!*;nP8%fihmk#a;&<`K_#s?A$psV53Ov`YAaR zSeI3?eRONv6SF6V0p>DH5AY+qEH|+%H4p9$OvO5wit~%o^%4sblQUBFz`FG^ON#Y! z^U_VsjSTRZq(`DjDR8qm7#08nSL&(B$*oKb4EI?W7)(hvs~|sDuOc_6G$h)8j)O>@ z`a}CUlk74!9mw*z6>%izYOd#0UzY5eIjx)DXq>r_C}8gUzxq5wb>?ili8C#yzc1oD z_%u57koKxJ@4|<3DuUSqQjDH2+EE~PY3J{YJ9%<1*{b*nDrvdyC3k9@Ac70?J zI=sr_d7oICCUUk)NFlsE@xYdk z>8}5-w2~^DlMw7 z53I<_d3ko(ySYlOu7(@ere%L$s98O8+kuXEi42@aPY9+@bC_cBp>mqbNfx=qUtT{_ zY(0MS?_V9i#j{z&z87rmSijgL>PX3~!#Z`F*5(J+*fOe2T*15V>Zt?jJ$E!ZejdD& z^LzHr7qOXHXMS|0yLgM}Y720A8tb2lxUxd)o`ke?)AY*Z8G=s0eg$D>mR>r3x2QiA-??Vi`G^9H#BLqo%dn=_s_yfaLu6)=SARGJYK}%zUoide6`?Xx7rV(w9~riZYw?t;+b`1=;h5=PjIl z@!jqicDwW6*RR!b-YjIY{on8T-fsKF*46!77Vu#9@r|4Qhrc}VUteg^uHt9ru&m4h zE{hJWEv_j6rvEY^1{F;3vIvru@#fAHeNa9qD9SHLEh@=OEer~ zgRhSF*~d?V_)cnse$YA_Xs{u`z-W_^!B!)apn@`9zCZ&b1Cs|&wV(x;=>_8_PrdX{ z>Fa***?3mp>$tiXba zkx7IZci9T`5)cS5ymbW8aNi-cVJ~Yzia}sWqdJg;YeOn|5hh?3bD%O20zeiY1Tx_! zz)DEmt_GEn5CGEr4#-5)j5kj3ISW)~LIB8Q3r5mR29=;NS7R?jVWux>Y$4ffXo-q! l1*ob-Po4-XdVmEtDFK6?SOdIS*+8bT1ED3bB8XxI@c>o-tt + + + + + 4.0.0 + + org.apache.maven.its.mng4720 + d + 0.1 + jar + + Maven Integration Test :: MNG-4720 + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/mng-4720/settings-template.xml b/its/core-it-suite/src/test/resources/mng-4720/settings-template.xml new file mode 100644 index 0000000000..c985d1a689 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4720/settings-template.xml @@ -0,0 +1,43 @@ + + + + + + + + maven-core-it-repo + + + maven-core-it + @baseurl@/repo + + ignore + + + false + + + + + + + maven-core-it-repo + +