From 30e247f191b5fe59b08b6029c3d13ed831e837ed Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Fri, 23 Oct 2009 18:04:43 +0000 Subject: [PATCH] [MNG-4401] [regression] central repository is tried before explicitly declared repositories during parent POM resolution o Added IT git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@829154 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/it/IntegrationTestSuite.java | 1 + ...ng4401RepositoryOrderForParentPomTest.java | 65 +++++++++++++++++++ .../src/test/resources/mng-4401/pom.xml | 41 ++++++++++++ .../its/mng4401/parent/0.1/parent-0.1.pom | 64 ++++++++++++++++++ .../its/mng4401/parent/0.1/parent-0.1.pom | 64 ++++++++++++++++++ .../resources/mng-4401/settings-template.xml | 61 +++++++++++++++++ 6 files changed, 296 insertions(+) create mode 100644 its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4401RepositoryOrderForParentPomTest.java create mode 100644 its/core-it-suite/src/test/resources/mng-4401/pom.xml create mode 100644 its/core-it-suite/src/test/resources/mng-4401/repo-1/org/apache/maven/its/mng4401/parent/0.1/parent-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4401/repo-2/org/apache/maven/its/mng4401/parent/0.1/parent-0.1.pom create mode 100644 its/core-it-suite/src/test/resources/mng-4401/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 bc759ef08d..3736bee43f 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( MavenITmng4401RepositoryOrderForParentPomTest.class ); suite.addTestSuite( MavenITmng4400RepositoryOrderTest.class ); suite.addTestSuite( MavenITmng4396AntBasedMojoSupportTest.class ); suite.addTestSuite( MavenITmng4393ParseExternalParenPomLenientTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4401RepositoryOrderForParentPomTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4401RepositoryOrderForParentPomTest.java new file mode 100644 index 0000000000..b326eb33ec --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4401RepositoryOrderForParentPomTest.java @@ -0,0 +1,65 @@ +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; + +/** + * This is a test set for MNG-4401. + * + * @author Benjamin Bentmann + */ +public class MavenITmng4401RepositoryOrderForParentPomTest + extends AbstractMavenIntegrationTestCase +{ + + public MavenITmng4401RepositoryOrderForParentPomTest() + { + super( ALL_MAVEN_VERSIONS ); + } + + /** + * Verify that the implicit default repo (central) is tried after explicitly declared repos during parent POM + * resolution. + */ + public void testit() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4401" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + verifier.deleteDirectory( "target" ); + verifier.deleteArtifacts( "org.apache.maven.its.mng4401" ); + 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(); + + verifier.assertFilePresent( "target/passed.txt" ); + verifier.assertFileNotPresent( "target/failed.txt" ); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-4401/pom.xml b/its/core-it-suite/src/test/resources/mng-4401/pom.xml new file mode 100644 index 0000000000..6cd3c080d2 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4401/pom.xml @@ -0,0 +1,41 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.mng4401 + parent + 0.1 + + + org.apache.maven.its.mng4401 + test + 0.1 + jar + + Maven Integration Test :: MNG-4401 + + Verify that the implicit default repo (central) is tried after explicitly declared repos during parent POM + resolution. + + diff --git a/its/core-it-suite/src/test/resources/mng-4401/repo-1/org/apache/maven/its/mng4401/parent/0.1/parent-0.1.pom b/its/core-it-suite/src/test/resources/mng-4401/repo-1/org/apache/maven/its/mng4401/parent/0.1/parent-0.1.pom new file mode 100644 index 0000000000..b63a3f724f --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4401/repo-1/org/apache/maven/its/mng4401/parent/0.1/parent-0.1.pom @@ -0,0 +1,64 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4401 + parent + 0.1 + pom + + Maven Integration Test :: MNG-4401 + + Verify that the implicit default repo (central) is tried after explicitly declared repos during parent POM + resolution. + + + + + maven-core-it + file:///${basedir}/repo + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-log-file + 2.1-SNAPSHOT + + target/passed.txt + + + + test + validate + + reset + + + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4401/repo-2/org/apache/maven/its/mng4401/parent/0.1/parent-0.1.pom b/its/core-it-suite/src/test/resources/mng-4401/repo-2/org/apache/maven/its/mng4401/parent/0.1/parent-0.1.pom new file mode 100644 index 0000000000..1460647608 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4401/repo-2/org/apache/maven/its/mng4401/parent/0.1/parent-0.1.pom @@ -0,0 +1,64 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng4401 + parent + 0.1 + pom + + Maven Integration Test :: MNG-4401 + + Verify that the implicit default repo (central) is tried after explicitly declared repos during parent POM + resolution. + + + + + maven-core-it + file:///${basedir}/repo + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-log-file + 2.1-SNAPSHOT + + target/failed.txt + + + + test + validate + + reset + + + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-4401/settings-template.xml b/its/core-it-suite/src/test/resources/mng-4401/settings-template.xml new file mode 100644 index 0000000000..7da6c74537 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-4401/settings-template.xml @@ -0,0 +1,61 @@ + + + + + + + + central-mirror + central + @baseurl@/repo-2 + + + + + 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 + +