You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2024/10/02 21:27:06 UTC

(maven-integration-testing) branch master updated: [MNG-8133] IT for ${project.rootDirectory} in external parent (#368)

This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git


The following commit(s) were added to refs/heads/master by this push:
     new e052ae981 [MNG-8133] IT for ${project.rootDirectory} in external parent (#368)
e052ae981 is described below

commit e052ae98130b7bdaac6b622a656253fd6f7a5e6b
Author: Guillaume Nodet <gn...@apache.org>
AuthorDate: Wed Oct 2 23:27:02 2024 +0200

    [MNG-8133] IT for ${project.rootDirectory} in external parent (#368)
---
 .../MavenITmng8133RootDirectoryInParentTest.java   | 46 ++++++++++++++++++++++
 .../org/apache/maven/it/TestSuiteOrdering.java     |  1 +
 .../child/.mvn/.gitkeep                            |  0
 .../child/pom.xml                                  | 11 ++++++
 .../parent/.mvn/.gitkeep                           |  0
 .../parent/pom.xml                                 | 20 ++++++++++
 6 files changed, 78 insertions(+)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8133RootDirectoryInParentTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8133RootDirectoryInParentTest.java
new file mode 100644
index 000000000..ac6fca523
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8133RootDirectoryInParentTest.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+package org.apache.maven.it;
+
+import java.io.File;
+
+import org.apache.maven.shared.verifier.Verifier;
+import org.apache.maven.shared.verifier.util.ResourceExtractor;
+import org.junit.jupiter.api.Test;
+
+public class MavenITmng8133RootDirectoryInParentTest extends AbstractMavenIntegrationTestCase {
+    public MavenITmng8133RootDirectoryInParentTest() {
+        super("[4.0.0-beta-5,)");
+    }
+
+    @Test
+    public void testRootDirectoryInParent() throws Exception {
+        File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-8133-root-directory-in-parent");
+
+        Verifier verifier = newVerifier(new File(testDir, "parent").getAbsolutePath());
+        verifier.addCliArgument("install");
+        verifier.execute();
+        verifier.verifyErrorFreeLog();
+
+        verifier = newVerifier(new File(testDir, "child").getAbsolutePath());
+        verifier.addCliArgument("install");
+        verifier.execute();
+        verifier.verifyErrorFreeLog();
+    }
+}
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java b/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java
index 1619516d8..13b4a3221 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java
@@ -120,6 +120,7 @@ public class TestSuiteOrdering implements ClassOrderer {
          * the tests are to finishing. Newer tests are also more likely to fail, so this is
          * a fail fast technique as well.
          */
+        suite.addTestSuite(MavenITmng8133RootDirectoryInParentTest.class);
         suite.addTestSuite(MavenITmng8230CIFriendlyTest.class);
         suite.addTestSuite(MavenITmng7255InferredGroupIdTest.class);
         suite.addTestSuite(MavenITmng8220ExtensionWithDITest.class);
diff --git a/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/child/.mvn/.gitkeep b/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/child/.mvn/.gitkeep
new file mode 100644
index 000000000..e69de29bb
diff --git a/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/child/pom.xml b/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/child/pom.xml
new file mode 100644
index 000000000..cd44675d6
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/child/pom.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.1.0">
+  <parent>
+    <groupId>org.apache.maven.its.mng8133</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>child</artifactId>
+  <packaging>jar</packaging>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/parent/.mvn/.gitkeep b/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/parent/.mvn/.gitkeep
new file mode 100644
index 000000000..e69de29bb
diff --git a/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/parent/pom.xml b/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/parent/pom.xml
new file mode 100644
index 000000000..a3fab582a
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-8133-root-directory-in-parent/parent/pom.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.1.0">
+  <groupId>org.apache.maven.its.mng8133</groupId>
+  <artifactId>parent</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-touch</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <configuration>
+          <outputDirectory>${project.rootDirectory}/target/</outputDirectory>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
+</project>