diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
index d2e291086a..d5ba0b2735 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
@@ -92,6 +92,7 @@ public class IntegrationTestSuite
// suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
// suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
+ suite.addTestSuite( MavenITmng4086ExplicitPluginMetaversionTest.class );
suite.addTestSuite( MavenITmng4072InactiveProfileReposTest.class );
suite.addTestSuite( MavenITmng4070WhitespaceTrimmingTest.class );
suite.addTestSuite( MavenITmng4068AuthenticatedMirrorTest.class );
diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4086ExplicitPluginMetaversionTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4086ExplicitPluginMetaversionTest.java
new file mode 100644
index 0000000000..2dfa89976b
--- /dev/null
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4086ExplicitPluginMetaversionTest.java
@@ -0,0 +1,93 @@
+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 org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * This is a test set for MNG-4086.
+ *
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4086ExplicitPluginMetaversionTest
+ extends AbstractMavenIntegrationTestCase
+{
+
+ public MavenITmng4086ExplicitPluginMetaversionTest()
+ {
+ super( "[2.0.6,)" );
+ }
+
+ /**
+ * Verify that the plugin metaversion RELEASE can be explicitly used and especially is resolved
+ * to a proper version before the plugin manager creates the key for the plugin realm.
+ */
+ public void testitRelease()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4086" );
+
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "target" );
+ verifier.deleteArtifacts( "org.apache.maven.its.mng4086" );
+ verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
+ verifier.getCliOptions().add( "--settings" );
+ verifier.getCliOptions().add( "settings.xml" );
+ verifier.setLogFileName( "log-release.txt" );
+ verifier.executeGoal( "org.apache.maven.its.mng4086:maven-it-plugin-a:RELEASE:touch" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ verifier.assertFileNotPresent( "target/touch-latest.txt" );
+ verifier.assertFilePresent( "target/touch-release.txt" );
+ }
+
+ /**
+ * Verify that the plugin metaversion LATEST can be explicitly used and especially is resolved
+ * to a proper version before the plugin manager creates the key for the plugin realm.
+ */
+ public void testitLatest()
+ throws Exception
+ {
+ File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4086" );
+
+ Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+ verifier.setAutoclean( false );
+ verifier.deleteDirectory( "target" );
+ verifier.deleteArtifacts( "org.apache.maven.its.mng4086" );
+ verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
+ verifier.getCliOptions().add( "--settings" );
+ verifier.getCliOptions().add( "settings.xml" );
+ verifier.setLogFileName( "log-latest.txt" );
+ verifier.executeGoal( "org.apache.maven.its.mng4086:maven-it-plugin-a:LATEST:touch" );
+ verifier.verifyErrorFreeLog();
+ verifier.resetStreams();
+
+ verifier.assertFileNotPresent( "target/touch-release.txt" );
+ verifier.assertFilePresent( "target/touch-latest.txt" );
+ }
+
+}
diff --git a/its/core-it-suite/src/test/resources/mng-4086/pom.xml b/its/core-it-suite/src/test/resources/mng-4086/pom.xml
new file mode 100644
index 0000000000..ce47c50b30
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4086/pom.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.mng04086
+ test
+ 1.0-SNAPSHOT
+ pom
+
+ Maven Integration Test :: MNG-4086
+
+ Verify that the plugin metaversions RELEASE and LATEST can be explicitly used and especially are resolved
+ to a proper version before the plugin manager creates the key for the plugin realm.
+
+
diff --git a/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.1/maven-it-plugin-a-0.1.jar b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.1/maven-it-plugin-a-0.1.jar
new file mode 100644
index 0000000000..926b95c7e9
Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.1/maven-it-plugin-a-0.1.jar differ
diff --git a/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.1/maven-it-plugin-a-0.1.pom b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.1/maven-it-plugin-a-0.1.pom
new file mode 100644
index 0000000000..7b6d9f4859
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.1/maven-it-plugin-a-0.1.pom
@@ -0,0 +1,69 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.mng4086
+ maven-it-plugin-a
+ 0.1
+ maven-plugin
+
+ Maven Integration Test Plugin :: Touch
+
+ A test plugin that creates an empty file.
+
+ 2009
+
+
+
+ maven-core-it
+ file:///${basedir}/repo
+
+
+
+
+ true
+
+
+
+
+ org.apache.maven
+ maven-plugin-api
+ 2.0
+
+
+
+
+
+
+ .
+
+ pom.xml
+ src/**
+
+
+
+ src/main/resources
+
+
+
+
diff --git a/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.2-SNAPSHOT/maven-it-plugin-a-0.2-20090315.124508-1.jar b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.2-SNAPSHOT/maven-it-plugin-a-0.2-20090315.124508-1.jar
new file mode 100644
index 0000000000..4ebb8c5a38
Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.2-SNAPSHOT/maven-it-plugin-a-0.2-20090315.124508-1.jar differ
diff --git a/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.2-SNAPSHOT/maven-it-plugin-a-0.2-20090315.124508-1.pom b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.2-SNAPSHOT/maven-it-plugin-a-0.2-20090315.124508-1.pom
new file mode 100644
index 0000000000..d8813cc52c
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.2-SNAPSHOT/maven-it-plugin-a-0.2-20090315.124508-1.pom
@@ -0,0 +1,69 @@
+
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.its.mng4086
+ maven-it-plugin-a
+ 0.2-SNAPSHOT
+ maven-plugin
+
+ Maven Integration Test Plugin :: Touch
+
+ A test plugin that creates an empty file.
+
+ 2009
+
+
+
+ maven-core-it
+ file:///${basedir}/repo
+
+
+
+
+ true
+
+
+
+
+ org.apache.maven
+ maven-plugin-api
+ 2.0
+
+
+
+
+
+
+ .
+
+ pom.xml
+ src/**
+
+
+
+ src/main/resources
+
+
+
+
diff --git a/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.2-SNAPSHOT/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.2-SNAPSHOT/maven-metadata.xml
new file mode 100644
index 0000000000..3317708ff9
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/0.2-SNAPSHOT/maven-metadata.xml
@@ -0,0 +1,13 @@
+
+
+ org.apache.maven.its.mng4086
+ maven-it-plugin-a
+ 0.2-SNAPSHOT
+
+
+ 20090315.124508
+ 1
+
+ 20090315124508
+
+
diff --git a/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/maven-metadata.xml
new file mode 100644
index 0000000000..bbdc954a71
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-it-plugin-a/maven-metadata.xml
@@ -0,0 +1,15 @@
+
+
+ org.apache.maven.its.mng4086
+ maven-it-plugin-a
+ 0.1
+
+ 0.2-SNAPSHOT
+ 0.1
+
+ 0.1
+ 0.2-SNAPSHOT
+
+ 20090315124508
+
+
diff --git a/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-metadata.xml b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-metadata.xml
new file mode 100644
index 0000000000..5084d6ea76
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4086/repo/org/apache/maven/its/mng4086/maven-metadata.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ Maven Integration Test Plugin :: Touch
+ ita
+ maven-it-plugin-a
+
+
+
diff --git a/its/core-it-suite/src/test/resources/mng-4086/settings-template.xml b/its/core-it-suite/src/test/resources/mng-4086/settings-template.xml
new file mode 100644
index 0000000000..4b009b2d96
--- /dev/null
+++ b/its/core-it-suite/src/test/resources/mng-4086/settings-template.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+ test-mirror
+ @baseurl@/repo-null
+ central
+
+
+
+
+ mng-4086
+
+
+ maven-core-it
+ @baseurl@/repo
+
+ ignore
+
+
+ ignore
+
+
+
+
+
+ maven-core-it
+ @baseurl@/repo
+
+ ignore
+
+
+ ignore
+
+
+
+
+
+
+ mng-4086
+
+