[maven-javadoc-plugin] branch MJAVADOC-568 created (now 0c0b08b)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[maven-javadoc-plugin] branch MJAVADOC-568 created (now 0c0b08b)

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

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


      at 0c0b08b  [MJAVADOC-568] javadoc:jar fails when project has Automatic-Module-Name and (implicit) uses offlinelinks with element-list

This branch includes the following new commits:

     new 0c0b08b  [MJAVADOC-568] javadoc:jar fails when project has Automatic-Module-Name and (implicit) uses offlinelinks with element-list

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.


Reply | Threaded
Open this post in threaded view
|

[maven-javadoc-plugin] 01/01: [MJAVADOC-568] javadoc:jar fails when project has Automatic-Module-Name and (implicit) uses offlinelinks with element-list

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

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

commit 0c0b08b5aac29c635f2a860ebaedb59fccffed7b
Author: rfscholte <[hidden email]>
AuthorDate: Thu Feb 7 23:40:16 2019 +0100

    [MJAVADOC-568] javadoc:jar fails when project has Automatic-Module-Name and (implicit) uses offlinelinks with element-list
---
 pom.xml                                            |   2 +-
 .../invoker.properties                             |  19 ++
 .../module1/pom.xml                                |  33 +++
 .../module1/src/main/java/module-info.java         |  23 ++
 .../module1/src/main/java/module1/Module1.java     |  28 +++
 .../module2/pom.xml                                |  91 ++++++++
 .../module2/src/main/java/module2/Module2.java     |  30 +++
 .../MJAVADOC-568_export-to-testcase/pom.xml        |  78 +++++++
 .../maven/plugins/javadoc/AbstractJavadocMojo.java | 232 +++++++++++----------
 .../plugins/javadoc/resolver/ResourceResolver.java |  15 +-
 .../aggregate-resources-test-plugin-config.xml     |   1 +
 .../aggregate-test-plugin-config.xml               |   1 +
 .../custom-configuration-plugin-config.xml         |   3 +
 .../default-configuration-plugin-config.xml        |   3 +
 .../docfiles-test/docfiles-test-plugin-config.xml  |   3 +
 .../docfiles-with-java-test-plugin-config.xml      |   3 +
 .../doclet-path-test-plugin-config.xml             |   3 +
 .../unit/doclet-test/doclet-test-plugin-config.xml |   3 +
 .../file-include-exclude-plugin-config.xml         |   3 +
 .../header-footer-test-plugin-config.xml           |   3 +
 src/test/resources/unit/helpfile-test/pom.xml      |   3 +
 .../javaHome-test/javaHome-test-plugin-config.xml  |   3 +
 .../javadocjar-archive-config.xml                  |   3 +
 .../javadocjar-default-plugin-config.xml           |   3 +
 .../javadocjar-failonerror-plugin-config.xml       |   3 +
 .../javadocjar-invalid-destdir-plugin-config.xml   |   3 +
 .../unit/jdk5-test/jdk5-test-plugin-config.xml     |   3 +
 .../unit/jdk6-test/jdk6-test-plugin-config.xml     |   3 +
 .../newline-test/newline-test-plugin-config.xml    |   3 +
 .../optionsumlautencoding-test-plugin-config.xml   |   3 +
 .../unit/proxy-test/proxy-test-plugin-config.xml   |   3 +
 .../quotedpath-test-plugin-config.xml              |   3 +
 .../resources-test-plugin-config.xml               |   3 +
 .../resources-with-excludes-test-plugin-config.xml |   3 +
 .../resources/unit/stylesheetfile-test/pom.xml     |   3 +
 .../subpackages-test-plugin-config.xml             |   3 +
 .../unit/tag-test/tag-test-plugin-config.xml       |   3 +
 .../unit/taglet-test/taglet-test-plugin-config.xml |   3 +
 .../tagletArtifacts-test-plugin-config.xml         |   3 +
 .../test-javadoc-test-plugin-config.xml            |   3 +
 ...rong-locale-with-variant-test-plugin-config.xml |   3 +
 41 files changed, 516 insertions(+), 124 deletions(-)

diff --git a/pom.xml b/pom.xml
index 87275ed..334107f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -240,7 +240,7 @@ under the License.
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-java</artifactId>
-      <version>1.0.2</version>
+      <version>1.0.3</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
diff --git a/src/it/projects/MJAVADOC-568_export-to-testcase/invoker.properties b/src/it/projects/MJAVADOC-568_export-to-testcase/invoker.properties
new file mode 100644
index 0000000..72b9484
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_export-to-testcase/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.java.version = 9+
+invoker.goals= package javadoc:jar javadoc:aggregate
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-568_export-to-testcase/module1/pom.xml b/src/it/projects/MJAVADOC-568_export-to-testcase/module1/pom.xml
new file mode 100644
index 0000000..44b98b0
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_export-to-testcase/module1/pom.xml
@@ -0,0 +1,33 @@
+<?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>
+ <groupId>testcase</groupId>
+ <artifactId>root</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>mjavadoc569.module1</artifactId>
+
+</project>
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-568_export-to-testcase/module1/src/main/java/module-info.java b/src/it/projects/MJAVADOC-568_export-to-testcase/module1/src/main/java/module-info.java
new file mode 100644
index 0000000..5bfee2c
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_export-to-testcase/module1/src/main/java/module-info.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+module mjavadoc569.module1
+{
+ exports module1 to mjavadoc569.module2;
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-568_export-to-testcase/module1/src/main/java/module1/Module1.java b/src/it/projects/MJAVADOC-568_export-to-testcase/module1/src/main/java/module1/Module1.java
new file mode 100644
index 0000000..daeae13
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_export-to-testcase/module1/src/main/java/module1/Module1.java
@@ -0,0 +1,28 @@
+package module1;
+
+/*
+ * 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.
+ */
+
+public final class Module1
+{
+ public String getName()
+ {
+ return null;
+ }
+}
diff --git a/src/it/projects/MJAVADOC-568_export-to-testcase/module2/pom.xml b/src/it/projects/MJAVADOC-568_export-to-testcase/module2/pom.xml
new file mode 100644
index 0000000..124211b
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_export-to-testcase/module2/pom.xml
@@ -0,0 +1,91 @@
+<?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>
+ <groupId>testcase</groupId>
+ <artifactId>root</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>mjavadoc569.module2</artifactId>
+<!-- <packaging>maven-plugin</packaging> -->
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Automatic-Module-Name>mjavadoc569.module2</Automatic-Module-Name>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>3.6.0</version>
+ <executions>
+ <execution>
+ <id>default-descriptor</id>
+ <phase>process-classes</phase>
+ </execution>
+<!-- <execution> -->
+<!-- <id>help-descriptor</id> -->
+<!-- <goals> -->
+<!-- <goal>helpmojo</goal> -->
+<!-- </goals> -->
+<!-- </execution> -->
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-jar</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <show>public</show>
+ <doctitle>My custom title</doctitle>
+ <windowtitle>My custom title</windowtitle>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>mjavadoc569.module1</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-568_export-to-testcase/module2/src/main/java/module2/Module2.java b/src/it/projects/MJAVADOC-568_export-to-testcase/module2/src/main/java/module2/Module2.java
new file mode 100644
index 0000000..b541b42
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_export-to-testcase/module2/src/main/java/module2/Module2.java
@@ -0,0 +1,30 @@
+package module2;
+
+/*
+ * 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 module1.Module1;
+
+public final class Module2
+{
+ public Module1 createModule1()
+ {
+ return null;
+ }
+}
diff --git a/src/it/projects/MJAVADOC-568_export-to-testcase/pom.xml b/src/it/projects/MJAVADOC-568_export-to-testcase/pom.xml
new file mode 100644
index 0000000..5c7b67e
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_export-to-testcase/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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>testcase</groupId>
+  <artifactId>root</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-569</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>3.8.0</version>
+          <configuration>
+            <release>9</release>
+          </configuration>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <show>public</show>
+          <doctitle>My custom title</doctitle>
+          <windowtitle>My custom title</windowtitle>
+
+          <debug>true</debug>
+          <additionalOptions>
+            <option>--add-modules</option>
+            <option>java.xml</option>
+          </additionalOptions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <modules>
+    <module>module1</module>
+    <module>module2</module>
+  </modules>
+
+</project>
\ No newline at end of file
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 a98a48c..f77a541 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -115,7 +115,6 @@ import java.net.URLClassLoader;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.Paths;
 import java.nio.file.StandardCopyOption;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -1789,7 +1788,11 @@ public abstract class AbstractJavadocMojo
     
     protected File getArtifactFile( MavenProject project )
     {
-        if ( project.getArtifact() != null )
+        if ( !isAggregator() && isTest() )
+        {
+            return null;
+        }
+        else if ( project.getArtifact() != null )
         {
             return project.getArtifact().getFile();
         }
@@ -2274,8 +2277,12 @@ public abstract class AbstractJavadocMojo
                         sourcePaths.addAll( l );
                     }
                 }
-                mappedSourcePaths.put( ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() ),
-                                       sourcePaths );              
+                if ( !sourcePaths.isEmpty() )
+                {
+                    mappedSourcePaths.put( ArtifactUtils.versionlessKey( project.getGroupId(),
+                                                                         project.getArtifactId() ),
+                                           sourcePaths );
+                }
             }
             
             if ( includeDependencySources )
@@ -4418,7 +4425,7 @@ public abstract class AbstractJavadocMojo
             if ( mainDescriptor != null && !isTest() )
             {
                 ResolvePathsRequest<File> request =
-                        ResolvePathsRequest.withFiles( Collections.<File>emptyList() ).
+                        ResolvePathsRequest.ofFiles( Collections.<File>emptyList() ).
                                 setMainModuleDescriptor( mainDescriptor );
     
                 try
@@ -4880,27 +4887,59 @@ public abstract class AbstractJavadocMojo
             addArgIf( arguments, breakiterator, "-breakiterator", SINCE_JAVADOC_1_5 );
         }
         
-        Map<String, MavenProject> reactorKeys = new HashMap<>( session.getProjects().size() );
-        for ( MavenProject reactorProject : session.getProjects() )
+        Map<String, MavenProject> reactorKeys = new HashMap<>( reactorProjects.size() );
+        for ( MavenProject reactorProject : reactorProjects )
         {
             reactorKeys.put( ArtifactUtils.versionlessKey( reactorProject.getGroupId(),
                                                            reactorProject.getArtifactId() ), reactorProject );
         }
         
-        Collection<String> additionalModules = new ArrayList<>();
+        Map<String, JavaModuleDescriptor> allModuleDescriptors = new HashMap<>();
         
-        boolean containsModuleDescriptor = false;
-        for ( Collection<Path> sourcepaths : allSourcePaths.values() )
+        for ( Map.Entry<String, Collection<Path>> entry : allSourcePaths.entrySet() )
         {
-            if ( findMainDescriptor( sourcepaths ) != null )
+            MavenProject entryProject = reactorKeys.get( entry.getKey() );
+            
+            File artifactFile;
+            if ( entryProject != null )
             {
-                containsModuleDescriptor = true;
-                break;
+                artifactFile = getArtifactFile( entryProject );
+            }
+            else
+            {
+                artifactFile = project.getArtifactMap().get( entry.getKey() ).getFile();
+            }
+            ResolvePathResult resolvePathResult = getResolvePathResult( artifactFile );
+            
+            if ( resolvePathResult == null || resolvePathResult.getModuleNameSource() == ModuleNameSource.FILENAME )
+            {
+                File moduleDescriptor = findMainDescriptor( entry.getValue() );
+                
+                if ( moduleDescriptor != null )
+                {
+                    try
+                    {
+                        allModuleDescriptors.put( entry.getKey(),
+                                  locationManager.parseModuleDescriptor( moduleDescriptor ).getModuleDescriptor() );
+                    }
+                    catch ( IOException e )
+                    {
+                        throw new MavenReportException( e.getMessage(), e );
+                    }
+                }
+            }
+            else
+            {
+                allModuleDescriptors.put( entry.getKey(), resolvePathResult.getModuleDescriptor() );
             }
         }
+
+        Collection<String> additionalModules = new ArrayList<>();
+
+        ResolvePathResult mainResolvePathResult = null;
         
         Path moduleSourceDir = null;
-        if ( containsModuleDescriptor && allSourcePaths.size() > 1 )
+        if ( javadocRuntimeVersion.isAtLeast( "9" ) && !allModuleDescriptors.isEmpty() )
         {
             Collection<String> unnamedProjects = new ArrayList<>();
             for ( Map.Entry<String, Collection<Path>> projectSourcepaths : allSourcePaths.entrySet() )
@@ -4908,7 +4947,7 @@ public abstract class AbstractJavadocMojo
                 MavenProject aggregatedProject = reactorKeys.get( projectSourcepaths.getKey() );
                 if ( aggregatedProject != null )
                 {
-                    String moduleName = null;
+                    ResolvePathResult result = null;
                     
                     // Prefer jar over outputDirectory, since it may may contain an automatic module name
                     File artifactFile = getArtifactFile( aggregatedProject );
@@ -4917,7 +4956,7 @@ public abstract class AbstractJavadocMojo
                         ResolvePathRequest<File> request = ResolvePathRequest.ofFile( artifactFile );
                         try
                         {
-                            moduleName = locationManager.resolvePath( request ).getModuleDescriptor().name();
+                            result = locationManager.resolvePath( request );
                         }
                         catch ( RuntimeException e )
                         {
@@ -4938,14 +4977,9 @@ public abstract class AbstractJavadocMojo
                         
                         if ( moduleDescriptor != null )
                         {
-                            ResolvePathsRequest<File> request =
-                                            ResolvePathsRequest.ofFiles( Collections.<File>emptyList() )
-                                                               .setMainModuleDescriptor( moduleDescriptor );
-
                             try
                             {
-                                moduleName =
-                                    locationManager.resolvePaths( request ).getMainModuleDescriptor().name();
+                                result = locationManager.parseModuleDescriptor( moduleDescriptor );
                             }
                             catch ( IOException e )
                             {
@@ -4954,20 +4988,20 @@ public abstract class AbstractJavadocMojo
                         }
                     }
 
-                    if ( moduleName != null )
+                    if ( result != null && result.getModuleDescriptor() != null )
                     {
                         moduleSourceDir = javadocOutputDirectory.toPath().resolve( "src" );
                         try
                         {
                             moduleSourceDir = Files.createDirectories( moduleSourceDir );
-                            
-                            additionalModules.add( moduleName );
-                            
-                            addArgIfNotEmpty( arguments, "--patch-module", moduleName + '='
+
+                            additionalModules.add( result.getModuleDescriptor().name() );
+
+                            addArgIfNotEmpty( arguments, "--patch-module", result.getModuleDescriptor().name() + '='
                                  + JavadocUtil.quotedPathArgument( getSourcePath( projectSourcepaths.getValue() ) ),
                                    false, false );
                             
-                            Path modulePath = moduleSourceDir.resolve( moduleName );
+                            Path modulePath = moduleSourceDir.resolve( result.getModuleDescriptor().name() );
                             if ( !Files.isDirectory( modulePath ) )
                             {
                                 Files.createDirectory( modulePath );
@@ -4978,10 +5012,15 @@ public abstract class AbstractJavadocMojo
                             throw new MavenReportException( e.getMessage(), e );
                         }
                     }
-                    else
+                    else
                     {
                         unnamedProjects.add( projectSourcepaths.getKey() );
                     }
+                    
+                    if ( aggregatedProject.equals( getProject() ) )
+                    {
+                        mainResolvePathResult = result;
+                    }
                 }
                 else
                 {
@@ -5002,97 +5041,47 @@ public abstract class AbstractJavadocMojo
                 }
                 throw new MavenReportException( "Aggregator report contains named and unnamed modules" );
             }
+            
+            if ( mainResolvePathResult != null
+                && ModuleNameSource.MANIFEST.equals( mainResolvePathResult.getModuleNameSource() ) )
+            {
+                arguments.add( "--add-modules" );
+                arguments.add( "ALL-MODULE-PATH" );
+            }
         }
-
-
-        ResolvePathResult resolvePathResult = getResolvePathResult( getArtifactFile( getProject() ) );
-
-        // MJAVADOC-506
-        File moduleDescriptorSource = null;
-        if ( resolvePathResult == null || resolvePathResult.getModuleNameSource() == ModuleNameSource.FILENAME )
+        
+        // MJAVADOC-506
+        boolean moduleDescriptorSource = false;
+        for ( Path sourcepath : sourcePaths )
         {
-            Collection<Path> roots = new ArrayList<>();
-            for ( String path : getProjectSourceRoots( getProject() ) )
+            if ( Files.isRegularFile( sourcepath.resolve( "module-info.java" ) ) )
             {
-                roots.add( Paths.get( path ) );
+                moduleDescriptorSource = true;
+                break;
             }
-
-            moduleDescriptorSource = findMainDescriptor( roots );
         }
-
-        boolean isExplicitModuleName =
-            resolvePathResult != null && ( resolvePathResult.getModuleNameSource() == ModuleNameSource.MODULEDESCRIPTOR
-                || resolvePathResult.getModuleNameSource() == ModuleNameSource.MANIFEST );
-
+        
         if ( javadocRuntimeVersion.isAtLeast( "9" )
-            && ( isAggregator() || isExplicitModuleName || moduleDescriptorSource != null )
+            && ( isAggregator() || ( mainResolvePathResult != null
+                && ModuleNameSource.MODULEDESCRIPTOR.equals( mainResolvePathResult.getModuleNameSource() ) ) )
             && !isTest() )
         {
             ResolvePathsRequest<File> request =
                 ResolvePathsRequest.ofFiles( getPathElements() );
 
-            if ( moduleDescriptorSource != null )
-            {
-                request.setMainModuleDescriptor( moduleDescriptorSource );
-            }
-            else if ( resolvePathResult != null )
+            if ( mainResolvePathResult != null )
             {
-                request.setModuleDescriptor( resolvePathResult.getModuleDescriptor() );
+                request.setModuleDescriptor( mainResolvePathResult.getModuleDescriptor() );
             }
-
-            if ( resolvePathResult != null && resolvePathResult.getModuleNameSource() == ModuleNameSource.MANIFEST )
-            {
-                // represent --add-modules
-                List<String> addModules = new ArrayList<>();
-
-                // scan for element-list in offline links
-                for ( OfflineLink link : offlineLinks )
-                {
-                    if ( link.equals( getDefaultJavadocApiLink() ) )
-                    {
-                        continue;
-                    }
-
-                    Path elementList = Paths.get( link.getLocation(), "element-list" );
-                    if ( Files.isRegularFile( elementList ) )
-                    {
-                        try
-                        {
-                            List<String> lines = Files.readAllLines( elementList, StandardCharsets.UTF_8 );
-                            
-                            for ( String line : lines )
-                            {
-                                if ( line.startsWith( "module:" ) )
-                                {
-                                    addModules.add( line.substring( "module:".length() ) );
-                                }
-                            }
-                        }
-                        catch ( IOException e )
-                        {
-                            // noop
-                        }
-                    }
-                }
-                additionalModules.addAll( addModules );
-
-                String addModulesLine = StringUtils.join( addModules.iterator(), "," );
-                addArgIfNotEmpty( arguments, "--add-modules", JavadocUtil.quotedPathArgument( addModulesLine ),
-                                  false, false );
-            }
-
-            request.setAdditionalModules( additionalModules );
             
+            request.setAdditionalModules( additionalModules );
+
             try
             {
                 ResolvePathsResult<File> result = locationManager.resolvePaths( request );
                 
                 Set<File> modulePathElements = new HashSet<>( result.getModulepathElements().keySet() )  ;
-                if ( allSourcePaths.size() > 1 )
-                {
-                    // Probably required due to bug in javadoc (Java 9+)  
-                    modulePathElements.addAll( getProjectBuildOutputDirs( getProject() ) );
-                }
+                modulePathElements.addAll( getProjectBuildOutputDirs( getProject() ) );
 
                 Collection<File> classPathElements = new ArrayList<>( result.getClasspathElements().size() );
                 for ( File file : result.getClasspathElements() )
@@ -5121,6 +5110,19 @@ public abstract class AbstractJavadocMojo
                 throw new MavenReportException( e.getMessage(), e );
             }
         }
+        else if ( javadocRuntimeVersion.isAtLeast( "9" ) && ( mainResolvePathResult != null
+            && ModuleNameSource.MANIFEST.equals( mainResolvePathResult.getModuleNameSource() ) ) && !isTest() )
+        {
+            List<File> modulePathFiles = new ArrayList<>( getPathElements() );
+            modulePathFiles.add( project.getArtifact().getFile() );
+            String modulepath = StringUtils.join( modulePathFiles.iterator(), File.pathSeparator );
+            addArgIfNotEmpty( arguments, "--module-path", JavadocUtil.quotedPathArgument( modulepath ) , false, false );
+        }
+        else if ( javadocRuntimeVersion.isAtLeast( "9" ) && moduleDescriptorSource && !isTest() )
+        {
+            String modulepath = StringUtils.join( getPathElements().iterator(), File.pathSeparator );
+            addArgIfNotEmpty( arguments, "--module-path", JavadocUtil.quotedPathArgument( modulepath ) , false, false );
+        }
         else
         {
             String classpath = StringUtils.join( getPathElements().iterator(), File.pathSeparator );
@@ -5172,16 +5174,17 @@ public abstract class AbstractJavadocMojo
             sourcepath = StringUtils.join( sourcePaths.iterator(), File.pathSeparator );
         }
         
-        if ( moduleSourceDir != null )
-        {
-            addArgIfNotEmpty( arguments, "--module-source-path",
-                              JavadocUtil.quotedPathArgument( moduleSourceDir.toString() ) );
-        }
-        else
+        if ( moduleSourceDir == null )
         {
             addArgIfNotEmpty( arguments, "-sourcepath",
                               JavadocUtil.quotedPathArgument( getSourcePath( sourcePaths ) ), false, false );
         }
+        else if ( mainResolvePathResult == null
+            || ModuleNameSource.MODULEDESCRIPTOR.equals( mainResolvePathResult.getModuleNameSource() ) )
+        {
+            addArgIfNotEmpty( arguments, "--module-source-path",
+                              JavadocUtil.quotedPathArgument( moduleSourceDir.toString() ) );
+        }
 
 
         if ( StringUtils.isNotEmpty( sourcepath ) && isJavaDocVersionAtLeast( SINCE_JAVADOC_1_5 ) )
@@ -5212,6 +5215,12 @@ public abstract class AbstractJavadocMojo
         try
         {
             resolvePathResult = locationManager.resolvePath( resolvePathRequest );
+            
+            // happens when artifactFile is a directory without module descriptor
+            if ( resolvePathResult.getModuleDescriptor() == null )
+            {
+                return null;
+            }
         }
         catch ( IOException | RuntimeException /* e.g java.lang.module.FindException */ e )
         {
@@ -5225,14 +5234,13 @@ public abstract class AbstractJavadocMojo
         return resolvePathResult;
     }
 
-    private File findMainDescriptor( Collection<Path> roots )
+    private File findMainDescriptor( Collection<Path> roots ) throws MavenReportException
     {
-        for ( Path root : roots )
+        for ( Map.Entry<Path, Collection<String>> entry : getFiles( roots ).entrySet() )
         {
-            File descriptorFile = root.resolve( "module-info.java" ).toAbsolutePath().toFile();
-            if ( descriptorFile.exists() )
+            if ( entry.getValue().contains( "module-info.java" ) )
             {
-                return descriptorFile;
+                return entry.getKey().resolve( "module-info.java" ).toFile();
             }
         }
         return null;
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 99034b2..d128648 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
@@ -19,7 +19,6 @@ package org.apache.maven.plugins.javadoc.resolver;
  * under the License.
  */
 
-import static org.codehaus.plexus.util.IOUtil.close;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -214,13 +213,10 @@ public final class ResourceResolver extends AbstractLogEnabled
                 continue;
             }
             
-            FileInputStream stream = null;
-            try
+            
+            try ( FileInputStream stream = new FileInputStream( optionsFile ) )
             {
-                stream = new FileInputStream( optionsFile );
                 JavadocOptions options = new JavadocOptionsXpp3Reader().read( stream );
-                stream.close();
-                stream = null;
                 bundles.add( new JavadocBundle( options, new File( project.getBasedir(),
                                                                    options.getJavadocResourcesDirectory() ) ) );
             }
@@ -231,10 +227,6 @@ public final class ResourceResolver extends AbstractLogEnabled
                         + e.getMessage(), e );
                 throw error;
             }
-            finally
-            {
-                close( stream );
-            }
         }
 
         return bundles;
@@ -422,7 +414,8 @@ public final class ResourceResolver extends AbstractLogEnabled
 
                 unArchiver.extract();
 
-                result.add( new AbstractMap.SimpleEntry<>( a.getDependencyConflictId(), d.toPath().toAbsolutePath() ) );
+                result.add( new AbstractMap.SimpleEntry<>( key( a.getGroupId(), a.getArtifactId() ),
+                                                           d.toPath().toAbsolutePath() ) );
             }
             catch ( final NoSuchArchiverException e )
             {
diff --git a/src/test/resources/unit/aggregate-resources-test/aggregate-resources-test-plugin-config.xml b/src/test/resources/unit/aggregate-resources-test/aggregate-resources-test-plugin-config.xml
index 1d05b2e..4b8fd43 100644
--- a/src/test/resources/unit/aggregate-resources-test/aggregate-resources-test-plugin-config.xml
+++ b/src/test/resources/unit/aggregate-resources-test/aggregate-resources-test-plugin-config.xml
@@ -40,6 +40,7 @@ under the License.
           <javadocOptionsDir>${basedir}/target/test/unit/aggregate-resources-test/target/javadoc-bundle-options</javadocOptionsDir>
           <windowtitle>Maven Javadoc Plugin aggregate resources 1.0-SNAPSHOT API</windowtitle>
           <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateResourcesTestMavenProjectStub"/>
             <project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateResourcesProject1TestMavenProjectStub"/>
             <project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateResourcesProject2TestMavenProjectStub"/>
           </reactorProjects>
diff --git a/src/test/resources/unit/aggregate-test/aggregate-test-plugin-config.xml b/src/test/resources/unit/aggregate-test/aggregate-test-plugin-config.xml
index eb7feb8..38c4014 100644
--- a/src/test/resources/unit/aggregate-test/aggregate-test-plugin-config.xml
+++ b/src/test/resources/unit/aggregate-test/aggregate-test-plugin-config.xml
@@ -64,6 +64,7 @@ under the License.
           <version>true</version>
           <windowtitle>Maven Javadoc Plugin Aggregate Test 1.0-SNAPSHOT API</windowtitle>
           <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateTestMavenProjectStub"/>
             <project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateProject1TestMavenProjectStub"/>
             <project implementation="org.apache.maven.plugins.javadoc.stubs.AggregateProject2TestMavenProjectStub"/>
           </reactorProjects>
diff --git a/src/test/resources/unit/custom-configuration/custom-configuration-plugin-config.xml b/src/test/resources/unit/custom-configuration/custom-configuration-plugin-config.xml
index 2400b67..097a1d2 100644
--- a/src/test/resources/unit/custom-configuration/custom-configuration-plugin-config.xml
+++ b/src/test/resources/unit/custom-configuration/custom-configuration-plugin-config.xml
@@ -103,6 +103,9 @@ under the License.
           <excludePackageNames>*.exclude2:custom.configuration.exclude1.*</excludePackageNames>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.CustomConfigurationMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml b/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml
index a857351..3a1a1e5 100644
--- a/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml
+++ b/src/test/resources/unit/default-configuration/default-configuration-plugin-config.xml
@@ -65,6 +65,9 @@ under the License.
           <debug>true</debug>
           <failOnError>true</failOnError>
           <detectJavaApiLink>true</detectJavaApiLink>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.DefaultConfigurationMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/docfiles-test/docfiles-test-plugin-config.xml b/src/test/resources/unit/docfiles-test/docfiles-test-plugin-config.xml
index a42c8c8..ee16ed3 100644
--- a/src/test/resources/unit/docfiles-test/docfiles-test-plugin-config.xml
+++ b/src/test/resources/unit/docfiles-test/docfiles-test-plugin-config.xml
@@ -65,6 +65,9 @@ under the License.
           <excludedocfilessubdir>excluded-dir1:excluded-dir2</excludedocfilessubdir>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.DocfilesTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/docfiles-with-java-test/docfiles-with-java-test-plugin-config.xml b/src/test/resources/unit/docfiles-with-java-test/docfiles-with-java-test-plugin-config.xml
index d148f6d..c8fdaa5 100644
--- a/src/test/resources/unit/docfiles-with-java-test/docfiles-with-java-test-plugin-config.xml
+++ b/src/test/resources/unit/docfiles-with-java-test/docfiles-with-java-test-plugin-config.xml
@@ -65,6 +65,9 @@ under the License.
           <docfilessubdirs>true</docfilessubdirs>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.DocfilesWithJavaTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/doclet-path-test/doclet-path-test-plugin-config.xml b/src/test/resources/unit/doclet-path-test/doclet-path-test-plugin-config.xml
index fd60f5c..48013b0 100644
--- a/src/test/resources/unit/doclet-path-test/doclet-path-test-plugin-config.xml
+++ b/src/test/resources/unit/doclet-path-test/doclet-path-test-plugin-config.xml
@@ -77,6 +77,9 @@ under the License.
           <windowtitle>Maven Javadoc Plugin Doclet Path Test 1.0-SNAPSHOT API</windowtitle>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.DocletPathTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/doclet-test/doclet-test-plugin-config.xml b/src/test/resources/unit/doclet-test/doclet-test-plugin-config.xml
index 6044418..bd72bce 100644
--- a/src/test/resources/unit/doclet-test/doclet-test-plugin-config.xml
+++ b/src/test/resources/unit/doclet-test/doclet-test-plugin-config.xml
@@ -70,6 +70,9 @@ under the License.
           <windowtitle>Maven Javadoc Plugin Doclet Test 1.0-SNAPSHOT API</windowtitle>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.DocletTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/file-include-exclude-test/file-include-exclude-plugin-config.xml b/src/test/resources/unit/file-include-exclude-test/file-include-exclude-plugin-config.xml
index 9b5b261..27ace18 100644
--- a/src/test/resources/unit/file-include-exclude-test/file-include-exclude-plugin-config.xml
+++ b/src/test/resources/unit/file-include-exclude-test/file-include-exclude-plugin-config.xml
@@ -68,6 +68,9 @@ under the License.
           </sourceFileExcludes>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.SubpackagesTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/header-footer-test/header-footer-test-plugin-config.xml b/src/test/resources/unit/header-footer-test/header-footer-test-plugin-config.xml
index f483601..b1a415b 100644
--- a/src/test/resources/unit/header-footer-test/header-footer-test-plugin-config.xml
+++ b/src/test/resources/unit/header-footer-test/header-footer-test-plugin-config.xml
@@ -66,6 +66,9 @@ under the License.
           <quiet>true</quiet>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.HeaderFooterTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/helpfile-test/pom.xml b/src/test/resources/unit/helpfile-test/pom.xml
index 7fd4f61..d3cd157 100644
--- a/src/test/resources/unit/helpfile-test/pom.xml
+++ b/src/test/resources/unit/helpfile-test/pom.xml
@@ -66,6 +66,9 @@ under the License.
           <debug>true</debug>
           <failOnError>true</failOnError>
           <stylesheet>java</stylesheet>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.HelpFileMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
         <dependencies>
           <dependency>
diff --git a/src/test/resources/unit/javaHome-test/javaHome-test-plugin-config.xml b/src/test/resources/unit/javaHome-test/javaHome-test-plugin-config.xml
index 1bec303..b677a8a 100644
--- a/src/test/resources/unit/javaHome-test/javaHome-test-plugin-config.xml
+++ b/src/test/resources/unit/javaHome-test/javaHome-test-plugin-config.xml
@@ -64,6 +64,9 @@ under the License.
           <windowtitle>Maven Javadoc Plugin Java Home Test 1.0-SNAPSHOT API</windowtitle>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.DefaultConfigurationMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/javadocjar-archive-config/javadocjar-archive-config.xml b/src/test/resources/unit/javadocjar-archive-config/javadocjar-archive-config.xml
index 934f133..967e79d 100644
--- a/src/test/resources/unit/javadocjar-archive-config/javadocjar-archive-config.xml
+++ b/src/test/resources/unit/javadocjar-archive-config/javadocjar-archive-config.xml
@@ -76,6 +76,9 @@ under the License.
           <archive>
             <addMavenDescriptor>true</addMavenDescriptor>
           </archive>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.JavadocJarArchiveConfigProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/javadocjar-default/javadocjar-default-plugin-config.xml b/src/test/resources/unit/javadocjar-default/javadocjar-default-plugin-config.xml
index 640ee5e..ca52555 100644
--- a/src/test/resources/unit/javadocjar-default/javadocjar-default-plugin-config.xml
+++ b/src/test/resources/unit/javadocjar-default/javadocjar-default-plugin-config.xml
@@ -73,6 +73,9 @@ under the License.
           <version>true</version>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.JavadocJarDefaultMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/javadocjar-failonerror/javadocjar-failonerror-plugin-config.xml b/src/test/resources/unit/javadocjar-failonerror/javadocjar-failonerror-plugin-config.xml
index 2903dcb..f74c496 100644
--- a/src/test/resources/unit/javadocjar-failonerror/javadocjar-failonerror-plugin-config.xml
+++ b/src/test/resources/unit/javadocjar-failonerror/javadocjar-failonerror-plugin-config.xml
@@ -72,6 +72,9 @@ under the License.
           <version>true</version>
           <debug>true</debug>
           <failOnError>false</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.JavadocJarFailOnErrorMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/javadocjar-invalid-destdir/javadocjar-invalid-destdir-plugin-config.xml b/src/test/resources/unit/javadocjar-invalid-destdir/javadocjar-invalid-destdir-plugin-config.xml
index 87915df..f3b8618 100644
--- a/src/test/resources/unit/javadocjar-invalid-destdir/javadocjar-invalid-destdir-plugin-config.xml
+++ b/src/test/resources/unit/javadocjar-invalid-destdir/javadocjar-invalid-destdir-plugin-config.xml
@@ -68,6 +68,9 @@ under the License.
           <windowtitle>Maven Javadoc Plugin Javadoc Jar Invalid Destdir Test 1.0-SNAPSHOT API</windowtitle>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.JavadocJarInvalidDestdirMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/jdk5-test/jdk5-test-plugin-config.xml b/src/test/resources/unit/jdk5-test/jdk5-test-plugin-config.xml
index fb33138..3e3ce3b 100644
--- a/src/test/resources/unit/jdk5-test/jdk5-test-plugin-config.xml
+++ b/src/test/resources/unit/jdk5-test/jdk5-test-plugin-config.xml
@@ -47,6 +47,9 @@ under the License.
           <quiet>true</quiet>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.Jdk5TestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/jdk6-test/jdk6-test-plugin-config.xml b/src/test/resources/unit/jdk6-test/jdk6-test-plugin-config.xml
index 1fe4f49..890041b 100644
--- a/src/test/resources/unit/jdk6-test/jdk6-test-plugin-config.xml
+++ b/src/test/resources/unit/jdk6-test/jdk6-test-plugin-config.xml
@@ -76,6 +76,9 @@ under the License.
           <stylesheet>java</stylesheet>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.Jdk6TestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/newline-test/newline-test-plugin-config.xml b/src/test/resources/unit/newline-test/newline-test-plugin-config.xml
index ecdf7bc..e2cf55b 100644
--- a/src/test/resources/unit/newline-test/newline-test-plugin-config.xml
+++ b/src/test/resources/unit/newline-test/newline-test-plugin-config.xml
@@ -83,6 +83,9 @@ Copyright 2005,
           <quiet>true</quiet>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.NewlineTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/optionsumlautencoding-test/optionsumlautencoding-test-plugin-config.xml b/src/test/resources/unit/optionsumlautencoding-test/optionsumlautencoding-test-plugin-config.xml
index eed07c7..3a242f0 100644
--- a/src/test/resources/unit/optionsumlautencoding-test/optionsumlautencoding-test-plugin-config.xml
+++ b/src/test/resources/unit/optionsumlautencoding-test/optionsumlautencoding-test-plugin-config.xml
@@ -66,6 +66,9 @@ under the License.
           <debug>true</debug>
           <failOnError>true</failOnError>
           <detectJavaApiLink>true</detectJavaApiLink>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.OptionsUmlautEncodingMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/proxy-test/proxy-test-plugin-config.xml b/src/test/resources/unit/proxy-test/proxy-test-plugin-config.xml
index 4f54793..b39866f 100644
--- a/src/test/resources/unit/proxy-test/proxy-test-plugin-config.xml
+++ b/src/test/resources/unit/proxy-test/proxy-test-plugin-config.xml
@@ -48,6 +48,9 @@ under the License.
           <quiet>true</quiet>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.ProxyTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/quotedpath'test/quotedpath-test-plugin-config.xml b/src/test/resources/unit/quotedpath'test/quotedpath-test-plugin-config.xml
index 826f676..aa04cff 100644
--- a/src/test/resources/unit/quotedpath'test/quotedpath-test-plugin-config.xml
+++ b/src/test/resources/unit/quotedpath'test/quotedpath-test-plugin-config.xml
@@ -64,6 +64,9 @@ under the License.
           <windowtitle>Maven Javadoc Plugin Quoted Path Test 1.0-SNAPSHOT API</windowtitle>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.QuotedPathMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/resources-test/resources-test-plugin-config.xml b/src/test/resources/unit/resources-test/resources-test-plugin-config.xml
index 9d1c641..a3008d8 100644
--- a/src/test/resources/unit/resources-test/resources-test-plugin-config.xml
+++ b/src/test/resources/unit/resources-test/resources-test-plugin-config.xml
@@ -48,6 +48,9 @@ under the License.
           <docfilessubdirs>true</docfilessubdirs>
           <stylesheet>java</stylesheet>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.ResourcesTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/resources-with-excludes-test/resources-with-excludes-test-plugin-config.xml b/src/test/resources/unit/resources-with-excludes-test/resources-with-excludes-test-plugin-config.xml
index 908c43b..117895c 100644
--- a/src/test/resources/unit/resources-with-excludes-test/resources-with-excludes-test-plugin-config.xml
+++ b/src/test/resources/unit/resources-with-excludes-test/resources-with-excludes-test-plugin-config.xml
@@ -49,6 +49,9 @@ under the License.
           <excludedocfilessubdir>test</excludedocfilessubdir>
           <stylesheet>java</stylesheet>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.ResourcesWithExcludesTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/stylesheetfile-test/pom.xml b/src/test/resources/unit/stylesheetfile-test/pom.xml
index 1c0ca02..0caded2 100644
--- a/src/test/resources/unit/stylesheetfile-test/pom.xml
+++ b/src/test/resources/unit/stylesheetfile-test/pom.xml
@@ -65,6 +65,9 @@ under the License.
           <windowtitle>Maven Javadoc Plugin Stylesheetfile Test 1.0-SNAPSHOT API</windowtitle>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.StylesheetFileMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
         <dependencies>
           <dependency>
diff --git a/src/test/resources/unit/subpackages-test/subpackages-test-plugin-config.xml b/src/test/resources/unit/subpackages-test/subpackages-test-plugin-config.xml
index ec0ba80..2ec1e04 100644
--- a/src/test/resources/unit/subpackages-test/subpackages-test-plugin-config.xml
+++ b/src/test/resources/unit/subpackages-test/subpackages-test-plugin-config.xml
@@ -67,6 +67,9 @@ under the License.
           <excludePackageNames>subpackages.test.excluded:subpackages.test.included.exclude</excludePackageNames>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.SubpackagesTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/tag-test/tag-test-plugin-config.xml b/src/test/resources/unit/tag-test/tag-test-plugin-config.xml
index f6ecfa1..b49d504 100644
--- a/src/test/resources/unit/tag-test/tag-test-plugin-config.xml
+++ b/src/test/resources/unit/tag-test/tag-test-plugin-config.xml
@@ -60,6 +60,9 @@ under the License.
           <stylesheet>java</stylesheet>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.TagTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/taglet-test/taglet-test-plugin-config.xml b/src/test/resources/unit/taglet-test/taglet-test-plugin-config.xml
index a728d10..c9d3988 100644
--- a/src/test/resources/unit/taglet-test/taglet-test-plugin-config.xml
+++ b/src/test/resources/unit/taglet-test/taglet-test-plugin-config.xml
@@ -70,6 +70,9 @@ under the License.
           <windowtitle>Maven Javadoc Plugin Taglet Test 1.0-SNAPSHOT API</windowtitle>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.TagletTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/tagletArtifacts-test/tagletArtifacts-test-plugin-config.xml b/src/test/resources/unit/tagletArtifacts-test/tagletArtifacts-test-plugin-config.xml
index 4882230..14fcb34 100644
--- a/src/test/resources/unit/tagletArtifacts-test/tagletArtifacts-test-plugin-config.xml
+++ b/src/test/resources/unit/tagletArtifacts-test/tagletArtifacts-test-plugin-config.xml
@@ -76,6 +76,9 @@ under the License.
               <version>1.0</version>
             </tagletArtifact>
           </tagletArtifacts>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.TagletArtifactsMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/test-javadoc-test/test-javadoc-test-plugin-config.xml b/src/test/resources/unit/test-javadoc-test/test-javadoc-test-plugin-config.xml
index 53d75b4..0cb21da 100644
--- a/src/test/resources/unit/test-javadoc-test/test-javadoc-test-plugin-config.xml
+++ b/src/test/resources/unit/test-javadoc-test/test-javadoc-test-plugin-config.xml
@@ -53,6 +53,9 @@ under the License.
           <stylesheet>java</stylesheet>
           <debug>true</debug>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.TestJavadocMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>
diff --git a/src/test/resources/unit/validate-options-test/wrong-locale-with-variant-test-plugin-config.xml b/src/test/resources/unit/validate-options-test/wrong-locale-with-variant-test-plugin-config.xml
index f914972..55e8965 100644
--- a/src/test/resources/unit/validate-options-test/wrong-locale-with-variant-test-plugin-config.xml
+++ b/src/test/resources/unit/validate-options-test/wrong-locale-with-variant-test-plugin-config.xml
@@ -45,6 +45,9 @@ under the License.
           <locale>fr_CA_wrong</locale>
           <stylesheet>java</stylesheet>
           <failOnError>true</failOnError>
+          <reactorProjects>
+            <project implementation="org.apache.maven.plugins.javadoc.stubs.WrongEncodingOptionsTestMavenProjectStub"/>
+          </reactorProjects>
         </configuration>
       </plugin>
     </plugins>