From c0655913ab972c3708abfde6387031e551d009f4 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sat, 6 Dec 2008 17:24:49 +0000 Subject: [PATCH] [MNG-3890] Transitive dependencies override explicitly set scope o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@724015 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/it/IntegrationTestSuite.java | 1 + ...90TransitiveDependencyScopeUpdateTest.java | 61 +++++++++++ .../src/test/resources/mng-3890/pom.xml | 97 ++++++++++++++++++ .../apache/maven/its/mng3890/a/0.1/a-0.1.jar | Bin 0 -> 2993 bytes .../apache/maven/its/mng3890/a/0.1/a-0.1.pom | 60 +++++++++++ .../maven/its/mng3890/a/maven-metadata.xml | 12 +++ .../apache/maven/its/mng3890/b/0.1/b-0.1.jar | Bin 0 -> 3080 bytes .../apache/maven/its/mng3890/b/0.1/b-0.1.pom | 66 ++++++++++++ .../maven/its/mng3890/b/maven-metadata.xml | 12 +++ .../apache/maven/its/mng3890/c/0.1/c-0.1.jar | Bin 0 -> 3107 bytes .../apache/maven/its/mng3890/c/0.1/c-0.1.pom | 72 +++++++++++++ .../maven/its/mng3890/c/maven-metadata.xml | 12 +++ 12 files changed, 393 insertions(+) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3890TransitiveDependencyScopeUpdateTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-3890/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/a/0.1/a-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/a/0.1/a-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/a/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/b/0.1/b-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/b/0.1/b-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/b/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/c/0.1/c-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/c/0.1/c-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/c/maven-metadata.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 e8b6edb532..f419acdac2 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 @@ -73,6 +73,7 @@ public class IntegrationTestSuite // ------------------------------------------------------------------------------------------------------------- // Tests that currently don't pass for any Maven version, i.e. the corresponding issue hasn't been resolved yet // ------------------------------------------------------------------------------------------------------------- + // suite.addTestSuite( MavenITmng3890TransitiveDependencyScopeUpdateTest.class ); // suite.addTestSuite( MavenITmng3814BogusProjectCycleTest.class ); // suite.addTestSuite( MavenITmng3645POMSyntaxErrorTest.class ); // suite.addTestSuite( MavenITmng3391ImportScopeErrorScenariosTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3890TransitiveDependencyScopeUpdateTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3890TransitiveDependencyScopeUpdateTest.java new file mode 100644 index 0000000000..c4fbdb6c17 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3890TransitiveDependencyScopeUpdateTest.java @@ -0,0 +1,61 @@ +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-3890. + * + * @author Benjamin Bentmann + * @version $Id$ + */ +public class MavenITmng3890TransitiveDependencyScopeUpdateTest + extends AbstractMavenIntegrationTestCase +{ + + /** + * Test that transitive dependencies whose scope has been updated from "compile" to "provided" by a consumer + * remain in "provided" scope when depending on this consumer with scope "compile". + */ + public void testitMNG3890() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3890" ); + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng3890" ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + List artifacts = verifier.loadLines( "target/artifacts.txt", "UTF-8" ); + assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng3890:c:jar:0.1" ) ); + assertTrue( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng3890:b:jar:0.1" ) ); + assertFalse( artifacts.toString(), artifacts.contains( "org.apache.maven.its.mng3890:a:jar:0.1" ) ); + assertEquals( 2, artifacts.size() ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-3890/pom.xml b/its/core-it-suite/src/test/resources/mng-3890/pom.xml new file mode 100644 index 0000000000..79a48611b1 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3890/pom.xml @@ -0,0 +1,97 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3890 + test + 1.0 + + Maven Integration Test :: MNG-3890 + + Test that transitive dependencies whose scope has been updated from "compile" to "provided" by a consumer + remain in "provided" scope when depending on this consumer with scope "compile". + + + + + + + maven-core-it + file:///${basedir}/repo + + ignore + + + ignore + + + + + + + org.apache.maven.its.mng3890 + c + 0.1 + compile + + + + + + + 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-3890/repo/org/apache/maven/its/mng3890/a/0.1/a-0.1.jar b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/a/0.1/a-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..15d0163fff7411b2b4f353c821d008d602f5b383 GIT binary patch literal 2993 zcmWIWW@h1H00EKSHcK!AN^k;cU)K;vT~9wZ{Q#&k4hCVMva`3+m{Nh#)j%wQtjyQZ z&(qB{I7H9a?X&Nh(>~t1dKY=Ub+yi&Ilno`;EM5sr$stm=T7K&>pF3;KUoqsMNIpE zO2y7O-9f_MLBS<+wbqKra0^W~4ic>qJ{|NKDC1>Z>~-Lg-#Wi_0(D*M!oAE+6d2n! zS1=dH>BZ?WpgQaQtF_H0%nS@?*ccetfzB$(&(*8Q&1ns}-FMkQptgTXy@Zxr#1`LE zPZJvjLK3u<7ECpZ73j}1@;$4zZR6atVIB49bG&EoRhXwFfBxwi%f~M7^HvG13zXJ7 zdi&(&1T#jFnP+xt-1F1B-u?3Clh`-a`^0T$`PIJXJ|7@)=AhRG>z18KlC?oQxAI=* z;EwE`6RE}K|Lo->mKPmTOC0V`meTSxoGB9a**BL{V|Ud7uHJ}+8`Ky)1aCh&ebwq` z0bg`nP}w=(>8@v`^U6gI@|pz2ADqUu(dPL&UF}A0rd88g-e>B}D7zdGz4iK@8<7)w z7c`c~1g_sItrW}S;uF3t+tc`6>fL^WS=+=PitH=hb?|cno4>|^?`nVVK6&ChJ9?un zN9IDaiZwhHlNWAsnc@+;>WNRvl-vHLEBxQoeNlaK%&05vt$@Pz#|8=4ell;^9JZJ5 z@Ul#%YeKwB^bRF%_`sdH)93thmupAkyM%ffd-rFp^SpdkZibSc~v|-yhE>;?AA<^pIo{r>QW}-=coMlf6vjepT{)G;|g2;l(H|K%H>>1cDH6P+<&|K zn&@JK$I46~`k*ihuPtH8Jq$_qYhed9kYL|HWdX3_atl$~j zYEBz@r;D{N4z9j!f44%+ru)!qXX9N9Uxlw(AozH`kNd-qH-arAoF(IDDumwoon8Dg zZ1JSF%fffRb0pgIM{l~^Gw==KlpY21<@|2^2#2O zKjFR2Mq$@I7`Jbj=Tgz`D)Mh~iTS2!Da)T`v~kVdA=b-#Ml`&3^X?4!80}xB4_T*q zJQ4oY&2#77L)n?pZ>@X-71#EhVB{-))24*T}&y}_4U%-6n*3!(|bA%cv zCtCCz2UMMG~z+xL!t?Yp$&FV256AwzD~ z)403J1}m&IZp^x1e|SGEV__Bx{K)w|H?b@=4_-K6D%QbNoL`i#mspUPoRO*r)~%OW zQmmJomu_rfX@JKhJrYeygqy{|zz;04kjn;BlFb?|Nk&VO(UOFsl7s`?z=(R*BwYl| zex*QcLsm8{D9SHLEh@=OEfzg-k1$Hc&(3u=)w003ZLiY5R6 literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/a/0.1/a-0.1.pom b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/a/0.1/a-0.1.pom new file mode 100644 index 0000000000..c96c1bc35f --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/a/0.1/a-0.1.pom @@ -0,0 +1,60 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3890 + a + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + true + + + + + true + true + + + + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/a/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/a/maven-metadata.xml new file mode 100644 index 0000000000..ee8bc884be --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/a/maven-metadata.xml @@ -0,0 +1,12 @@ + + org.apache.maven.its.mng3890 + a + 0.1 + + 0.1 + + 0.1 + + 20081206164039 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/b/0.1/b-0.1.jar b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/b/0.1/b-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..01d42fdb08755eecceea93bdd705a9f9870e39f8 GIT binary patch literal 3080 zcmWIWW@h1H0D*|!HcK!AN^k;cU)K;vT~9wZ{Q#&k4u)``va`3+m{Nh#)j%wQtjyQZ z&(qB{I7H9a?X&Nh(>~t1dKY=Ub+yi&Ilno`;EM5sr$stm=T7K&>pF3;KUoqsMNIpE zO2y7O-9f_MLBS<+wbqKra0^W~4ic>qJ{|NKDC1>Z>~-Lg-#Wi_0(D*M!oAE+6d2n! zS1=dH>BZ?WpgPN(Kh-dvnSr5=oq+*}7z*-p^(u06riS|V-!>E2%YC7KhLo+!!Kjj3 za+ksaAE;%AWMnaG=Qqn_X6hJgPvr7kdrjlled{GE(Yx<0cyaPUf!)38&o0N`%e~@y z7bv~($?co3GYpxh?9^(}xqmKi`|6*wZ|+v%Ii&C}&yK&jU&%dl1HZrDKLjaX(^%WdVB~VY zX79~q@7E{lYpv32dAT~HLj6snQA?xWOY0lK%5frxdY_7NcsAZ@=3wqsz23*$o7)#P zg`IoVWS1WbQnR*}s%*N-apX(x?} z^*=p(_S34_ap@a&Hh!P|wY_9^-nEjbgGGNWdH#7^mtV)=sUp?P-&^*9b8!JzlHtd* z7WaQ1%0Fr{qkHd(&S^T)aY|FVZ1m^qN?qA%kk{MxKs2Q#Dk5J_m`!}nB7+&{f4^UN z@fG(ov%*Wqw`y&WdNbjVi0&fSGjd0Ni5^`VmOELDGdC?J=V;kQJ5@sO ze1D$(GAwy<&jSB17A_iUT}PVdKK~+lzO{Fz#<}fl*9kq(+obUO-+S5R;Z85=XJm^Q zmsg&f@+iA|u~FD|56=E1W{z(xu4ndf?pnS^bnRs>ljQcenC@e4&-_ddZ&-d&acAy} zmxrX+OgOOoOIObgy+^h)+#gr@Zgkw#b4FdjZ)4}A|M%JU3D0@M^rGIO{B3qsvw!O|OFi-0^NhwTth8Rd zHMUXs&jibZm?a25a?y~RSeBXxFGnyH>tHI*FG|--EJ#ewNYw-D*2^p@*2~RHH@2`e zz+;jgi6$k%&EjD20G4jZ#fT}%W{nm)qlM0Bp+m1ihXdSfVJujvTMW#pr9f;$R*o$w z$}dPQD#=VO7Cp0<>yUu}!-KyH?+Y&2#?-Iadco6GX3iJZbuT52O*CI_eQMe>H~dc~uSIhhBZZ_(YJ>2WhU z?#AAu=l&mMi+w9odsp@(Lpra1*{|lsjlklEkx7IZcPk9&BOnl9cJ~00_Oj}fZalQhDL d?HuG-fk@y1-mGjO(>Q=IkBNby1=P@I000jDt6=~D literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/b/0.1/b-0.1.pom b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/b/0.1/b-0.1.pom new file mode 100644 index 0000000000..78699ab868 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/b/0.1/b-0.1.pom @@ -0,0 +1,66 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3890 + b + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + true + + + + + true + true + + + + + org.apache.maven.its.mng3890 + a + 0.1 + compile + + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/b/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/b/maven-metadata.xml new file mode 100644 index 0000000000..1fdf3e9348 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/b/maven-metadata.xml @@ -0,0 +1,12 @@ + + org.apache.maven.its.mng3890 + b + 0.1 + + 0.1 + + 0.1 + + 20081206164247 + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/c/0.1/c-0.1.jar b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/c/0.1/c-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..de9dc32c82788914668c788c013dac7d1a09e2ac GIT binary patch literal 3107 zcmWIWW@h1H0D~t1dKY=Ub+yi&Ilno`;EM5sr$stm=T7K&>pF3;KUoqsMNIpE zO2y7O-9f_MLBS<+wbqKra0^W~4ic>qJ{|NKDC1>Z>~-Lg-#Wi_0(D*M!oAE+6d2n! zS1=dH>BZ?WAe;qq{oktn_j8#U7#ukm7}$Z%D#*{(tH{mS8XDby*-D_Uf69M@kmrmS z%=BdBcC;*zyV1pwvD8=m$l}>P!J9i}bJ90o75qQ9P%n3yo|D2ykxHBC`TKqzHPRu&-%gZN+PkjF~t|H&+>)!85u9*hRs}H;rcqZ!q za`K9`xjWnvaB#b%NeguCXw1 zCe5zd8FhU9`9y85u5&Ff7p+IFfdrW4C^^@5>_+vYqM392IoEvNKZR9_S!(|^C*kF@Z9jBvSW@H6 z!F{hG`D*V{S+mf56GNTP#`ld6?>O#kdC7!faoKS`7m?+iKF>IhoMiboTfMM|ZT_RL zx34~xvOBA<_w00O&AbDznBvw?%YRh5C+bor9&-(&oYYPODbQc1TNHTElf6H(N|WSa%kHl!+qtKf*(|0 z&fLyFH7wp>>%_%&I-zZ@`t2_~4Y<=3cc;E~6L}VOHFS=v$;?C#)%|Xg96@!OpX=w_ zEk1E@HSfb)UAq3db1zTm^?RGUf7eBw3Xx5(oeg&_d=qZ7Tx_v^O#7RPHw$IloCW1~ zsD$15w{>I5>Wx8e7rNe6bKi6k+nTUkbM42F8xuO;R7Ag4Dte{HxvBo&{emjhmVd`$ z7ERcBdhv3R_-vUO8+W-C?MQv?xIsRk<<0U1yQghkR2bEmcH+Xs?29)J#B{FG|F(E* z`8w^YT_2dZRX!N*Rbt*IT+RM0Y-eBanh7e(mjzpzbB{cEe|iD0H1GWR9t*$zSSfQW z+W9=Y8_Vyglo_pStoc*sGyL_wU|!F6*LJ$f#&`vJNw>{6uPi#z_sMM4wU>!r%9jsb zde^Z`wEPqIoNsN1PdK00vSM@Kyp5)-LL@KnPZL{ee&=Os$tgLzJ*QtLNIy(bcc^E) zyHx+>_d*Vn@~=gczGoQNu4Zmt`|0=g_tvl+iCLcTBNr68iDjvI@KOa+u@0u<{GxQd z#Dc`+j8r|aZoSNsV!hnFbYlxk13V__k!Vsf+$;`;0<=QKlw`9;i=fdWXtW3#m?DS+ z+@vx5IcIMXFyEE}u?<=Ix1cD$AhoC@GqqUs%t5Y020RQGsulhV+}N99RmxWuB*;JS z3wx4yHh;Ez82i7yRrPybt?~5j;`{RBLa3N8$5mf0*{j0&EAN&1UjEp|x7>Q|jOZ5E z+&;^%Z?akve%i*i*+mx^b=I$x{@>l5T9(Z9y6ikhlB(U&>GEGV;sd-HnM9azH_(6{ z0s;Ysw~inhsksKzhP}ZCQVar18r6X$TpLpJ4Ph}P7}48SVC`TN_5n#~F^ABES)zlA ze+U4%Hh=}mT3BTOb2Fx9P<4RNT#KohK;?kjWKi{hF!?x%CW9&qnAzB?3z+Fk8iiRg xyo}e?$@&Q=IkBNa{KBy1C007NZxibI& literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/c/0.1/c-0.1.pom b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/c/0.1/c-0.1.pom new file mode 100644 index 0000000000..e965ab4316 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/c/0.1/c-0.1.pom @@ -0,0 +1,72 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3890 + c + 0.1 + jar + + + + maven-core-it + file:///${basedir}/repo + true + + + + + true + true + + + + + org.apache.maven.its.mng3890 + a + 0.1 + provided + + + org.apache.maven.its.mng3890 + b + 0.1 + compile + + + + + + + . + + pom.xml + src/** + + + + src/main/resources + + + + diff --git a/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/c/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/c/maven-metadata.xml new file mode 100644 index 0000000000..13aaa331ca --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3890/repo/org/apache/maven/its/mng3890/c/maven-metadata.xml @@ -0,0 +1,12 @@ + + org.apache.maven.its.mng3890 + c + 0.1 + + 0.1 + + 0.1 + + 20081206164405 + + \ No newline at end of file