From b042397e85b0bb8cca4c5f3e14dc9658faa9b3b5 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 23 Oct 2009 10:52:40 +0000 Subject: [PATCH] [MNG-4400] [regression] Repository order from settings.xml is not respected during artifact resolution o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@828997 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/it/IntegrationTestSuite.java | 1 + .../it/MavenITmng4400RepositoryOrderTest.java | 89 ++++++++++++++++++ .../resources/mng-4400/pom/pom-template.xml | 86 +++++++++++++++++ .../maven/its/mng4400/dep/0.1/dep-0.1.jar | Bin 0 -> 2008 bytes .../maven/its/mng4400/dep/0.1/dep-0.1.pom | 40 ++++++++ .../maven/its/mng4400/dep/0.1/dep-0.1.jar | Bin 0 -> 2008 bytes .../maven/its/mng4400/dep/0.1/dep-0.1.pom | 40 ++++++++ .../test/resources/mng-4400/settings/pom.xml | 63 +++++++++++++ .../mng-4400/settings/settings-template.xml | 53 +++++++++++ 9 files changed, 372 insertions(+) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4400RepositoryOrderTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-4400/pom/pom-template.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4400/repo-1/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-4400/repo-1/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4400/repo-2/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.jar create mode 100644 its/core-it-suite/src/test/resources/mng-4400/repo-2/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4400/settings/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4400/settings/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 72adc475f2..bc759ef08d 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 @@ -85,6 +85,7 @@ public class IntegrationTestSuite // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class ); // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 + suite.addTestSuite( MavenITmng4400RepositoryOrderTest.class ); suite.addTestSuite( MavenITmng4396AntBasedMojoSupportTest.class ); suite.addTestSuite( MavenITmng4393ParseExternalParenPomLenientTest.class ); suite.addTestSuite( MavenITmng4387QuietLoggingTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4400RepositoryOrderTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4400RepositoryOrderTest.java new file mode 100644 index 0000000000..9ac525a25d --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4400RepositoryOrderTest.java @@ -0,0 +1,89 @@ +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.Properties; + +/** + * This is a test set for MNG-4400. + * + * @author Benjamin Bentmann + */ +public class MavenITmng4400RepositoryOrderTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4400RepositoryOrderTest() + { + super( ALL_MAVEN_VERSIONS ); + } + + /** + * Verify that repositories declared in the settings.xml are accessed in their declaration order. + */ + public void testitSettingsRepos() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4400" ); + + Verifier verifier = new Verifier( new File( testDir, "settings" ).getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteArtifacts( "org.apache.maven.its.mng4400" ); + 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(); + + Properties checksums = verifier.loadProperties( "target/checksum.properties" ); + assertChecksum( "d0a4998ff37a55f8de1dffccdff826eca365400f", checksums ); + } + + /** + * Verify that repositories declared in the POM are accessed in their declaration order. + */ + public void testitPomRepos() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4400" ); + + Verifier verifier = new Verifier( new File( testDir, "pom" ).getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteArtifacts( "org.apache.maven.its.mng4400" ); + verifier.filterFile( "pom-template.xml", "pom.xml", "UTF-8", verifier.newDefaultFilterProperties() ); + verifier.executeGoal( "validate" ); + verifier.verifyErrorFreeLog(); + verifier.resetStreams(); + + Properties checksums = verifier.loadProperties( "target/checksum.properties" ); + assertChecksum( "d0a4998ff37a55f8de1dffccdff826eca365400f", checksums ); + } + + private void assertChecksum( String checksum, Properties checksums ) + { + assertEquals( checksum, checksums.getProperty( "dep-0.1.jar" ).toLowerCase( java.util.Locale.ENGLISH ) ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-4400/pom/pom-template.xml b/its/core-it-suite/src/test/resources/mng-4400/pom/pom-template.xml new file mode 100644 index 0000000000..e50f64ab49 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4400/pom/pom-template.xml @@ -0,0 +1,86 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4400 + test + 0.1 + + Maven Integration Test :: MNG-4400 + + Verify that repositories declared in the POM are accessed in their declaration order. + + + + + maven-core-it-1 + @baseurl@/../repo-1 + + ignore + + + false + + + + maven-core-it-2 + @baseurl@/../repo-2 + + ignore + + + false + + + + + + + org.apache.maven.its.mng4400 + dep + 0.1 + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-dependency-resolution + 2.1-SNAPSHOT + + + validate + + compile + + + target/checksum.properties + 1 + + + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4400/repo-1/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.jar b/its/core-it-suite/src/test/resources/mng-4400/repo-1/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..a49aa501a4689570d5ab040d198c715ca509fee9 GIT binary patch literal 2008 zcmWIWW@h1H0D-8)aBDCFN^k;cU)K;vT~9wZ{Q#&k4u(jeva`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?_BYdVXYQ`B*{QQb<9u5A%~QV(tovh*mmV^o_uT5bjr+ol49W-J2u$NW z{ZfBw^ku`=4U^Vt%vhN8A#diozJ|UP4qPR&D;G=?ne3e?a(_#k-l~Oi8-f(CY4m(! z3_7x}V$-=t-P$)kb#3Ba*RI3#e#gx~mg^ThzcOzN=@4bzzF`fM-it-=Ja_aRnxuJ~ z_n=wz(bIDoZ*pc;9G5;y%wDj)|I4~(F~jwl zz4@CL_t)l~{id*_G3>E->Vf4l(#|fOA$LRObj~R{zHZ)Y;oa>UTkc4>U0jpT^yHfX z&y0=#7~b?``ZX_jZ8iU^OYO>230XQj)O06*Ii|vqV-uY$=%ezFxp57__lJb3_roNHykrj6jGYEA}RNkD*RcO`hf7-=xFmu}eC+Fe>Cnf}pg;bpFAC!1f_^iDo)snF?S@Z*Yx_k4?@)e2(l z#l{bB?|cz^k@s26>EbN!DZ1K%UY^GKZz4=qWUX76`>pH*+zDq{Iy&hqKaF@Xncc$oJDt zX@TDd?3Oyr)xI}lA=ices0X)gS03Q$^;R}re)j1Wtum&Fd6W5{=<#yAJR&MGBRq#? zQrDNyzjqyceTey*iEK&vVHU|`dq(A)A3a;;^I!Cd2db7L26M+W@@qMnT=eB3TW(mU$Gnx;NER)jwlRSm3EB{X{Jx z-q26^W}o*PuGCFCS12K{RVnkO>%PAU4^~|j5AbGW5@E(&2m?I@1Og0i9YHiwkqpy@ zy-)@z27x7w>Oc~%4XKF6XECV!gaDAm`+!Wi39!->WDbF#nE6W@o5?U8TKXbF7JDK^ShAUgbT5D`K_uA#Z&o&tdF()F N53D$vffWY>0{~YAt)c(` literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/mng-4400/repo-1/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.pom b/its/core-it-suite/src/test/resources/mng-4400/repo-1/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.pom new file mode 100644 index 0000000000..0e61b0e866 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4400/repo-1/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.pom @@ -0,0 +1,40 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4400 + dep + 0.1 + + Maven Integration Test :: MNG-4400 + + Verify that repositories are accessed in their declaration order. + + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/mng-4400/repo-2/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.jar b/its/core-it-suite/src/test/resources/mng-4400/repo-2/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..d2dbfb7fb732b75e3046f62e78e32e4cdf3475bd GIT binary patch literal 2008 zcmWIWW@h1H0D+9eaBDCFN^k;cU)K;vT~9wZ{Q#&k4u*7~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?_BYdVXYQ`B*{QQb<9u5A%~QV(tovh*mmV^o_uT5bjr+ol49W-J2u$NW z{ZfBw^ku`=4U^Vt%vhN8A#diozJ|UP4qPR&D;G=?ne3e?a(_#k-l~Oi8-f(CY4m(! z3_7x}V$-=t-P$)kb#3Ba*RI3#e#gx~mg^ThzcOzN=@4bzzF`fM-it-=Ja_aRnxuJ~ z_n=wz(bIDoZ*pc;9G5;y%wDj)|I4~(F~jwl zz4@CL_t)l~{id*_G3>E->Vf4l(#|fOA$LRObj~R{zHZ)Y;oa>UTkc4>U0jpT^yHfX z&y0=#7~b?``ZX_jZ8iU^OYO>230XQj)O06*Ii|vqV-uY$=%ezFxp57__lJb3_roNHykrj6jGYEA}RNkD*RcO`hf7-=xFmu}eC+Fe>Cnf}pg;bpFAC!1f_^iDo)snF?S@Z*Yx_k4?@)e2(l z#l{bB?|cz^k@s26>EbN!DZ1K%UY^GKZz4=qWUX76`>pH*+zDq{Iy&hqKaF@Xncc$oJDt zX@TDd?3Oyr)xI}lA=ices0X)gS03Q$^;R}re)j1Wtum&Fd6W5{=<#yAJR&MGBRq#? zQrDNyzjqyceTey*iEK&vVHU|`dq(A)A3a;;^I!Cd2db7L26M+W@@qMnT=eB3?$v#;M$70%`0RRrvt{(sZ literal 0 HcmV?d00001 diff --git a/its/core-it-suite/src/test/resources/mng-4400/repo-2/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.pom b/its/core-it-suite/src/test/resources/mng-4400/repo-2/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.pom new file mode 100644 index 0000000000..0e61b0e866 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4400/repo-2/org/apache/maven/its/mng4400/dep/0.1/dep-0.1.pom @@ -0,0 +1,40 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4400 + dep + 0.1 + + Maven Integration Test :: MNG-4400 + + Verify that repositories are accessed in their declaration order. + + + + + maven-core-it + file:///${basedir}/repo + + + diff --git a/its/core-it-suite/src/test/resources/mng-4400/settings/pom.xml b/its/core-it-suite/src/test/resources/mng-4400/settings/pom.xml new file mode 100644 index 0000000000..826254ca34 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4400/settings/pom.xml @@ -0,0 +1,63 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4400 + test + 0.1 + + Maven Integration Test :: MNG-4400 + + Verify that repositories declared in the settings.xml are accessed in their declaration order. + + + + + org.apache.maven.its.mng4400 + dep + 0.1 + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-dependency-resolution + 2.1-SNAPSHOT + + + validate + + compile + + + target/checksum.properties + 1 + + + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4400/settings/settings-template.xml b/its/core-it-suite/src/test/resources/mng-4400/settings/settings-template.xml new file mode 100644 index 0000000000..4ea50f3553 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4400/settings/settings-template.xml @@ -0,0 +1,53 @@ + + + + + + + + maven-core-it-repo + + + maven-core-it-1 + @baseurl@/../repo-1 + + ignore + + + false + + + + maven-core-it-2 + @baseurl@/../repo-2 + + ignore + + + false + + + + + + + maven-core-it-repo + +