diff --git a/its/core-it-suite/pom.xml b/its/core-it-suite/pom.xml index 8cfb3cb265..e1c484d149 100644 --- a/its/core-it-suite/pom.xml +++ b/its/core-it-suite/pom.xml @@ -88,7 +88,7 @@ under the License. junit junit - 4.8.2 + 4.12 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 f7a06ff4c0..c8bced7cac 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 @@ -106,6 +106,7 @@ public class IntegrationTestSuite // ------------------------------------------------------------------------------------------------------------- // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137 + suite.addTestSuite( MavenITmng6330RelativePath.class ); suite.addTestSuite( MavenITmng6240PluginExtensionAetherProvider.class ); suite.addTestSuite( MavenITmng6223FindBasedir.class ); suite.addTestSuite( MavenITmng6189SiteReportPluginsWarningTest.class ); diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6330RelativePath.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6330RelativePath.java new file mode 100644 index 0000000000..7adf2cd688 --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6330RelativePath.java @@ -0,0 +1,59 @@ +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 static org.junit.Assert.assertThat; +import static org.hamcrest.CoreMatchers.containsString; + +import java.io.File; + +import org.apache.maven.it.util.ResourceExtractor; + +/** + * MNG-6030 reintroduced ReactorModelCache, but this ignores invalid relativePaths of parents + * + * @author Robert Scholte + */ +public class MavenITmng6330RelativePath + extends AbstractMavenIntegrationTestCase +{ + public MavenITmng6330RelativePath() + { + super( "(,3.5.0),(3.5.2,)" ); + } + + public void testRelativePath() throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6330-relative-path" ); + + Verifier verifier = newVerifier( testDir.getAbsolutePath() ); + verifier.setForkJvm( true ); + + try + { + verifier.executeGoal( "validate"); + fail( "Should fail due to non-resolvable parent" ); + } + catch ( VerificationException e ) + { + assertThat( e.getMessage(), containsString("Non-resolvable parent POM") ); + } + } +} diff --git a/its/core-it-suite/src/test/resources/mng-6330-relative-path/pom.xml b/its/core-it-suite/src/test/resources/mng-6330-relative-path/pom.xml new file mode 100644 index 0000000000..d4552d956a --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-6330-relative-path/pom.xml @@ -0,0 +1,31 @@ + + + + 4.0.0 + org.apache.maven.its.mng6330 + project + 1.0-SNAPSHOT + pom + + + subproject1 + sub/subproject2 + + diff --git a/its/core-it-suite/src/test/resources/mng-6330-relative-path/sub/subproject2/pom.xml b/its/core-it-suite/src/test/resources/mng-6330-relative-path/sub/subproject2/pom.xml new file mode 100644 index 0000000000..038cb79e82 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-6330-relative-path/sub/subproject2/pom.xml @@ -0,0 +1,28 @@ + + + + 4.0.0 + + org.apache.maven.its.mng6330 + project + 1.0-SNAPSHOT + + subproject2 + diff --git a/its/core-it-suite/src/test/resources/mng-6330-relative-path/subproject1/pom.xml b/its/core-it-suite/src/test/resources/mng-6330-relative-path/subproject1/pom.xml new file mode 100644 index 0000000000..25a98d8892 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-6330-relative-path/subproject1/pom.xml @@ -0,0 +1,30 @@ + + + + 4.0.0 + + org.apache.maven.its.mng6330 + project + 1.0-SNAPSHOT + + + subproject1 + 2.0-SNAPSHOT +