From b12cc9b647bd49d864c492d918c39f1f3a639719 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Tue, 25 Aug 2009 13:44:56 +0000 Subject: [PATCH] [MNG-4320] [regression] Aggregators invoked from CLI no longer resolve dependencies for all reactor projects o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@807626 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/it/IntegrationTestSuite.java | 1 + ...Tmng4320AggregatorAndDependenciesTest.java | 75 ++++++++++++++++++ .../src/test/resources/mng-4320/pom.xml | 56 +++++++++++++ .../apache/maven/its/mng4320/a/0.1/a-0.1.jar | Bin 0 -> 1958 bytes .../apache/maven/its/mng4320/a/0.1/a-0.1.pom | 38 +++++++++ .../maven/its/mng4320/a/maven-metadata.xml | 13 +++ .../apache/maven/its/mng4320/b/0.2/b-0.2.jar | Bin 0 -> 1959 bytes .../apache/maven/its/mng4320/b/0.2/b-0.2.pom | 38 +++++++++ .../maven/its/mng4320/b/maven-metadata.xml | 13 +++ .../resources/mng-4320/settings-template.xml | 43 ++++++++++ .../src/test/resources/mng-4320/sub-1/pom.xml | 43 ++++++++++ .../src/test/resources/mng-4320/sub-2/pom.xml | 43 ++++++++++ 12 files changed, 363 insertions(+) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4320AggregatorAndDependenciesTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-4320/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/a/0.1/a-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/a/0.1/a-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/a/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/b/0.2/b-0.2.jar create mode 100644 its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/b/0.2/b-0.2.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/b/maven-metadata.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4320/settings-template.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4320/sub-1/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4320/sub-2/pom.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 56f94af6f4..22ce46d9b2 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 @@ -87,6 +87,7 @@ public class IntegrationTestSuite // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 suite.addTestSuite( MavenITmng4321CliUsesPluginMgmtConfigTest.class ); + suite.addTestSuite( MavenITmng4320AggregatorAndDependenciesTest.class ); suite.addTestSuite( MavenITmng4318ProjectExecutionRootTest.class ); suite.addTestSuite( MavenITmng4317PluginVersionResolutionFromMultiReposTest.class ); suite.addTestSuite( MavenITmng4314DirectInvocationOfAggregatorTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4320AggregatorAndDependenciesTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4320AggregatorAndDependenciesTest.java new file mode 100644 index 0000000000..23b552bffb --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4320AggregatorAndDependenciesTest.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.List; + +/** + * This is a test set for MNG-4320. + * + * @author Benjamin Bentmann + */ +public class MavenITmng4320AggregatorAndDependenciesTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4320AggregatorAndDependenciesTest() + { + super( ALL_MAVEN_VERSIONS ); + } + + /** + * Verify that for aggregator mojos invoked from the CLI that require dependency resolution the dependencies + * of all projects in the reactor are resolved and not only the dependencies of the top-level project. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4320" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng4320" ); + verifier.getCliOptions().add( "-s" ); + verifier.getCliOptions().add( "settings.xml" ); + verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution:aggregate-test" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + List classpath; + + classpath = verifier.loadLines( "target/sub-1.txt", "UTF-8" ); + assertTrue( classpath.toString(), classpath.contains( "a-0.1.jar" ) ); + + classpath = verifier.loadLines( "target/sub-2.txt", "UTF-8" ); + assertTrue( classpath.toString(), classpath.contains( "b-0.2.jar" ) ); + + classpath = verifier.loadLines( "target/aggregator.txt", "UTF-8" ); + assertFalse( classpath.toString(), classpath.contains( "a-0.1.jar" ) ); + assertFalse( classpath.toString(), classpath.contains( "b-0.2.jar" ) ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-4320/pom.xml b/its/core-it-suite/src/test/resources/mng-4320/pom.xml new file mode 100644 index 0000000000..42575f5041 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4320/pom.xml @@ -0,0 +1,56 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4320 + aggregator + 0.1 + pom + + Maven Integration Test :: MNG-4320 + + Verify that for aggregator mojos invoked from the CLI that require dependency resolution the dependencies + of all projects in the reactor are resolved and not only the dependencies of the top-level project. + + + + sub-1 + sub-2 + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-dependency-resolution + 2.1-SNAPSHOT + + target/@artifactId@.txt + 1 + + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/a/0.1/a-0.1.jar b/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/a/0.1/a-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..4235e0176e4d2b535cac4ebd2b5bf3d1f0e815d8 GIT binary patch literal 1958 zcmWIWW@h1H00I6uNoz0zN^k;cU)K;vT~9wZ{Q#&k4hBA;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?Wz?_BYdVXYQDD$Ke_F}r?pxS zMMDoS-BIATXCebD;)*0s^|7G@Z*>pHF%OfxdzW$Cb5Os^y=H~L>EgUwn}l{O=w8L17|q4Kj7K^vI$uQp znpBE<$A?+huV|a9O!_J2VLU}PO6YiRjyo57j=P}RhuRCgetR`#0vmEIAI~oSv-14f z8*D9CE|~3D&+}ti;#y9P##OH-8BYv+cOol%{sr4!)h9v5U1_$Q6ILHKNVxTbdBe3` zcHjT5du?-#`Rfv`Ke~qhr)}w(EIs|etRL)wNtYWA$?JwMd0E7~MomXDTIkTE(u5Gx zZC}!Yzxz!*v}neSu+3Y4UzoDjCpy99yFo)s(vuEjZv`)zA2!~LQkeP!f0cfmaOm-y ze|2KZFZwcdSMP{Aay?K=H_7U3qL}^7Yuh#U&10D4afR)ER_X&`w>*&}e-iSx{XHA= zWu1v>TFp`8MXFuXL^)cQ%oI=4$qEt8@9E_|csf%+Yu)dMnK`fJ{pRKFe7Avr>!kBD zUS9B!4>3AkB-8%k%Zs9~RE~<0XB1@~s`Qr<}jNI#6=4O8^s`Yu%W7%vK@ohp< z{ub7!s#D)?`{KE0S?@FR*I)0ym{7jg?f#W>4N4~;x)%R)Wctb);LXS+!i>9M1$qex z1Q^~rf@q{-7N!k*K?_n00!tdzfh1fTQn8EAVo;d~0U(R_0hw?UU?n8XdhBH+Li1}( z%>+tJ+$Mv{Ob7ru%ajqrS$Itbm7p-Qv6rDR)0Z?hl594#L`Aj&R8OKOPlOenz=9hs dR0%jAWCbFz26(fwflOluLQ7yp5Y7tX0RS=Cn@Iow literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/a/0.1/a-0.1.pom b/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/a/0.1/a-0.1.pom new file mode 100644 index 0000000000..6c090f7b98 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/a/0.1/a-0.1.pom @@ -0,0 +1,38 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4320 + a + 0.1 + jar + + Maven Integration Test :: MNG-4320 + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/a/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/a/maven-metadata.xml new file mode 100644 index 0000000000..1a182c8826 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/a/maven-metadata.xml @@ -0,0 +1,13 @@ + + + org.apache.maven.its.mng4320 + a + 0.1 + + 0.1 + + 0.1 + + 20090825094828 + + diff --git a/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/b/0.2/b-0.2.jar b/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/b/0.2/b-0.2.jar new file mode 100644 index 0000000000000000000000000000000000000000..963ff7cab75e0a188a06b16a54546f2d70a00125 GIT binary patch literal 1959 zcmWIWW@h1H00H4RNoz0zN^k;cU)K;vT~9wZ{Q#&k4hA8hva`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?Wz?_BYdVXYQi7_hc5wT8J;rRi;ROT60Exn8s9hP70CEJlx5w~XTGn}eg3aI zZMlvf%+kHaB-LRvz+qG)ulaoqIFUzF8Y<^wied#o(LZ?gahozxnc8O2I9Ci4grCq;&&h>p) z-o^*oaRR!5xe=`ap0g?wk1uk)T9BK2g=PH`$BZ2>+ue7cv!BCs{o~(6`6yNSjRqU1 z+GVA5ezoBH=xM;aEbzziy9t3InmaQm8>yw2shPf!bUl#yNjh+Djm5Gvu_5yhO?jvt zCSj$&_``!M`}6?=?)ROYPI3G8 z<%P)Jp1NQs@BM!yC)8UM*e7k-A}Zr0`0~Qae+O1xpK;LT zoXd;*+waP+e_^>H;F07pew&vM7K9q6v_+RC_yH zwRX;tJ+{xxx}0xiL`ht)Z?=28gDpJ#T88VSKeLy8XVbHj->Mv`9s^0#s3=Cr^YGUBHqXEmR3O aA7lk0u?BdvvVlxv2SQ6=O%TBf;sF2&+lHk8 literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/b/0.2/b-0.2.pom b/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/b/0.2/b-0.2.pom new file mode 100644 index 0000000000..4988552815 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/b/0.2/b-0.2.pom @@ -0,0 +1,38 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4320 + b + 0.2 + jar + + Maven Integration Test :: MNG-4320 + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/b/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/b/maven-metadata.xml new file mode 100644 index 0000000000..ed4d3ef89e --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4320/repo/org/apache/maven/its/mng4320/b/maven-metadata.xml @@ -0,0 +1,13 @@ + + + org.apache.maven.its.mng4320 + b + 0.2 + + 0.2 + + 0.2 + + 20090825094837 + + diff --git a/its/core-it-suite/src/test/resources/mng-4320/settings-template.xml b/its/core-it-suite/src/test/resources/mng-4320/settings-template.xml new file mode 100644 index 0000000000..c985d1a689 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4320/settings-template.xml @@ -0,0 +1,43 @@ + + + + + + + + maven-core-it-repo + + + maven-core-it + @baseurl@/repo + + ignore + + + false + + + + + + + maven-core-it-repo + + diff --git a/its/core-it-suite/src/test/resources/mng-4320/sub-1/pom.xml b/its/core-it-suite/src/test/resources/mng-4320/sub-1/pom.xml new file mode 100644 index 0000000000..a16e447a5e --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4320/sub-1/pom.xml @@ -0,0 +1,43 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4320 + sub-1 + 0.1 + jar + + Maven Integration Test :: MNG-4320 :: Sub-1 + + Verify that for aggregator mojos invoked from the CLI that require dependency resolution the dependencies + of all projects in the reactor are resolved and not only the dependencies of the top-level project. + + + + + org.apache.maven.its.mng4320 + a + 0.1 + + + diff --git a/its/core-it-suite/src/test/resources/mng-4320/sub-2/pom.xml b/its/core-it-suite/src/test/resources/mng-4320/sub-2/pom.xml new file mode 100644 index 0000000000..61548c4504 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4320/sub-2/pom.xml @@ -0,0 +1,43 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4320 + sub-2 + 0.1 + jar + + Maven Integration Test :: MNG-4320 :: Sub-2 + + Verify that for aggregator mojos invoked from the CLI that require dependency resolution the dependencies + of all projects in the reactor are resolved and not only the dependencies of the top-level project. + + + + + org.apache.maven.its.mng4320 + b + 0.2 + + +