Merge branch 'master' of https://gitbox.apache.org/repos/asf/maven-integration-testing
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 f81f6d2..87b948e 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
@@ -108,6 +108,7 @@
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
suite.addTestSuite( MavenITmng5669ReadPomsOnce.class );
+ suite.addTestSuite( MavenITmng6071GetResourceWithCustomPom.class );
suite.addTestSuite( MavenITmng6759TransitiveDependencyRepositoriesTest.class );
suite.addTestSuite( MavenITmng6720FailFastTest.class );
suite.addTestSuite( MavenITmng6506PackageAnnotationTest.class );
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6071GetResourceWithCustomPom.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6071GetResourceWithCustomPom.java
new file mode 100644
index 0000000..3ddb654
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6071GetResourceWithCustomPom.java
@@ -0,0 +1,37 @@
+package org.apache.maven.it;
+
+import org.apache.maven.it.util.ResourceExtractor;
+import org.junit.Test;
+
+import java.io.File;
+import java.util.Properties;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-6071">MNG-6071</a>:
+ * check that getClass().getResource("/") returns consistent results when Maven is run with <code>-f ./pom.xml</code>.
+ */
+public class MavenITmng6071GetResourceWithCustomPom
+ extends AbstractMavenIntegrationTestCase
+{
+ public MavenITmng6071GetResourceWithCustomPom()
+ {
+ super( "[3.7.0-SNAPSHOT,)" );
+ }
+
+ /**
+ * check when path to POM set by <code>-f ./pom.xml</code>
+ */
+ @Test
+ public void testRunCustomPomWithDot( )
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6071" );
+
+ Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+ verifier.getCliOptions().add( "-f ./pom.xml" );
+ verifier.setForkJvm( true );
+ verifier.executeGoal( "verify" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+ }
+}
diff --git a/core-it-suite/src/test/resources/mng-6071/pom.xml b/core-it-suite/src/test/resources/mng-6071/pom.xml
new file mode 100644
index 0000000..adc780b
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6071/pom.xml
@@ -0,0 +1,28 @@
+<?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>mng-6071</groupId>
+ <artifactId>mng-6071</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <name>my-app</name>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <maven.compiler.source>1.7</maven.compiler.source>
+ <maven.compiler.target>1.7</maven.compiler.target>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-6071/src/test/java/com/mycompany/app/AppTest.java b/core-it-suite/src/test/resources/mng-6071/src/test/java/com/mycompany/app/AppTest.java
new file mode 100644
index 0000000..8e62a78
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-6071/src/test/java/com/mycompany/app/AppTest.java
@@ -0,0 +1,40 @@
+package com.mycompany.app;
+
+/*
+ * 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.junit.Test;
+
+import java.net.URL;
+
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+{
+ @Test
+ public void shouldAnswerWithTrue()
+ {
+ URL resource = getClass().getResource( "/" );
+ System.out.println( resource );
+ assertNotNull( resource );
+ }
+}