You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by he...@apache.org on 2022/08/26 17:34:34 UTC

[maven-integration-testing] branch master updated: [MNG-7529] Integration test for MNG-7529

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

henning 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 b6570c98c [MNG-7529] Integration test for MNG-7529
     new a7ca144aa Merge pull request #189 from hgschmie/mng-7529
b6570c98c is described below

commit b6570c98c48300dd03fd5fe2068b5734c463264d
Author: Henning P. Schmiedehausen <he...@schmiedehausen.org>
AuthorDate: Sat Aug 20 14:28:53 2022 -0700

    [MNG-7529] Integration test for MNG-7529
    
    This test checks whether version range resolution with multiple repositories maps releases onto repos that
    are not enabled for releases.
    
    Tested with 3.8.x, 3.9.x and master. Reliably fails without the MNG-7529 fix applies, reliable passes with
    the fix applied.
---
 .../org/apache/maven/it/IntegrationTestSuite.java  |   1 +
 ...enITmng7529VersionRangeRepositorySelection.java |  57 +++++++++++++++
 .../src/test/resources/mng-7529/.gitattributes     |   3 +
 core-it-suite/src/test/resources/mng-7529/pom.xml  |  62 +++++++++++++++++
 .../test/resources/mng-7529/repo/.gitattributes    |   3 +
 .../org/apache/maven/its/mng7529/a/1.0/a-1.0.jar   | Bin 0 -> 4394 bytes
 .../apache/maven/its/mng7529/a/1.0/a-1.0.jar.sha1  |   1 +
 .../org/apache/maven/its/mng7529/a/1.0/a-1.0.pom   |  28 ++++++++
 .../apache/maven/its/mng7529/a/1.0/a-1.0.pom.sha1  |   1 +
 .../org/apache/maven/its/mng7529/a/1.1/a-1.1.jar   | Bin 0 -> 4394 bytes
 .../apache/maven/its/mng7529/a/1.1/a-1.1.jar.sha1  |   1 +
 .../org/apache/maven/its/mng7529/a/1.1/a-1.1.pom   |  29 ++++++++
 .../apache/maven/its/mng7529/a/1.1/a-1.1.pom.sha1  |   1 +
 .../apache/maven/its/mng7529/a/maven-metadata.xml  |  13 ++++
 .../maven/its/mng7529/a/maven-metadata.xml.sha1    |   1 +
 .../test/resources/mng-7529/settings-template.xml  |  61 ++++++++++++++++
 .../core-it-plugins/mng7529-plugin/pom.xml         |  66 ++++++++++++++++++
 .../maven/its/mng7529/plugin/ResolveMojo.java      |  77 +++++++++++++++++++++
 core-it-support/core-it-plugins/pom.xml            |   1 +
 19 files changed, 406 insertions(+)

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 eddacd921..8f3f160f9 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,6 +106,7 @@ public class IntegrationTestSuite
         // Tests that don't run stable and need to be fixed
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
+        suite.addTestSuite( MavenITmng7529VersionRangeRepositorySelection.class );
         suite.addTestSuite( MavenITmng7443ConsistencyOfOptionalProjectsAndProfilesTest.class );
         suite.addTestSuite( MavenITmng7353CliGoalInvocationTest.class );
         suite.addTestSuite( MavenITmng7504NotWarnUnsupportedReportPluginsTest.class );
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7529VersionRangeRepositorySelection.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7529VersionRangeRepositorySelection.java
new file mode 100644
index 000000000..341e657b2
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7529VersionRangeRepositorySelection.java
@@ -0,0 +1,57 @@
+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 java.io.File;
+import java.util.Properties;
+import org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-7529">MNG-7529</a>.
+ */
+public class MavenITmng7529VersionRangeRepositorySelection
+    extends AbstractMavenIntegrationTestCase {
+
+  public MavenITmng7529VersionRangeRepositorySelection() {
+    super("(3.8.6,)");
+  }
+
+  /**
+   * Test dependency resolution from a version range using multiple remote repositories
+   * with snapshot or release enabled.
+   *
+   * @throws Exception in case of failure
+   */
+  public void testit()
+      throws Exception {
+    File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-7529");
+    Verifier verifier = newVerifier(testDir.getAbsolutePath());
+    verifier.setAutoclean(false);
+    verifier.deleteDirectory("target");
+    verifier.deleteArtifacts("org.apache.maven.its.mng7529");
+    verifier.addCliOption("--settings");
+    verifier.addCliOption("settings.xml");
+
+    verifier.filterFile("settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties());
+    verifier.executeGoal("validate");
+    verifier.verifyErrorFreeLog();
+    verifier.resetStreams();
+  }
+}
diff --git a/core-it-suite/src/test/resources/mng-7529/.gitattributes b/core-it-suite/src/test/resources/mng-7529/.gitattributes
new file mode 100644
index 000000000..e3bce59d1
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7529/.gitattributes
@@ -0,0 +1,3 @@
+*.pom    text eol=lf
+maven-metadata.xml    text eol=lf
+
diff --git a/core-it-suite/src/test/resources/mng-7529/pom.xml b/core-it-suite/src/test/resources/mng-7529/pom.xml
new file mode 100644
index 000000000..2a39a105e
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7529/pom.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.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng7529</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1</version>
+  <packaging>jar</packaging>
+
+  <name>Maven Integration Test :: MNG-7529</name>
+  <description>
+    Verify that artifact ranges are resolved to the right release repository.
+  </description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.its.mng7529</groupId>
+      <artifactId>a</artifactId>
+      <version>(0.0,]</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>mng-7529-version-range-repository-selection-plugin</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <id>resolve</id>
+            <phase>validate</phase>
+            <goals>
+              <goal>resolve</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-7529/repo/.gitattributes b/core-it-suite/src/test/resources/mng-7529/repo/.gitattributes
new file mode 100644
index 000000000..e3bce59d1
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7529/repo/.gitattributes
@@ -0,0 +1,3 @@
+*.pom    text eol=lf
+maven-metadata.xml    text eol=lf
+
diff --git a/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.0/a-1.0.jar b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.0/a-1.0.jar
new file mode 100644
index 000000000..b3f60649d
Binary files /dev/null and b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.0/a-1.0.jar differ
diff --git a/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.0/a-1.0.jar.sha1 b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.0/a-1.0.jar.sha1
new file mode 100644
index 000000000..f3ef6b933
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.0/a-1.0.jar.sha1
@@ -0,0 +1 @@
+d532fcb4ba249192671e9954b80422819ce72679
diff --git a/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.0/a-1.0.pom b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.0/a-1.0.pom
new file mode 100644
index 000000000..810c1b6d1
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.0/a-1.0.pom
@@ -0,0 +1,28 @@
+<?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>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.its.mng7529</groupId>
+  <artifactId>a</artifactId>
+  <version>1.0</version>
+  <packaging>jar</packaging>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.0/a-1.0.pom.sha1 b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.0/a-1.0.pom.sha1
new file mode 100644
index 000000000..1bfa2dd51
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.0/a-1.0.pom.sha1
@@ -0,0 +1 @@
+e231c56d8ec5e15fa40147933ece7335cb450b80
diff --git a/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.1/a-1.1.jar b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.1/a-1.1.jar
new file mode 100644
index 000000000..b3f60649d
Binary files /dev/null and b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.1/a-1.1.jar differ
diff --git a/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.1/a-1.1.jar.sha1 b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.1/a-1.1.jar.sha1
new file mode 100644
index 000000000..f3ef6b933
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.1/a-1.1.jar.sha1
@@ -0,0 +1 @@
+d532fcb4ba249192671e9954b80422819ce72679
diff --git a/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.1/a-1.1.pom b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.1/a-1.1.pom
new file mode 100644
index 000000000..093ae54cf
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.1/a-1.1.pom
@@ -0,0 +1,29 @@
+<?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>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng7529</groupId>
+  <artifactId>a</artifactId>
+  <version>1.1</version>
+  <packaging>jar</packaging>
+</project>
diff --git a/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.1/a-1.1.pom.sha1 b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.1/a-1.1.pom.sha1
new file mode 100644
index 000000000..993259be3
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/1.1/a-1.1.pom.sha1
@@ -0,0 +1 @@
+2463dfbdb7f0a1efbb1163e39dfed1f5a4a8bdc5
diff --git a/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/maven-metadata.xml b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/maven-metadata.xml
new file mode 100644
index 000000000..af588405f
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/maven-metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+  <groupId>org.apache.maven.its.mng7529</groupId>
+  <artifactId>a</artifactId>
+  <version>1.0</version>
+  <versioning>
+    <release>1.1</release>
+    <versions>
+      <version>1.0</version>
+      <version>1.1</version>
+    </versions>
+    <lastUpdated>20220820180700</lastUpdated>
+  </versioning>
+</metadata>
diff --git a/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/maven-metadata.xml.sha1 b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/maven-metadata.xml.sha1
new file mode 100644
index 000000000..e45bef318
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7529/repo/org/apache/maven/its/mng7529/a/maven-metadata.xml.sha1
@@ -0,0 +1 @@
+1879cdd62495339b931a092a7e899b2dce39b826
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-7529/settings-template.xml b/core-it-suite/src/test/resources/mng-7529/settings-template.xml
new file mode 100644
index 000000000..2201ee377
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-7529/settings-template.xml
@@ -0,0 +1,61 @@
+<?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.
+-->
+
+<settings>
+<!--  <mirrors>-->
+<!--    <mirror>-->
+<!--      <id>maven-core-it</id>-->
+<!--      <url>@baseurl@/repo</url>-->
+<!--      <mirrorOf>central</mirrorOf>-->
+<!--    </mirror>-->
+<!--  </mirrors>-->
+
+  <profiles>
+    <profile>
+      <id>maven-core-it-repo</id>
+      <repositories>
+        <repository>
+          <id>maven-core-it-snapshots</id>
+          <url>@baseurl@/repo</url>
+          <releases>
+            <enabled>false</enabled>
+          </releases>
+          <snapshots>
+            <checksumPolicy>ignore</checksumPolicy>
+          </snapshots>
+        </repository>
+        <repository>
+          <id>maven-core-it</id>
+          <url>@baseurl@/repo</url>
+          <releases>
+            <checksumPolicy>ignore</checksumPolicy>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+    </profile>
+  </profiles>
+  <activeProfiles>
+    <activeProfile>maven-core-it-repo</activeProfile>
+  </activeProfiles>
+</settings>
diff --git a/core-it-support/core-it-plugins/mng7529-plugin/pom.xml b/core-it-support/core-it-plugins/mng7529-plugin/pom.xml
new file mode 100644
index 000000000..a9a8a80cd
--- /dev/null
+++ b/core-it-support/core-it-plugins/mng7529-plugin/pom.xml
@@ -0,0 +1,66 @@
+<?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-7529-version-range-repository-selection-plugin</artifactId>
+  <packaging>maven-plugin</packaging>
+
+  <properties>
+    <maven-version>3.6.0</maven-version>
+  </properties>
+
+  <name>Maven IT Plugin :: mng-7529 plugin</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>${maven-version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.plugin-tools</groupId>
+      <artifactId>maven-plugin-annotations</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.maven</groupId>
+        <artifactId>maven-core</artifactId>
+        <version>${maven-version}</version>
+        <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-model</artifactId>
+      <version>${maven-version}</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/core-it-support/core-it-plugins/mng7529-plugin/src/main/java/org/apache/maven/its/mng7529/plugin/ResolveMojo.java b/core-it-support/core-it-plugins/mng7529-plugin/src/main/java/org/apache/maven/its/mng7529/plugin/ResolveMojo.java
new file mode 100644
index 000000000..5582f112e
--- /dev/null
+++ b/core-it-support/core-it-plugins/mng7529-plugin/src/main/java/org/apache/maven/its/mng7529/plugin/ResolveMojo.java
@@ -0,0 +1,77 @@
+package org.apache.maven.its.mng7529.plugin;
+
+/*
+ * 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.execution.MavenSession;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.apache.maven.project.DefaultDependencyResolutionRequest;
+import org.apache.maven.project.DefaultProjectBuildingRequest;
+import org.apache.maven.project.DependencyResolutionRequest;
+import org.apache.maven.project.DependencyResolutionResult;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectDependenciesResolver;
+
+/**
+ * Attempts to resolve a single artifact from dependencies with the project dependency resolver,
+ * and logs the results for the Verifier to look at.
+ */
+@Mojo( name = "resolve", requiresDependencyResolution = ResolutionScope.NONE )
+public class ResolveMojo
+    extends AbstractMojo
+{
+    @Parameter( defaultValue = "${project}", readonly = true, required = true )
+    private MavenProject project;
+
+    @Parameter( defaultValue = "${session}", readonly = true, required = true )
+    private MavenSession mavenSession;
+
+    @Component
+    private ProjectDependenciesResolver dependencyResolver;
+
+    public void execute()
+        throws MojoExecutionException
+    {
+
+        try
+        {
+            DefaultProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest(
+                mavenSession.getProjectBuildingRequest() );
+            buildingRequest.setRemoteRepositories( project.getRemoteArtifactRepositories() );
+
+            DependencyResolutionRequest request = new DefaultDependencyResolutionRequest();
+            request.setMavenProject( project );
+            request.setRepositorySession( buildingRequest.getRepositorySession() );
+
+            DependencyResolutionResult result = dependencyResolver.resolve( request );
+
+            getLog().info( "Resolution successful, resolved ok" );
+        }
+        catch ( Exception e )
+        {
+            getLog().error( "Resolution failed, could not resolve ranged dependency"
+                + " (you hit MNG-7529)" );
+        }
+    }
+}
diff --git a/core-it-support/core-it-plugins/pom.xml b/core-it-support/core-it-plugins/pom.xml
index 95932b95e..ed0e815a5 100644
--- a/core-it-support/core-it-plugins/pom.xml
+++ b/core-it-support/core-it-plugins/pom.xml
@@ -84,6 +84,7 @@ under the License.
     <module>mng5805-plugin-dep</module>
     <module>mng5958-extension</module>
     <module>mng6759-plugin-resolves-project-dependencies</module>
+    <module>mng7529-plugin</module>
   </modules>
 
   <distributionManagement>