Repository: maven-integration-testing Updated Branches: refs/heads/MNG-6330_RelativePath [created] 15e305e05
[MNG-6330] Parents relativePath not verified anymore Project: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/repo Commit: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/commit/15e305e0 Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/15e305e0 Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/15e305e0 Branch: refs/heads/MNG-6330_RelativePath Commit: 15e305e053e2d51ac1e8bf615799061c953fdc3a Parents: 31895fe Author: rfscholte <[email protected]> Authored: Thu Dec 28 14:01:29 2017 +0100 Committer: rfscholte <[email protected]> Committed: Thu Dec 28 14:01:29 2017 +0100 ---------------------------------------------------------------------- core-it-suite/pom.xml | 2 +- .../apache/maven/it/IntegrationTestSuite.java | 1 + .../maven/it/MavenITmng6330RelativePath.java | 60 ++++++++++++++++++++ .../mng-6330-relative-path/module-a/pom.xml | 29 ++++++++++ .../parent-project/pom.xml | 30 ++++++++++ 5 files changed, 121 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/15e305e0/core-it-suite/pom.xml ---------------------------------------------------------------------- diff --git a/core-it-suite/pom.xml b/core-it-suite/pom.xml index 8cfb3cb..e1c484d 100644 --- a/core-it-suite/pom.xml +++ b/core-it-suite/pom.xml @@ -88,7 +88,7 @@ under the License. <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>4.8.2</version> + <version>4.12</version> <!-- NOTE: Use compile scope for transitivity. --> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/15e305e0/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java index f7a06ff..c8bced7 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java +++ b/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 ); http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/15e305e0/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6330RelativePath.java ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6330RelativePath.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6330RelativePath.java new file mode 100644 index 0000000..4f8d9d6 --- /dev/null +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6330RelativePath.java @@ -0,0 +1,60 @@ +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 java.util.Arrays; + +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 testProjectArtifactsCacheReactor() throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6330-relative-path" ); + + Verifier verifier = newVerifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( true ); + + try + { + verifier.executeGoals( Arrays.asList( "-f", "parent-project/pom.xml", "package") ); + fail( "Should fail due to non-resolvable parent" ); + } + catch ( VerificationException e ) + { + assertThat( e.getMessage(), containsString("Non-resolvable parent POM") ); + } + } +} http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/15e305e0/core-it-suite/src/test/resources/mng-6330-relative-path/module-a/pom.xml ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-6330-relative-path/module-a/pom.xml b/core-it-suite/src/test/resources/mng-6330-relative-path/module-a/pom.xml new file mode 100644 index 0000000..9081b37 --- /dev/null +++ b/core-it-suite/src/test/resources/mng-6330-relative-path/module-a/pom.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- + ~ 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. + --> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>parent-project</artifactId> + <groupId>org.apache.maven.its.mng6300</groupId> + <version>1.0-SNAPSHOT</version> + <!-- default relativePth is incorrect --> + </parent> + <artifactId>module-a</artifactId> +</project> http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/15e305e0/core-it-suite/src/test/resources/mng-6330-relative-path/parent-project/pom.xml ---------------------------------------------------------------------- diff --git a/core-it-suite/src/test/resources/mng-6330-relative-path/parent-project/pom.xml b/core-it-suite/src/test/resources/mng-6330-relative-path/parent-project/pom.xml new file mode 100644 index 0000000..aaca315 --- /dev/null +++ b/core-it-suite/src/test/resources/mng-6330-relative-path/parent-project/pom.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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. + --> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.its.mng6330</groupId> + <artifactId>parent-project</artifactId> + <packaging>pom</packaging> + <version>1.0-SNAPSHOT</version> + + <modules> + <module>../module-a</module> + </modules> +</project>
