You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2023/11/30 20:54:57 UTC

(maven-javadoc-plugin) branch MJAVADOC-682 updated (05516adb -> b69af902)

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

michaelo pushed a change to branch MJAVADOC-682
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git


 discard 05516adb [MJAVADOC-682] Reactor builds fail when multiple modules with same groupId:artifactId, but different versions
     new b69af902 [MJAVADOC-682] Reactor builds fail when multiple modules with same groupId:artifactId, but different versions

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (05516adb)
            \
             N -- N -- N   refs/heads/MJAVADOC-682 (b69af902)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/it/projects/MJAVADOC-682/module-1/src/main/java/module-info.java | 2 --
 src/it/projects/MJAVADOC-682/module-2/src/main/java/module-info.java | 2 --
 2 files changed, 4 deletions(-)


(maven-javadoc-plugin) 01/01: [MJAVADOC-682] Reactor builds fail when multiple modules with same groupId:artifactId, but different versions

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MJAVADOC-682
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git

commit b69af90253f769a2669754aa978eded271bf690e
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sun Nov 26 22:47:19 2023 +0100

    [MJAVADOC-682] Reactor builds fail when multiple modules with same groupId:artifactId, but different versions
    
    Co-authored-by: AO Industries, Inc <su...@aoindustries.com>
    
    This closes #253
---
 .../projects/MJAVADOC-567_aggr-mixed/verify.groovy |  2 +-
 src/it/projects/MJAVADOC-682/invoker.properties    | 19 ++++++
 src/it/projects/MJAVADOC-682/module-1/pom.xml      | 36 ++++++++++
 .../module-1/src/main/java/com/foo/Bar.java}       | 25 +++----
 .../module-1/src/main/java/module-info.java}       | 16 +----
 src/it/projects/MJAVADOC-682/module-2/pom.xml      | 36 ++++++++++
 .../module-2/src/main/java/com/foo/Bar.java}       | 25 +++----
 .../module-2/src/main/java/module-info.java}       | 16 +----
 src/it/projects/MJAVADOC-682/pom.xml               | 78 ++++++++++++++++++++++
 .../maven/plugins/javadoc/AbstractJavadocMojo.java | 19 +++---
 .../maven/plugins/javadoc/JavadocModule.java       | 14 ++--
 .../plugins/javadoc/resolver/ResourceResolver.java | 16 ++---
 12 files changed, 225 insertions(+), 77 deletions(-)

diff --git a/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy b/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
index d1e34c5c..3fcfe7f5 100644
--- a/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
+++ b/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
@@ -22,7 +22,7 @@ def buildLog = new File(basedir,'build.log')
 def expectedLines = ['Creating an aggregated report for both named and unnamed modules is not possible.',
                      'Ensure that every module has a module descriptor or is a jar with a MANIFEST.MF containing an Automatic-Module-Name.',
                      'Fix the following projects:',
-                     ' - testcase:module2']
+                     ' - testcase:module2:1.0-SNAPSHOT']
 
 def errorLines = buildLog.readLines() 
                          .dropWhile{ !it.startsWith('[ERROR] Creating') }
diff --git a/src/it/projects/MJAVADOC-682/invoker.properties b/src/it/projects/MJAVADOC-682/invoker.properties
new file mode 100644
index 00000000..fca4651c
--- /dev/null
+++ b/src/it/projects/MJAVADOC-682/invoker.properties
@@ -0,0 +1,19 @@
+# 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.
+
+invoker.goals = package
+invoker.java.version = 9+
diff --git a/src/it/projects/MJAVADOC-682/module-1/pom.xml b/src/it/projects/MJAVADOC-682/module-1/pom.xml
new file mode 100644
index 00000000..cb301188
--- /dev/null
+++ b/src/it/projects/MJAVADOC-682/module-1/pom.xml
@@ -0,0 +1,36 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+    <artifactId>mjavadoc682</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>multiple-projects-same-module-name</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <name>Module Version 1.x</name>
+</project>
diff --git a/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy b/src/it/projects/MJAVADOC-682/module-1/src/main/java/com/foo/Bar.java
similarity index 53%
copy from src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
copy to src/it/projects/MJAVADOC-682/module-1/src/main/java/com/foo/Bar.java
index d1e34c5c..34fd9ffa 100644
--- a/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
+++ b/src/it/projects/MJAVADOC-682/module-1/src/main/java/com/foo/Bar.java
@@ -1,3 +1,5 @@
+package com.foo;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,17 +18,16 @@
  * specific language governing permissions and limitations
  * under the License.
  */
- 
-def buildLog = new File(basedir,'build.log')
 
-def expectedLines = ['Creating an aggregated report for both named and unnamed modules is not possible.',
-                     'Ensure that every module has a module descriptor or is a jar with a MANIFEST.MF containing an Automatic-Module-Name.',
-                     'Fix the following projects:',
-                     ' - testcase:module2']
+/**
+ * Bar 1.x.
+ */
+public class Bar
+{
+
+    public void run()
+    {
+        System.out.println( "Bar 1.x" );
+    }
 
-def errorLines = buildLog.readLines() 
-                         .dropWhile{ !it.startsWith('[ERROR] Creating') }
-                         .takeWhile{ it.startsWith('[ERROR]') }
-                         .collect  { it - '[ERROR] '}
-                         
-assert expectedLines == errorLines                   
+}
diff --git a/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy b/src/it/projects/MJAVADOC-682/module-1/src/main/java/module-info.java
similarity index 53%
copy from src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
copy to src/it/projects/MJAVADOC-682/module-1/src/main/java/module-info.java
index d1e34c5c..87ac6c86 100644
--- a/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
+++ b/src/it/projects/MJAVADOC-682/module-1/src/main/java/module-info.java
@@ -16,17 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
- 
-def buildLog = new File(basedir,'build.log')
 
-def expectedLines = ['Creating an aggregated report for both named and unnamed modules is not possible.',
-                     'Ensure that every module has a module descriptor or is a jar with a MANIFEST.MF containing an Automatic-Module-Name.',
-                     'Fix the following projects:',
-                     ' - testcase:module2']
-
-def errorLines = buildLog.readLines() 
-                         .dropWhile{ !it.startsWith('[ERROR] Creating') }
-                         .takeWhile{ it.startsWith('[ERROR]') }
-                         .collect  { it - '[ERROR] '}
-                         
-assert expectedLines == errorLines                   
+module com.foo {
+  exports com.foo;
+}
diff --git a/src/it/projects/MJAVADOC-682/module-2/pom.xml b/src/it/projects/MJAVADOC-682/module-2/pom.xml
new file mode 100644
index 00000000..afb2c594
--- /dev/null
+++ b/src/it/projects/MJAVADOC-682/module-2/pom.xml
@@ -0,0 +1,36 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+    <artifactId>mjavadoc682</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>multiple-projects-same-module-name</artifactId>
+  <version>2.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <name>Module Version 2.x</name>
+</project>
diff --git a/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy b/src/it/projects/MJAVADOC-682/module-2/src/main/java/com/foo/Bar.java
similarity index 53%
copy from src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
copy to src/it/projects/MJAVADOC-682/module-2/src/main/java/com/foo/Bar.java
index d1e34c5c..3b39bee8 100644
--- a/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
+++ b/src/it/projects/MJAVADOC-682/module-2/src/main/java/com/foo/Bar.java
@@ -1,3 +1,5 @@
+package com.foo;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,17 +18,16 @@
  * specific language governing permissions and limitations
  * under the License.
  */
- 
-def buildLog = new File(basedir,'build.log')
 
-def expectedLines = ['Creating an aggregated report for both named and unnamed modules is not possible.',
-                     'Ensure that every module has a module descriptor or is a jar with a MANIFEST.MF containing an Automatic-Module-Name.',
-                     'Fix the following projects:',
-                     ' - testcase:module2']
+/**
+ * Bar 2.x.
+ */
+public class Bar
+{
+
+    public void run()
+    {
+        System.out.println( "Bar 2.x" );
+    }
 
-def errorLines = buildLog.readLines() 
-                         .dropWhile{ !it.startsWith('[ERROR] Creating') }
-                         .takeWhile{ it.startsWith('[ERROR]') }
-                         .collect  { it - '[ERROR] '}
-                         
-assert expectedLines == errorLines                   
+}
diff --git a/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy b/src/it/projects/MJAVADOC-682/module-2/src/main/java/module-info.java
similarity index 53%
copy from src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
copy to src/it/projects/MJAVADOC-682/module-2/src/main/java/module-info.java
index d1e34c5c..87ac6c86 100644
--- a/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
+++ b/src/it/projects/MJAVADOC-682/module-2/src/main/java/module-info.java
@@ -16,17 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
- 
-def buildLog = new File(basedir,'build.log')
 
-def expectedLines = ['Creating an aggregated report for both named and unnamed modules is not possible.',
-                     'Ensure that every module has a module descriptor or is a jar with a MANIFEST.MF containing an Automatic-Module-Name.',
-                     'Fix the following projects:',
-                     ' - testcase:module2']
-
-def errorLines = buildLog.readLines() 
-                         .dropWhile{ !it.startsWith('[ERROR] Creating') }
-                         .takeWhile{ it.startsWith('[ERROR]') }
-                         .collect  { it - '[ERROR] '}
-                         
-assert expectedLines == errorLines                   
+module com.foo {
+  exports com.foo;
+}
diff --git a/src/it/projects/MJAVADOC-682/pom.xml b/src/it/projects/MJAVADOC-682/pom.xml
new file mode 100644
index 00000000..2bc5eb52
--- /dev/null
+++ b/src/it/projects/MJAVADOC-682/pom.xml
@@ -0,0 +1,78 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+  <artifactId>mjavadoc682</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-682</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>@compilerPluginVersion@</version>
+          <configuration>
+            <release>9</release>
+          </configuration>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <release>9</release>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-javadocs</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <modules>
+    <module>module-1</module>
+    <module>module-2</module>
+  </modules>
+</project>
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
index a07a0bcb..10127379 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -2192,7 +2192,7 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
 
             if (!sourcePaths.isEmpty()) {
                 mappedSourcePaths.add(new JavadocModule(
-                        ArtifactUtils.versionlessKey(project.getGroupId(), project.getArtifactId()),
+                        ArtifactUtils.key(project.getGroupId(), project.getArtifactId(), project.getVersion()),
                         getClassesFile(project),
                         sourcePaths));
             }
@@ -2206,12 +2206,12 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
         ResolvePathResult resolvePathResult = getResolvePathResult(classessFile);
         if (resolvePathResult == null) {
             return new JavadocModule(
-                    ArtifactUtils.versionlessKey(project.getGroupId(), project.getArtifactId()),
+                    ArtifactUtils.key(project.getGroupId(), project.getArtifactId(), project.getVersion()),
                     classessFile,
                     sourcePaths);
         } else {
             return new JavadocModule(
-                    ArtifactUtils.versionlessKey(project.getGroupId(), project.getArtifactId()),
+                    ArtifactUtils.key(project.getGroupId(), project.getArtifactId(), project.getVersion()),
                     classessFile,
                     sourcePaths,
                     resolvePathResult.getModuleDescriptor(),
@@ -4398,7 +4398,8 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
         Map<String, MavenProject> reactorKeys = new HashMap<>(aggregatedProjects.size());
         for (MavenProject reactorProject : aggregatedProjects) {
             reactorKeys.put(
-                    ArtifactUtils.versionlessKey(reactorProject.getGroupId(), reactorProject.getArtifactId()),
+                    ArtifactUtils.key(
+                            reactorProject.getGroupId(), reactorProject.getArtifactId(), reactorProject.getVersion()),
                     reactorProject);
         }
 
@@ -4424,7 +4425,7 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
                     if (moduleDescriptor != null) {
                         try {
                             allModuleDescriptors.put(
-                                    entry.getGa(),
+                                    entry.getGav(),
                                     locationManager
                                             .parseModuleDescriptor(moduleDescriptor)
                                             .getModuleDescriptor());
@@ -4433,7 +4434,7 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
                         }
                     }
                 } else {
-                    allModuleDescriptors.put(entry.getGa(), entry.getModuleDescriptor());
+                    allModuleDescriptors.put(entry.getGav(), entry.getModuleDescriptor());
                 }
             }
         }
@@ -4448,7 +4449,7 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
         if (supportModulePath && !allModuleDescriptors.isEmpty()) {
             Collection<String> unnamedProjects = new ArrayList<>();
             for (JavadocModule javadocModule : allSourcePaths) {
-                MavenProject aggregatedProject = reactorKeys.get(javadocModule.getGa());
+                MavenProject aggregatedProject = reactorKeys.get(javadocModule.getGav());
                 if (aggregatedProject != null && !"pom".equals(aggregatedProject.getPackaging())) {
                     ResolvePathResult result = null;
 
@@ -4497,7 +4498,7 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
                             throw new MavenReportException(e.getMessage(), e);
                         }
                     } else {
-                        unnamedProjects.add(javadocModule.getGa());
+                        unnamedProjects.add(javadocModule.getGav());
                     }
 
                     if (aggregatedProject.equals(getProject())) {
@@ -4505,7 +4506,7 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
                     }
                 } else {
                     // todo
-                    getLog().error("no reactor project: " + javadocModule.getGa());
+                    getLog().error("no reactor project: " + javadocModule.getGav());
                 }
             }
 
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocModule.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocModule.java
index 8c477941..144a0f43 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocModule.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocModule.java
@@ -31,7 +31,7 @@ import org.codehaus.plexus.languages.java.jpms.ModuleNameSource;
  * @since 3.3.0
  */
 public class JavadocModule {
-    private final String ga;
+    private final String gav;
 
     private final File artifactFile;
 
@@ -41,25 +41,25 @@ public class JavadocModule {
 
     private final ModuleNameSource moduleNameSource;
 
-    public JavadocModule(String ga, File artifactFile, Collection<Path> sourcePaths) {
-        this(ga, artifactFile, sourcePaths, null, null);
+    public JavadocModule(String gav, File artifactFile, Collection<Path> sourcePaths) {
+        this(gav, artifactFile, sourcePaths, null, null);
     }
 
     public JavadocModule(
-            String ga,
+            String gav,
             File artifactFile,
             Collection<Path> sourcePaths,
             JavaModuleDescriptor moduleDescriptor,
             ModuleNameSource moduleNameSource) {
-        this.ga = ga;
+        this.gav = gav;
         this.artifactFile = artifactFile;
         this.sourcePaths = sourcePaths;
         this.moduleDescriptor = moduleDescriptor;
         this.moduleNameSource = moduleNameSource;
     }
 
-    public String getGa() {
-        return ga;
+    public String getGav() {
+        return gav;
     }
 
     public Collection<Path> getSourcePaths() {
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/resolver/ResourceResolver.java b/src/main/java/org/apache/maven/plugins/javadoc/resolver/ResourceResolver.java
index ffbd0b46..53cf3b28 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/resolver/ResourceResolver.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/resolver/ResourceResolver.java
@@ -38,6 +38,7 @@ import java.util.Set;
 
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.plugins.javadoc.AbstractJavadocMojo;
@@ -102,7 +103,7 @@ public final class ResourceResolver extends AbstractLogEnabled {
         final Map<String, MavenProject> projectMap = new HashMap<>();
         if (config.reactorProjects() != null) {
             for (final MavenProject p : config.reactorProjects()) {
-                projectMap.put(key(p.getGroupId(), p.getArtifactId()), p);
+                projectMap.put(ArtifactUtils.key(p.getGroupId(), p.getArtifactId(), p.getVersion()), p);
             }
         }
 
@@ -110,8 +111,7 @@ public final class ResourceResolver extends AbstractLogEnabled {
 
         final List<Artifact> forResourceResolution = new ArrayList<>(artifacts.size());
         for (final Artifact artifact : artifacts) {
-            final String key = key(artifact.getGroupId(), artifact.getArtifactId());
-            final MavenProject p = projectMap.get(key);
+            final MavenProject p = projectMap.get(ArtifactUtils.key(artifact));
             if (p != null) {
                 bundles.addAll(resolveBundleFromProject(config, p, artifact));
             } else {
@@ -137,14 +137,14 @@ public final class ResourceResolver extends AbstractLogEnabled {
         final Map<String, MavenProject> projectMap = new HashMap<>();
         if (config.reactorProjects() != null) {
             for (final MavenProject p : config.reactorProjects()) {
-                projectMap.put(key(p.getGroupId(), p.getArtifactId()), p);
+                projectMap.put(ArtifactUtils.key(p.getGroupId(), p.getArtifactId(), p.getVersion()), p);
             }
         }
 
         final List<Artifact> artifacts = config.project().getTestArtifacts();
 
         for (final Artifact artifact : artifacts) {
-            final String key = key(artifact.getGroupId(), artifact.getArtifactId());
+            final String key = ArtifactUtils.key(artifact);
             final MavenProject p = projectMap.get(key);
             if (p != null) {
                 mappedDirs.add(new JavadocModule(key, artifact.getFile(), resolveFromProject(config, p, artifact)));
@@ -269,7 +269,7 @@ public final class ResourceResolver extends AbstractLogEnabled {
 
         Collection<Path> sourcePaths = resolveAndUnpack(toResolve, config, SOURCE_VALID_CLASSIFIERS, true);
 
-        return new JavadocModule(key(artifact.getGroupId(), artifact.getArtifactId()), artifact.getFile(), sourcePaths);
+        return new JavadocModule(ArtifactUtils.key(artifact), artifact.getFile(), sourcePaths);
     }
 
     private org.eclipse.aether.artifact.Artifact createResourceArtifact(
@@ -377,8 +377,4 @@ public final class ResourceResolver extends AbstractLogEnabled {
 
         return JavadocUtil.pruneDirs(reactorProject, dirs);
     }
-
-    private static String key(final String gid, final String aid) {
-        return gid + ":" + aid;
-    }
 }