[MNG-7837] Add IT for project element in pom (#277)
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7837ProjectElementInPomTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7837ProjectElementInPomTest.java
new file mode 100644
index 0000000..0696cce
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7837ProjectElementInPomTest.java
@@ -0,0 +1,44 @@
+/*
+ * 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;
+
+class MavenITmng7837ProjectElementInPomTest extends AbstractMavenIntegrationTestCase {
+
+ protected MavenITmng7837ProjectElementInPomTest() {
+ // Broken in 4.0.0-alpha-7
+ super("(,4.0.0-alpha-7),(4.0.0-alpha-7,)");
+ }
+
+ @Test
+ void testProjectElementInPom() throws Exception {
+ File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7837-project-element-in-pom");
+
+ final Verifier pluginVerifier = newVerifier(testDir.getPath());
+ pluginVerifier.addCliArgument("validate");
+ pluginVerifier.addCliArgument("-V");
+ pluginVerifier.execute();
+ pluginVerifier.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 05800b4..f544ef4 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 @@
* the tests are to finishing. Newer tests are also more likely to fail, so this is
* a fail fast technique as well.
*/
+ suite.addTestSuite(MavenITmng7837ProjectElementInPomTest.class);
suite.addTestSuite(MavenITmng7804PluginExecutionOrderTest.class);
suite.addTestSuite(MavenITmng7836AlternativePomSyntaxTest.class);
suite.addTestSuite(MavenITmng7891ConfigurationForExtensionsTest.class);
diff --git a/core-it-suite/src/test/resources/mng-7837-project-element-in-pom/pom.xml b/core-it-suite/src/test/resources/mng-7837-project-element-in-pom/pom.xml
new file mode 100644
index 0000000..ad7fc7b
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7837-project-element-in-pom/pom.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.its.mng7837</groupId>
+ <artifactId>test</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>3.4.0</version>
+ <configuration>
+ <project>
+ <groupId>com.flowlogix</groupId>
+ <artifactId>flowlogix</artifactId>
+ </project>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>