You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sc...@apache.org on 2017/01/27 21:45:01 UTC

[1/2] maven-integration-testing git commit: [MNG-5958] restore binary compatibility of Lifecycle.setPhases [Forced Update!]

Repository: maven-integration-testing
Updated Branches:
  refs/heads/MNG-2199 07c254517 -> e6ca0fb2d (forced update)


[MNG-5958] restore binary compatibility of Lifecycle.setPhases

Modify tests for MNG-5805

This closes #13 #18


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/c4365abe
Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/c4365abe
Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/c4365abe

Branch: refs/heads/MNG-2199
Commit: c4365abe20b58b2cbc174de812e43c7741dc10e1
Parents: 7e5b365
Author: Anton Tanasenko <at...@gmail.com>
Authored: Thu Jan 7 04:01:28 2016 +0200
Committer: Christian Schulte <sc...@apache.org>
Committed: Thu Jan 26 20:24:02 2017 +0100

----------------------------------------------------------------------
 .../apache/maven/it/IntegrationTestSuite.java   |  2 +
 .../MavenITmng5805PkgTypeMojoConfiguration.java |  2 +-
 ...MavenITmng5805PkgTypeMojoConfiguration2.java | 30 +++++++++
 ...avenITmng5958LifecyclePhaseBinaryCompat.java | 45 +++++++++++++
 .../test/resources/bootstrap/group-3/pom.xml    | 12 ++++
 .../pom.xml                                     | 40 +++++++++++
 .../mng-5958-lifecycle-phases/bad/pom.xml       | 53 +++++++++++++++
 .../mng-5958-lifecycle-phases/good/pom.xml      | 53 +++++++++++++++
 .../core-it-plugins/mng5805-extension2/pom.xml  | 37 ++++++++++
 .../resources/META-INF/plexus/components.xml    | 71 ++++++++++++++++++++
 .../core-it-plugins/mng5958-extension/pom.xml   | 45 +++++++++++++
 .../its/mng5958/AbstractLifecycleMapping.java   | 71 ++++++++++++++++++++
 .../maven/its/mng5958/BadLifecycleMapping.java  | 45 +++++++++++++
 .../maven/its/mng5958/GoodLifecycleMapping.java | 40 +++++++++++
 .../resources/META-INF/plexus/components.xml    | 62 +++++++++++++++++
 core-it-support/core-it-plugins/pom.xml         |  2 +
 16 files changed, 609 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/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 5536620..a91eeb0 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,10 +106,12 @@ public class IntegrationTestSuite
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng5958LifecyclePhaseBinaryCompat.class );
         suite.addTestSuite( MavenITmng5898BuildMultimoduleWithEARFailsToResolveWARTest.class );
         suite.addTestSuite( MavenITmng5840ParentVersionRanges.class );
         suite.addTestSuite( MavenITmng5840RelativePathReactorMatching.class );
         suite.addTestSuite( MavenITmng5805PkgTypeMojoConfiguration.class );
+        suite.addTestSuite( MavenITmng5805PkgTypeMojoConfiguration2.class );
         suite.addTestSuite( MavenITmng5783PluginDependencyFiltering.class );
         suite.addTestSuite( MavenITmng5774ConfigurationProcessorsTest.class );
         suite.addTestSuite( MavenITmng5771CoreExtensionsTest.class );

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration.java
index ada7448..5335677 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration.java
@@ -10,7 +10,7 @@ public class MavenITmng5805PkgTypeMojoConfiguration
 
     public MavenITmng5805PkgTypeMojoConfiguration()
     {
-        super( "(3.3.3,)" );
+        super( "(3.3.3,3.5.0)" );
     }
 
     public void testPkgTypeMojoConfiguration()

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration2.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration2.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration2.java
new file mode 100644
index 0000000..ca1c0e3
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5805PkgTypeMojoConfiguration2.java
@@ -0,0 +1,30 @@
+package org.apache.maven.it;
+
+import java.io.File;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+public class MavenITmng5805PkgTypeMojoConfiguration2
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng5805PkgTypeMojoConfiguration2()
+    {
+        super( "(3.3.3,)" );
+    }
+
+    public void testPkgTypeMojoConfiguration()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5805-pkg-type-mojo-configuration2" );
+        
+        Verifier verifier;
+        
+
+        verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.verifyTextInLog( "CLASS_NAME=org.apache.maven.its.mng5805.TestClass1" );
+        verifier.resetStreams();
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5958LifecyclePhaseBinaryCompat.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5958LifecyclePhaseBinaryCompat.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5958LifecyclePhaseBinaryCompat.java
new file mode 100644
index 0000000..3ee3fe1
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5958LifecyclePhaseBinaryCompat.java
@@ -0,0 +1,45 @@
+package org.apache.maven.it;
+
+import java.io.File;
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+public class MavenITmng5958LifecyclePhaseBinaryCompat
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng5958LifecyclePhaseBinaryCompat()
+    {
+        super( "(3.3.9,)" );
+    }
+
+    public void testGood()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5958-lifecycle-phases/good" );
+        
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        verifier.executeGoal( "validate" );
+        verifier.verifyErrorFreeLog();
+        verifier.verifyTextInLog( "CLASS_NAME=java.lang.String" );
+        verifier.resetStreams();
+    }
+    
+    public void testBad()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5958-lifecycle-phases/bad" );
+        
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        try
+        {
+            verifier.executeGoal( "validate" );
+        }
+        catch ( VerificationException e )
+        {
+            verifier.verifyTextInLog( "[ERROR] Internal error: java.lang.ClassCastException: "
+                + "org.apache.maven.lifecycle.mapping.LifecyclePhase cannot be cast to java.lang.String -> [Help 1]" );
+        }
+        verifier.resetStreams();
+    }
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-suite/src/test/resources/bootstrap/group-3/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/bootstrap/group-3/pom.xml b/core-it-suite/src/test/resources/bootstrap/group-3/pom.xml
index bcaaca6..9731869 100644
--- a/core-it-suite/src/test/resources/bootstrap/group-3/pom.xml
+++ b/core-it-suite/src/test/resources/bootstrap/group-3/pom.xml
@@ -136,6 +136,18 @@ under the License.
       <version>${itPluginVersion}</version>
       <scope>runtime</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.its.plugins</groupId>
+      <artifactId>mng-5805-pkg-type-mojo-configuration-extension2</artifactId>
+      <version>${itPluginVersion}</version>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.its.plugins</groupId>
+      <artifactId>mng-5958-pkg-type-extension</artifactId>
+      <version>${itPluginVersion}</version>
+      <scope>runtime</scope>
+    </dependency>
 
     <dependency>
       <groupId>org.apache.maven.its.plugins</groupId>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration2/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration2/pom.xml b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration2/pom.xml
new file mode 100644
index 0000000..b7e12f1
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5805-pkg-type-mojo-configuration2/pom.xml
@@ -0,0 +1,40 @@
+<?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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>mng-5805-pkg-type-mojo-configuration</groupId>
+  <artifactId>mng-5805-pkg-type-mojo-configuration-project2</artifactId>
+  <version>0.1</version>
+  <packaging>mng5805</packaging>
+  
+  <build>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>mng-5805-pkg-type-mojo-configuration-extension2</artifactId>
+        <version>2.1-SNAPSHOT</version>
+      </extension>
+    </extensions>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-suite/src/test/resources/mng-5958-lifecycle-phases/bad/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5958-lifecycle-phases/bad/pom.xml b/core-it-suite/src/test/resources/mng-5958-lifecycle-phases/bad/pom.xml
new file mode 100644
index 0000000..d565ae0
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5958-lifecycle-phases/bad/pom.xml
@@ -0,0 +1,53 @@
+<?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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>mng-5958-lifecycle-phases</groupId>
+  <artifactId>mng-5958-lifecycle-phases-project</artifactId>
+  <version>0.1</version>
+  <packaging>mng5958-bad</packaging>
+  
+  <build>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>mng-5958-pkg-type-extension</artifactId>
+        <version>2.1-SNAPSHOT</version>
+      </extension>
+    </extensions>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.its.plugins</groupId>
+          <artifactId>mng-5805-pkg-type-mojo-configuration-plugin</artifactId>
+          <version>2.1-SNAPSHOT</version>
+          <configuration>
+            <className>java.lang.String</className>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+  
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-suite/src/test/resources/mng-5958-lifecycle-phases/good/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-5958-lifecycle-phases/good/pom.xml b/core-it-suite/src/test/resources/mng-5958-lifecycle-phases/good/pom.xml
new file mode 100644
index 0000000..0419dcd
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5958-lifecycle-phases/good/pom.xml
@@ -0,0 +1,53 @@
+<?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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>mng-5958-lifecycle-phases</groupId>
+  <artifactId>mng-5958-lifecycle-phases-project</artifactId>
+  <version>0.1</version>
+  <packaging>mng5958-good</packaging>
+  
+  <build>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>mng-5958-pkg-type-extension</artifactId>
+        <version>2.1-SNAPSHOT</version>
+      </extension>
+    </extensions>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.its.plugins</groupId>
+          <artifactId>mng-5805-pkg-type-mojo-configuration-plugin</artifactId>
+          <version>2.1-SNAPSHOT</version>
+          <configuration>
+            <className>java.lang.String</className>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+  
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-support/core-it-plugins/mng5805-extension2/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-support/core-it-plugins/mng5805-extension2/pom.xml b/core-it-support/core-it-plugins/mng5805-extension2/pom.xml
new file mode 100644
index 0000000..c6a24f6
--- /dev/null
+++ b/core-it-support/core-it-plugins/mng5805-extension2/pom.xml
@@ -0,0 +1,37 @@
+<?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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <artifactId>maven-it-plugins</artifactId>
+    <groupId>org.apache.maven.its.plugins</groupId>
+    <version>2.1-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>mng-5805-pkg-type-mojo-configuration-extension2</artifactId>
+  <packaging>jar</packaging>
+
+  <name>Maven IT Plugin :: mng-5805 extension mk2</name>
+
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-support/core-it-plugins/mng5805-extension2/src/main/resources/META-INF/plexus/components.xml
----------------------------------------------------------------------
diff --git a/core-it-support/core-it-plugins/mng5805-extension2/src/main/resources/META-INF/plexus/components.xml b/core-it-support/core-it-plugins/mng5805-extension2/src/main/resources/META-INF/plexus/components.xml
new file mode 100644
index 0000000..a07744d
--- /dev/null
+++ b/core-it-support/core-it-plugins/mng5805-extension2/src/main/resources/META-INF/plexus/components.xml
@@ -0,0 +1,71 @@
+<?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.
+-->
+<component-set>
+  <components>
+  
+    <component>
+      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
+      <role-hint>mng5805</role-hint>
+      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
+      <configuration>
+        <lifecycles>
+          <lifecycle>
+            <id>default</id>
+            <lifecyclePhases>
+              <validate>
+                <mojos>
+                  <mojo>
+                    <goal>
+                      org.apache.maven.its.plugins:mng-5805-pkg-type-mojo-configuration-plugin:2.1-SNAPSHOT:test
+                    </goal>
+                    <configuration>
+                      <className>org.apache.maven.its.mng5805.TestClass1</className>
+                    </configuration>
+                    <dependencies>
+                      <dependency>
+                        <groupId>org.apache.maven.its.plugins</groupId>
+                        <artifactId>mng-5805-pkg-type-mojo-configuration-plugin-dep</artifactId>
+                        <version>2.1-SNAPSHOT</version>
+                      </dependency>
+                    </dependencies>
+                  </mojo>
+                </mojos>
+              </validate>
+            </lifecyclePhases>
+          </lifecycle>
+        </lifecycles>
+      </configuration>
+    </component>
+    
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>mng5805</role-hint>
+      <implementation>
+        org.apache.maven.artifact.handler.DefaultArtifactHandler
+      </implementation>
+      <configuration>
+        <extension>zip</extension>
+        <type>mng5805</type>
+        <packaging>mng5805</packaging>
+      </configuration>
+    </component>
+    
+  </components>
+</component-set>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-support/core-it-plugins/mng5958-extension/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-support/core-it-plugins/mng5958-extension/pom.xml b/core-it-support/core-it-plugins/mng5958-extension/pom.xml
new file mode 100644
index 0000000..5f41294
--- /dev/null
+++ b/core-it-support/core-it-plugins/mng5958-extension/pom.xml
@@ -0,0 +1,45 @@
+<?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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <artifactId>maven-it-plugins</artifactId>
+    <groupId>org.apache.maven.its.plugins</groupId>
+    <version>2.1-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>mng-5958-pkg-type-extension</artifactId>
+  <packaging>jar</packaging>
+
+  <name>Maven IT Plugin :: mng-5958 extension</name>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <version>3.3.9</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-support/core-it-plugins/mng5958-extension/src/main/java/org/apache/maven/its/mng5958/AbstractLifecycleMapping.java
----------------------------------------------------------------------
diff --git a/core-it-support/core-it-plugins/mng5958-extension/src/main/java/org/apache/maven/its/mng5958/AbstractLifecycleMapping.java b/core-it-support/core-it-plugins/mng5958-extension/src/main/java/org/apache/maven/its/mng5958/AbstractLifecycleMapping.java
new file mode 100644
index 0000000..9a9db7a
--- /dev/null
+++ b/core-it-support/core-it-plugins/mng5958-extension/src/main/java/org/apache/maven/its/mng5958/AbstractLifecycleMapping.java
@@ -0,0 +1,71 @@
+package org.apache.maven.its.mng5958;
+
+/*
+ * 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 java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.lifecycle.mapping.Lifecycle;
+import org.apache.maven.lifecycle.mapping.LifecycleMapping;
+
+/**
+ * @author Anton Tanasenko
+ */
+public abstract class AbstractLifecycleMapping implements LifecycleMapping
+{
+
+    private Map<String, Lifecycle> lifecycleMap;
+    
+    public Map<String, Lifecycle> getLifecycles()
+    {
+        if ( lifecycleMap != null )
+        {
+            return lifecycleMap;
+        }
+
+        lifecycleMap = new LinkedHashMap<>();
+        Lifecycle lifecycle = new Lifecycle();
+
+        lifecycle.setId( "default" );
+        lifecycle.setPhases( initPhases() );
+
+        lifecycleMap.put( "default", lifecycle );
+        return lifecycleMap;
+    }
+
+    public Map<String, String> getPhases( String lifecycle )
+    {
+        Lifecycle lifecycleMapping = getLifecycles().get( lifecycle );
+        if ( lifecycleMapping != null )
+        {
+            return lifecycleMapping.getPhases();
+        }
+        return null;
+    }
+
+    public List<String> getOptionalMojos( String lifecycle )
+    {
+        return null;
+    }
+    
+    // raw map on purpose
+    protected abstract Map initPhases();
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-support/core-it-plugins/mng5958-extension/src/main/java/org/apache/maven/its/mng5958/BadLifecycleMapping.java
----------------------------------------------------------------------
diff --git a/core-it-support/core-it-plugins/mng5958-extension/src/main/java/org/apache/maven/its/mng5958/BadLifecycleMapping.java b/core-it-support/core-it-plugins/mng5958-extension/src/main/java/org/apache/maven/its/mng5958/BadLifecycleMapping.java
new file mode 100644
index 0000000..7dbf2b5
--- /dev/null
+++ b/core-it-support/core-it-plugins/mng5958-extension/src/main/java/org/apache/maven/its/mng5958/BadLifecycleMapping.java
@@ -0,0 +1,45 @@
+package org.apache.maven.its.mng5958;
+
+/*
+ * 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 java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.maven.lifecycle.mapping.LifecyclePhase;
+
+/**
+ * @author Anton Tanasenko
+ */
+public class BadLifecycleMapping extends AbstractLifecycleMapping
+{
+
+    @Override
+    protected Map<String, String> initPhases()
+    {
+        Map phases = new LinkedHashMap<>();
+        
+        LifecyclePhase lp = new LifecyclePhase();
+        lp.set( "org.apache.maven.its.plugins:mng-5805-pkg-type-mojo-configuration-plugin:2.1-SNAPSHOT:test" );
+        
+        phases.put( "validate", lp );
+        return phases;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-support/core-it-plugins/mng5958-extension/src/main/java/org/apache/maven/its/mng5958/GoodLifecycleMapping.java
----------------------------------------------------------------------
diff --git a/core-it-support/core-it-plugins/mng5958-extension/src/main/java/org/apache/maven/its/mng5958/GoodLifecycleMapping.java b/core-it-support/core-it-plugins/mng5958-extension/src/main/java/org/apache/maven/its/mng5958/GoodLifecycleMapping.java
new file mode 100644
index 0000000..c14099d
--- /dev/null
+++ b/core-it-support/core-it-plugins/mng5958-extension/src/main/java/org/apache/maven/its/mng5958/GoodLifecycleMapping.java
@@ -0,0 +1,40 @@
+package org.apache.maven.its.mng5958;
+
+/*
+ * 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 java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * @author Anton Tanasenko
+ */
+public class GoodLifecycleMapping extends AbstractLifecycleMapping
+{
+
+    @Override
+    protected Map<String, String> initPhases()
+    {
+        Map<String, String> phases = new LinkedHashMap<>();
+        phases.put( "validate",
+                "org.apache.maven.its.plugins:mng-5805-pkg-type-mojo-configuration-plugin:2.1-SNAPSHOT:test" );
+        return phases;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-support/core-it-plugins/mng5958-extension/src/main/resources/META-INF/plexus/components.xml
----------------------------------------------------------------------
diff --git a/core-it-support/core-it-plugins/mng5958-extension/src/main/resources/META-INF/plexus/components.xml b/core-it-support/core-it-plugins/mng5958-extension/src/main/resources/META-INF/plexus/components.xml
new file mode 100644
index 0000000..e61d294
--- /dev/null
+++ b/core-it-support/core-it-plugins/mng5958-extension/src/main/resources/META-INF/plexus/components.xml
@@ -0,0 +1,62 @@
+<?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.
+-->
+<component-set>
+  <components>
+  
+    <component>
+      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
+      <role-hint>mng5958-good</role-hint>
+      <implementation>org.apache.maven.its.mng5958.GoodLifecycleMapping</implementation>
+    </component>
+    
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>mng5958</role-hint>
+      <implementation>
+        org.apache.maven.artifact.handler.DefaultArtifactHandler
+      </implementation>
+      <configuration>
+        <extension>zip</extension>
+        <type>mng5858-good</type>
+        <packaging>mng5858-good</packaging>
+      </configuration>
+    </component>
+    
+    <component>
+      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
+      <role-hint>mng5958-bad</role-hint>
+      <implementation>org.apache.maven.its.mng5958.BadLifecycleMapping</implementation>
+    </component>
+    
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>mng5958-bad</role-hint>
+      <implementation>
+        org.apache.maven.artifact.handler.DefaultArtifactHandler
+      </implementation>
+      <configuration>
+        <extension>zip</extension>
+        <type>mng5858-bad</type>
+        <packaging>mng5858-bad</packaging>
+      </configuration>
+    </component>
+    
+  </components>
+</component-set>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/c4365abe/core-it-support/core-it-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-support/core-it-plugins/pom.xml b/core-it-support/core-it-plugins/pom.xml
index 83b5f79..c301aae 100644
--- a/core-it-support/core-it-plugins/pom.xml
+++ b/core-it-support/core-it-plugins/pom.xml
@@ -79,8 +79,10 @@ under the License.
     <module>maven-it-plugin-plexus-lifecycle</module>
     <module>maven-it-plugin-settings</module>
     <module>mng5805-extension</module>
+    <module>mng5805-extension2</module>
     <module>mng5805-plugin</module>
     <module>mng5805-plugin-dep</module>
+    <module>mng5958-extension</module>
   </modules>
 
   <scm>


[2/2] maven-integration-testing git commit: [MNG-2199] Support version ranges in parent elements

Posted by sc...@apache.org.
[MNG-2199] Support version ranges in parent elements

o Updated the ITs to correctly detect parent resolution failures. Maven does
  not fail the build when it cannot resolve a parent but instead logs a
  warning message. The ITs never checked the log to contain the warning messages
  but instead asserted the build to fail when a parent cannot be resolved.
  The only Maven version supporting parent version ranges is Maven 3.2.2 due to
  this.
o Deprecated an incorrect test case for local parent resolution. Maven ignored
  the '<version>' in '<parent>' elements for local parent resolution. The core
  has been updated across various versions to eliminate any differences between
  local and remote parent resolution. When local parent resolution had been
  updated to match remote parent resolution, an existing IT started to fail
  testing incorrect behaviour. As soon as the '<parent>' is referenced using a
  version range, the '<version>' element in the project becomes mandatory and
  does no longer support using an expression any more. This has been that way
  for remote parent resolution from day one. It has never been supported to
  inherit a version from a parent when referencing that parent using a version
  range intentionally.
o Updated to account for updated error messages.


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/e6ca0fb2
Tree: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/tree/e6ca0fb2
Diff: http://git-wip-us.apache.org/repos/asf/maven-integration-testing/diff/e6ca0fb2

Branch: refs/heads/MNG-2199
Commit: e6ca0fb2d02442855028d6fe8ff91342f7acbd43
Parents: c4365ab
Author: Christian Schulte <sc...@apache.org>
Authored: Sat Dec 12 19:25:15 2015 +0100
Committer: Christian Schulte <sc...@apache.org>
Committed: Fri Jan 27 22:42:42 2017 +0100

----------------------------------------------------------------------
 .../apache/maven/it/IntegrationTestSuite.java   |   2 +
 ...mng2199DeprecatedParentVersionRangeTest.java |  64 ++++++
 ...MavenITmng2199ParentVersionRange350Test.java | 199 +++++++++++++++++++
 .../MavenITmng2199ParentVersionRangeTest.java   |  98 +++++----
 .../expression-local/child/pom.xml              |  12 ++
 .../expression-local/pom.xml                    |  10 +
 .../inherited-local/child/pom.xml               |  11 +
 .../inherited-local/pom.xml                     |  10 +
 .../invalid-local/child/pom.xml                 |  12 ++
 .../invalid-local/pom.xml                       |  10 +
 .../local-fallback-to-remote/child/pom.xml      |  18 ++
 .../local-fallback-to-remote/pom.xml            |   8 +
 .../valid-local/child/pom.xml                   |  11 +
 .../valid-local/pom.xml                         |  10 +
 14 files changed, 432 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/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 a91eeb0..1f83b1f 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
@@ -123,6 +123,8 @@ public class IntegrationTestSuite
         suite.addTestSuite( MavenITmng5663NestedImportScopePomResolutionTest.class );
         suite.addTestSuite( MavenITmng2562Timestamp322Test.class );
         suite.addTestSuite( MavenITmng2199ParentVersionRangeTest.class );
+        suite.addTestSuite( MavenITmng2199ParentVersionRange350Test.class );
+        suite.addTestSuite( MavenITmng2199DeprecatedParentVersionRangeTest.class );
         suite.addTestSuite( MavenITmng5640LifecycleParticipantAfterSessionEnd.class );
         suite.addTestSuite( MavenITmng5639ImportScopePomResolutionTest.class );
         suite.addTestSuite( MavenITmng5608ProfileActivationWarningTest.class );

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199DeprecatedParentVersionRangeTest.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199DeprecatedParentVersionRangeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199DeprecatedParentVersionRangeTest.java
new file mode 100644
index 0000000..d758e07
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199DeprecatedParentVersionRangeTest.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2014 The Apache Software Foundation.
+ *
+ * Licensed 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.it.util.ResourceExtractor;
+
+public class MavenITmng2199DeprecatedParentVersionRangeTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng2199DeprecatedParentVersionRangeTest()
+    {
+        // This test originally declared [3.2.2,) as the range although the project is not supported by that version.
+        // The first version supporting such projects is Maven 3.3.0 and that is not by design. Commit
+        // be3fb200326208ca4b8c41ebf16d5ae6b8049792 removed all version validation logic from local parent resolution.
+        // This is the only reason this test succeeds with Maven >= 3.3.0. You could have left out the parent version
+        // element completely and the test still succeeds with 3.3.0 <= Maven < 3.5.0. It never should have. Local
+        // parent version validation logic had been re-added in 3.3.4, then reviewed in 3.3.6 (still supporting such
+        // projects) and then finally made consistent to remote parent resolution in 3.5.0 which stops such projects
+        // from being supported again as it was the case in any Maven version prior 3.3.0.
+        super( "[3.3.0,3.3.9]" );
+    }
+
+    public void testBrokenProjectSilentlyProcessedUpToVerify()
+        throws Exception
+    {
+        // This test isn't actually testing anything version range related.
+        Verifier verifier = null;
+        File testDir =
+            ResourceExtractor.simpleExtractResources( getClass(), "/mng-2199-parent-version-range/local-parent" );
+
+        try
+        {
+            verifier = newVerifier( testDir.getAbsolutePath(), "remote" );
+            verifier.addCliOption( "-U" );
+            verifier.setAutoclean( false );
+
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+        }
+        finally
+        {
+            if ( verifier != null )
+            {
+                verifier.resetStreams();
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199ParentVersionRange350Test.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199ParentVersionRange350Test.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199ParentVersionRange350Test.java
new file mode 100644
index 0000000..97d6cbb
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199ParentVersionRange350Test.java
@@ -0,0 +1,199 @@
+/*
+ * Copyright 2014 The Apache Software Foundation.
+ *
+ * Licensed 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 java.util.List;
+import java.util.regex.Pattern;
+import org.apache.maven.it.util.ResourceExtractor;
+
+public class MavenITmng2199ParentVersionRange350Test
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng2199ParentVersionRange350Test()
+    {
+        super( "[3.5.0,)" );
+    }
+
+    public void testValidLocalParentVersionRange()
+        throws Exception
+    {
+        Verifier verifier = null;
+        File testDir = ResourceExtractor.simpleExtractResources(
+            getClass(), "/mng-2199-parent-version-range/valid-local/child" );
+
+        try
+        {
+            verifier = newVerifier( testDir.getAbsolutePath() );
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+
+            // All Maven versions not supporting remote parent version ranges will log a warning message whenever
+            // building a parent fails. The build succeeds without any parent. If that warning message appears in the
+            // log, parent resolution failed. For this test, this really just tests the project on disk getting tested
+            // is not corrupt. It's expected to find the local parent and not fall back to remote resolution. If it
+            // falls back to remote resolution, this just catches the test project to be broken.
+            final List<String> lines = verifier.loadFile( new File( testDir, "log.txt" ), false );
+            assertFalse( "Unxpected error message found.",
+                         indexOf( lines, ".*Failed to build parent project.*" ) >= 0 );
+
+        }
+        finally
+        {
+            if ( verifier != null )
+            {
+                verifier.resetStreams();
+            }
+        }
+    }
+
+    public void testInvalidLocalParentVersionRange()
+        throws Exception
+    {
+        // Fallback to remote resolution not tested here. Remote parent expected to not be available anywhere.
+        Verifier verifier = null;
+        File testDir = ResourceExtractor.simpleExtractResources(
+            getClass(), "/mng-2199-parent-version-range/invalid-local/child" );
+
+        try
+        {
+            verifier = newVerifier( testDir.getAbsolutePath() );
+            verifier.executeGoal( "verify" );
+            fail( "Expected 'VerificationException' not thrown." );
+        }
+        catch ( final VerificationException e )
+        {
+            assertNotNull( verifier );
+            final List<String> lines = verifier.loadFile( new File( testDir, "log.txt" ), false );
+            int msg = indexOf( lines, ".*Non-resolvable parent POM org.apache.maven.its.mng2199:local-parent:[2,3].*" );
+            assertTrue( "Expected error message not found.", msg >= 0 );
+        }
+        finally
+        {
+            if ( verifier != null )
+            {
+                verifier.resetStreams();
+            }
+        }
+    }
+
+    public void testInvalidLocalParentVersionRangeFallingBackToRemote()
+        throws Exception
+    {
+        Verifier verifier = null;
+        File testDir = ResourceExtractor.simpleExtractResources(
+            getClass(), "/mng-2199-parent-version-range/local-fallback-to-remote/child" );
+
+        try
+        {
+            verifier = newVerifier( testDir.getAbsolutePath(), "remote" );
+            verifier.executeGoal( "verify" );
+            verifier.verifyErrorFreeLog();
+
+            // All Maven versions not supporting remote parent version ranges will log a warning message whenever
+            // building a parent fails. The build succeeds without any parent. If that warning message appears in the
+            // log, parent resolution failed. For this test, local parent resolution falls back to remote parent
+            // resolution with a version range in use. If the warning message is in the logs, that remote parent
+            // resolution failed unexpectedly.
+            final List<String> lines = verifier.loadFile( new File( testDir, "log.txt" ), false );
+            assertFalse( "Unxpected error message found.",
+                         indexOf( lines, ".*Failed to build parent project.*" ) >= 0 );
+
+        }
+        finally
+        {
+            if ( verifier != null )
+            {
+                verifier.resetStreams();
+            }
+        }
+    }
+
+    public void testValidLocalParentVersionRangeInvalidVersionExpression()
+        throws Exception
+    {
+        Verifier verifier = null;
+        File testDir = ResourceExtractor.simpleExtractResources(
+            getClass(), "/mng-2199-parent-version-range/expression-local/child" );
+
+        try
+        {
+            verifier = newVerifier( testDir.getAbsolutePath() );
+            verifier.executeGoal( "verify" );
+            fail( "Expected 'VerificationException' not thrown." );
+        }
+        catch ( final VerificationException e )
+        {
+            assertNotNull( verifier );
+            final List<String> lines = verifier.loadFile( new File( testDir, "log.txt" ), false );
+            int msg = indexOf( lines, ".*Version must be a constant.*org.apache.maven.its.mng2199:expression.*" );
+            assertTrue( "Expected error message not found.", msg >= 0 );
+        }
+        finally
+        {
+            if ( verifier != null )
+            {
+                verifier.resetStreams();
+            }
+        }
+    }
+
+    public void testValidLocalParentVersionRangeInvalidVersionInheritance()
+        throws Exception
+    {
+        Verifier verifier = null;
+        File testDir = ResourceExtractor.simpleExtractResources(
+            getClass(), "/mng-2199-parent-version-range/inherited-local/child" );
+
+        try
+        {
+            verifier = newVerifier( testDir.getAbsolutePath() );
+            verifier.executeGoal( "verify" );
+            fail( "Expected 'VerificationException' not thrown." );
+        }
+        catch ( final VerificationException e )
+        {
+            assertNotNull( verifier );
+            final List<String> lines = verifier.loadFile( new File( testDir, "log.txt" ), false );
+            int msg = indexOf( lines, ".*Version must be a constant.*org.apache.maven.its.mng2199:inherited.*" );
+            assertTrue( "Expected error message not found.", msg >= 0 );
+        }
+        finally
+        {
+            if ( verifier != null )
+            {
+                verifier.resetStreams();
+            }
+        }
+    }
+
+    private static int indexOf( final List<String> logLines, final String regex )
+    {
+        final Pattern pattern = Pattern.compile( regex );
+
+        for ( int i = 0, l0 = logLines.size(); i < l0; i++ )
+        {
+            if ( pattern.matcher( logLines.get( i ) ).matches() )
+            {
+                return i;
+            }
+        }
+
+        return -1;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199ParentVersionRangeTest.java
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199ParentVersionRangeTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199ParentVersionRangeTest.java
index 16ac91c..d6bfdf9 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199ParentVersionRangeTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2199ParentVersionRangeTest.java
@@ -33,7 +33,9 @@ public class MavenITmng2199ParentVersionRangeTest
         throws Exception
     {
         Verifier verifier = null;
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2199-parent-version-range/valid-inclusive-upper-bound" );
+        File testDir =
+            ResourceExtractor.simpleExtractResources( getClass(),
+                                                      "/mng-2199-parent-version-range/valid-inclusive-upper-bound" );
 
         try
         {
@@ -43,10 +45,21 @@ public class MavenITmng2199ParentVersionRangeTest
 
             verifier.executeGoal( "verify" );
             verifier.verifyErrorFreeLog();
+
+            // All Maven versions not supporting remote parent version ranges will log a warning message whenever
+            // building a parent fails. The build succeeds without any parent. If that warning message appears in the
+            // log, parent resolution failed.
+            final List<String> lines = verifier.loadFile( new File( testDir, "log.txt" ), false );
+            assertFalse( "Unxpected error message found.",
+                         indexOf( lines, ".*Failed to build parent project.*" ) >= 0 );
+
         }
         finally
         {
-            verifier.resetStreams();
+            if ( verifier != null )
+            {
+                verifier.resetStreams();
+            }
         }
     }
 
@@ -54,7 +67,8 @@ public class MavenITmng2199ParentVersionRangeTest
         throws Exception
     {
         Verifier verifier = null;
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2199-parent-version-range/valid-exclusive-upper-bound" );
+        File testDir = ResourceExtractor.simpleExtractResources(
+            getClass(), "/mng-2199-parent-version-range/valid-exclusive-upper-bound" );
 
         try
         {
@@ -64,14 +78,25 @@ public class MavenITmng2199ParentVersionRangeTest
 
             verifier.executeGoal( "verify" );
             verifier.verifyErrorFreeLog();
+
+            // All Maven versions not supporting remote parent version ranges will log a warning message whenever
+            // building a parent fails. The build succeeds without any parent. If that warning message appears in the
+            // log, parent resolution failed.
+            final List<String> lines = verifier.loadFile( new File( testDir, "log.txt" ), false );
+            assertFalse( "Unxpected error message found.",
+                         indexOf( lines, ".*Failed to build parent project.*" ) >= 0 );
+
         }
         finally
         {
-            verifier.resetStreams();
+            if ( verifier != null )
+            {
+                verifier.resetStreams();
+            }
         }
     }
 
-    public void testInvalidParentVersionRange()
+    public void testInvalidParentVersionRangeWithoutUpperBound()
         throws Exception
     {
         Verifier verifier = null;
@@ -87,13 +112,18 @@ public class MavenITmng2199ParentVersionRangeTest
         }
         catch ( final VerificationException e )
         {
+            assertNotNull( verifier );
             final List<String> lines = verifier.loadFile( new File( testDir, "log.txt" ), false );
-            int msg = indexOf( lines, ".*The requested version range.*does not specify an upper bound.*" );
-            assertTrue( "Expected error message not found.", msg >= 0 );
+            assertTrue( "Expected error message not found.",
+                        indexOf( lines, ".*(parent)? version range.*does not specify an upper bound.*" ) >= 0 );
+
         }
         finally
         {
-            verifier.resetStreams();
+            if ( verifier != null )
+            {
+                verifier.resetStreams();
+            }
         }
     }
 
@@ -101,8 +131,8 @@ public class MavenITmng2199ParentVersionRangeTest
         throws Exception
     {
         Verifier verifier = null;
-        File testDir =
-            ResourceExtractor.simpleExtractResources( getClass(), "/mng-2199-parent-version-range/expression" );
+        File testDir = ResourceExtractor.simpleExtractResources(
+            getClass(), "/mng-2199-parent-version-range/expression" );
 
         try
         {
@@ -114,16 +144,17 @@ public class MavenITmng2199ParentVersionRangeTest
         }
         catch ( final VerificationException e )
         {
+            assertNotNull( verifier );
             final List<String> lines = verifier.loadFile( new File( testDir, "log.txt" ), false );
-            int msg =
-                indexOf( lines,
-                         ".*Version must be a constant @ org.apache.maven.its.mng2199:expression:\\$\\{project.parent.version\\}.*" );
-
+            int msg = indexOf( lines, ".*Version must be a constant.*org.apache.maven.its.mng2199:expression.*" );
             assertTrue( "Expected error message not found.", msg >= 0 );
         }
         finally
         {
-            verifier.resetStreams();
+            if ( verifier != null )
+            {
+                verifier.resetStreams();
+            }
         }
     }
 
@@ -131,8 +162,8 @@ public class MavenITmng2199ParentVersionRangeTest
         throws Exception
     {
         Verifier verifier = null;
-        File testDir =
-            ResourceExtractor.simpleExtractResources( getClass(), "/mng-2199-parent-version-range/inherited" );
+        File testDir = ResourceExtractor.simpleExtractResources(
+            getClass(), "/mng-2199-parent-version-range/inherited" );
 
         try
         {
@@ -144,37 +175,17 @@ public class MavenITmng2199ParentVersionRangeTest
         }
         catch ( final VerificationException e )
         {
+            assertNotNull( verifier );
             final List<String> lines = verifier.loadFile( new File( testDir, "log.txt" ), false );
-            int msg =
-                indexOf( lines,
-                         ".*Version must be a constant @ org.apache.maven.its.mng2199:inherited:\\[unknown-version\\].*" );
-
+            int msg = indexOf( lines, ".*Version must be a constant.*org.apache.maven.its.mng2199:inherited.*" );
             assertTrue( "Expected error message not found.", msg >= 0 );
         }
         finally
         {
-            verifier.resetStreams();
-        }
-    }
-
-    public void testValidLocalParentVersionRange()
-        throws Exception
-    {
-        Verifier verifier = null;
-        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-2199-parent-version-range/local-parent" );
-
-        try
-        {
-            verifier = newVerifier( testDir.getAbsolutePath(), "remote" );
-            verifier.addCliOption( "-U" );
-            verifier.setAutoclean( false );
-
-            verifier.executeGoal( "verify" );
-            verifier.verifyErrorFreeLog();
-        }
-        finally
-        {
-            verifier.resetStreams();
+            if ( verifier != null )
+            {
+                verifier.resetStreams();
+            }
         }
     }
 
@@ -192,4 +203,5 @@ public class MavenITmng2199ParentVersionRangeTest
 
         return -1;
     }
+
 }

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/core-it-suite/src/test/resources/mng-2199-parent-version-range/expression-local/child/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-2199-parent-version-range/expression-local/child/pom.xml b/core-it-suite/src/test/resources/mng-2199-parent-version-range/expression-local/child/pom.xml
new file mode 100644
index 0000000..39a2210
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-2199-parent-version-range/expression-local/child/pom.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <parent>
+    <groupId>org.apache.maven.its.mng2199</groupId>
+    <artifactId>local-parent</artifactId>
+    <version>[1,2]</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>expression</artifactId>
+  <!-- Must not use expressions, when using version ranges. -->
+  <version>${project.parent.version}</version>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/core-it-suite/src/test/resources/mng-2199-parent-version-range/expression-local/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-2199-parent-version-range/expression-local/pom.xml b/core-it-suite/src/test/resources/mng-2199-parent-version-range/expression-local/pom.xml
new file mode 100644
index 0000000..dfa12d6
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-2199-parent-version-range/expression-local/pom.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng2199</groupId>
+  <artifactId>local-parent</artifactId>
+  <version>1</version>
+  <packaging>pom</packaging>
+  <name>Maven Integration Test :: MNG-2199 :: Invalid Local Version Expression</name>
+  <description>Verifies that the build fails when using a parent version range in combination with a version expression for local parent resolution.</description>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/core-it-suite/src/test/resources/mng-2199-parent-version-range/inherited-local/child/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-2199-parent-version-range/inherited-local/child/pom.xml b/core-it-suite/src/test/resources/mng-2199-parent-version-range/inherited-local/child/pom.xml
new file mode 100644
index 0000000..9d54edd
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-2199-parent-version-range/inherited-local/child/pom.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <parent>
+    <groupId>org.apache.maven.its.mng2199</groupId>
+    <artifactId>local-parent</artifactId>
+    <version>[1,2]</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>inherited</artifactId>
+  <!-- Must not inherit version, when using version ranges. -->
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/core-it-suite/src/test/resources/mng-2199-parent-version-range/inherited-local/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-2199-parent-version-range/inherited-local/pom.xml b/core-it-suite/src/test/resources/mng-2199-parent-version-range/inherited-local/pom.xml
new file mode 100644
index 0000000..bcf66bf
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-2199-parent-version-range/inherited-local/pom.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng2199</groupId>
+  <artifactId>local-parent</artifactId>
+  <version>1</version>
+  <packaging>pom</packaging>
+  <name>Maven Integration Test :: MNG-2199 :: Invalid Local Version Inheritance</name>
+  <description>Verifies that the build fails when using a parent version range in combination with an inherited version.</description>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/core-it-suite/src/test/resources/mng-2199-parent-version-range/invalid-local/child/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-2199-parent-version-range/invalid-local/child/pom.xml b/core-it-suite/src/test/resources/mng-2199-parent-version-range/invalid-local/child/pom.xml
new file mode 100644
index 0000000..d9498d5
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-2199-parent-version-range/invalid-local/child/pom.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <parent>
+    <groupId>org.apache.maven.its.mng2199</groupId>
+    <artifactId>local-parent</artifactId>
+    <!-- Not available anywhere. Not on disk, not in repository. -->
+    <version>[2,3]</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>invalid</artifactId>
+  <version>1</version>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/core-it-suite/src/test/resources/mng-2199-parent-version-range/invalid-local/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-2199-parent-version-range/invalid-local/pom.xml b/core-it-suite/src/test/resources/mng-2199-parent-version-range/invalid-local/pom.xml
new file mode 100644
index 0000000..4e646fc
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-2199-parent-version-range/invalid-local/pom.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng2199</groupId>
+  <artifactId>local-parent</artifactId>
+  <version>1</version>
+  <packaging>pom</packaging>
+  <name>Maven Integration Test :: MNG-2199 :: Invalid Local Parent Version</name>
+  <description>Verifies that the build fails when using a parent version range not matching what is on disk (fallback to remote is not tested here - the parent does not exist anywhere but on disk).</description>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/core-it-suite/src/test/resources/mng-2199-parent-version-range/local-fallback-to-remote/child/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-2199-parent-version-range/local-fallback-to-remote/child/pom.xml b/core-it-suite/src/test/resources/mng-2199-parent-version-range/local-fallback-to-remote/child/pom.xml
new file mode 100644
index 0000000..346df47
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-2199-parent-version-range/local-fallback-to-remote/child/pom.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache</groupId>
+    <artifactId>apache</artifactId>
+    <!-- Not found on disk, but available remotely. -->
+    <version>[1,15)</version>
+  </parent>
+  <groupId>org.apache.maven.its.mng2199</groupId>
+  <artifactId>valid</artifactId>
+  <version>1</version>
+  <packaging>pom</packaging>
+
+  <name>Maven Integration Test :: MNG-2199 :: Valid POM</name>
+  <description>Verifies that the build succeeds by falling back to remote parent resolution when the local parent does not mach the range.</description>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/core-it-suite/src/test/resources/mng-2199-parent-version-range/local-fallback-to-remote/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-2199-parent-version-range/local-fallback-to-remote/pom.xml b/core-it-suite/src/test/resources/mng-2199-parent-version-range/local-fallback-to-remote/pom.xml
new file mode 100644
index 0000000..fa4eb52
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-2199-parent-version-range/local-fallback-to-remote/pom.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache</groupId>
+  <artifactId>apache</artifactId>
+  <version>DOES NOT EXIST</version>
+  <packaging>pom</packaging>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/core-it-suite/src/test/resources/mng-2199-parent-version-range/valid-local/child/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-2199-parent-version-range/valid-local/child/pom.xml b/core-it-suite/src/test/resources/mng-2199-parent-version-range/valid-local/child/pom.xml
new file mode 100644
index 0000000..e61f908
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-2199-parent-version-range/valid-local/child/pom.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <parent>
+    <groupId>org.apache.maven.its.mng2199</groupId>
+    <artifactId>local-parent</artifactId>
+    <version>[1,2]</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>valid</artifactId>
+  <version>3.4.5</version>
+</project>

http://git-wip-us.apache.org/repos/asf/maven-integration-testing/blob/e6ca0fb2/core-it-suite/src/test/resources/mng-2199-parent-version-range/valid-local/pom.xml
----------------------------------------------------------------------
diff --git a/core-it-suite/src/test/resources/mng-2199-parent-version-range/valid-local/pom.xml b/core-it-suite/src/test/resources/mng-2199-parent-version-range/valid-local/pom.xml
new file mode 100644
index 0000000..559f3ae
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-2199-parent-version-range/valid-local/pom.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng2199</groupId>
+  <artifactId>local-parent</artifactId>
+  <version>1</version>
+  <packaging>pom</packaging>
+  <name>Maven Integration Test :: MNG-2199 :: Valid Local Parent Version Range</name>
+  <description>Verifies that the build succeeds when using a parent version range for local parent resolution.</description>
+</project>