[MJAVADOC-444] add aggregate-no-fork and aggregate-test-no-fork for non-forking versions of aggregate goals.

diff --git a/.gitignore b/.gitignore
index ba0d257..bdbdf67 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,5 @@
 /dependencies.xml
 .java-version
 /javadoc-options-javadoc-resources.xml
+.checkstyle
+/src/it/mrm/3rdparty/_doclet-1.0.jar
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..27bfd05
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,91 @@
+<!---
+ 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.
+-->
+Contributing to Apache Maven JavaDoc Plugin
+======================
+
+You have found a bug or you have an idea for a cool new feature? Contributing
+code is a great way to give something back to the open source community. Before
+you dig right into the code, there are a few guidelines that we need
+contributors to follow so that we can have a chance of keeping on top of
+things.
+
+Some of the ideas are documented in the [Maven Wiki][maven-wiki]
+which might be interesting to read and for further discussion.
+
+Getting Started
+---------------
+
++ Make sure you have a [JIRA account](https://issues.apache.org/jira/).
++ Make sure you have a [GitHub account](https://github.com/signup/free).
++ If you're planning to implement a new feature, it makes sense to discuss your changes 
+  on the [dev list](https://maven.apache.org/mail-lists.html) first. 
+  This way you can make sure you're not wasting your time on something that isn't 
+  considered to be in Apache Maven's scope.
++ Submit a ticket for your issue, assuming one does not already exist.
+  + Clearly describe the issue, including steps to reproduce when it is a bug.
+  + Make sure you fill in the earliest version that you know has the issue.
++ Fork the repository on GitHub.
+
+Making and Submitting Changes
+--------------
+
+We accept Pull Requests via GitHub. The [developer mailing list][dev-ml-list] is the
+main channel of communication for contributors.  
+There are some guidelines which will make applying PRs easier for us:
++ Create a topic branch from where you want to base your work (this is usually the master branch).
+  Push your changes to a topic branch in your fork of the repository.
++ Make commits of logical units.
++ Respect the original code style: by using the same [codestyle][code-style],
+  patches should only highlight the actual difference, not being disturbed by any formatting issues:
+  + Only use spaces for indentation.
+  + Create minimal diffs - disable on save actions like reformat source code or organize imports. 
+    If you feel the source code should be reformatted, create a separate PR for this change.
+  + Check for unnecessary whitespace with `git diff --check` before committing.
++ Make sure your commit messages are in the proper format. Your commit message should contain the key of the JIRA issue.
+```
+[MJAVADOC-XXX] - Subject of the JIRA Ticket
+ Optional supplemental description.
+```
++ Make sure you have added the necessary tests (JUnit/IT) for your changes.
++ Run all the tests with `mvn -Prun-its verify` to assure nothing else was accidentally broken.
++ Submit a pull request to the repository in the Apache organization.
++ Update your JIRA ticket and include a link to the pull request in the ticket.
+
+If you plan to contribute on a regular basis, please consider filing a [contributor license agreement][cla].
+
+Making Trivial Changes
+----------------------
+
+For changes of a trivial nature to comments and documentation, it is not always
+necessary to create a new ticket in JIRA.  In this case, it is appropriate to
+start the first line of a commit with '(doc)' instead of a ticket number.
+
+Additional Resources
+--------------------
+
++ [Contributing patches](https://maven.apache.org/guides/development/guide-maven-development.html#Creating_and_submitting_a_patch)
++ [Apache Maven JavaDoc JIRA project page](https://issues.apache.org/jira/projects/MJAVADOC/)
++ [Contributor License Agreement][cla]
++ [General GitHub documentation](https://help.github.com/)
++ [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
++ [Apache Maven Twitter Account](https://twitter.com/ASFMavenProject)
++ #Maven IRC channel on freenode.org
+
+[dev-ml-list]: https://maven.apache.org/mail-lists.html
+[code-style]: https://maven.apache.org/developers/conventions/code.html
+[cla]: https://www.apache.org/licenses/#clas
+[maven-wiki]: https://cwiki.apache.org/confluence/display/MAVEN/Index
diff --git a/Jenkinsfile b/Jenkinsfile
index 09ac70f..e9f05f7 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -17,4 +17,4 @@
  * under the License.
  */
 
-asfMavenTlpStdBuild()
+asfMavenTlpPlgnBuild()
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e9386b8
--- /dev/null
+++ b/README.md
@@ -0,0 +1,99 @@
+<!---
+ 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.
+-->
+Contributing to Apache Maven JavaDoc Plugin
+======================
+
+[![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/apache/maven.svg?label=License)][license]
+[![Maven Central](https://img.shields.io/maven-central/v/org.apache.maven.plugins/maven-javadoc-plugin.svg?label=Maven%20Central)](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.apache.maven.plugins%22%20AND%20a%3A%22maven-javadoc-plugin%22)
+[![Jenkins Status](https://img.shields.io/jenkins/s/https/builds.apache.org/job/maven-box/job/maven-javadoc-plugin/job/master.svg?style=flat-square)][build]
+[![Jenkins tests](https://img.shields.io/jenkins/t/https/builds.apache.org/job/maven-box/job/maven-javadoc-plugin/job/master.svg?style=flat-square)][test-results]
+
+You have found a bug or you have an idea for a cool new feature? Contributing
+code is a great way to give something back to the open source community. Before
+you dig right into the code, there are a few guidelines that we need
+contributors to follow so that we can have a chance of keeping on top of
+things.
+
+Some of the ideas are documented in the [Maven Wiki][maven-wiki]
+which might be interesting to read and for further discussion.
+
+Getting Started
+---------------
+
++ Make sure you have a [JIRA account](https://issues.apache.org/jira/).
++ Make sure you have a [GitHub account](https://github.com/signup/free).
++ If you're planning to implement a new feature, it makes sense to discuss your changes 
+  on the [dev list](https://maven.apache.org/mail-lists.html) first. 
+  This way you can make sure you're not wasting your time on something that isn't 
+  considered to be in Apache Maven's scope.
++ Submit a ticket for your issue, assuming one does not already exist.
+  + Clearly describe the issue, including steps to reproduce when it is a bug.
+  + Make sure you fill in the earliest version that you know has the issue.
++ Fork the repository on GitHub.
+
+Making and Submitting Changes
+--------------
+
+We accept Pull Requests via GitHub. The [developer mailing list][dev-ml-list] is the
+main channel of communication for contributors.  
+There are some guidelines which will make applying PRs easier for us:
++ Create a topic branch from where you want to base your work (this is usually the master branch).
+  Push your changes to a topic branch in your fork of the repository.
++ Make commits of logical units.
++ Respect the original code style: by using the same [codestyle][code-style],
+  patches should only highlight the actual difference, not being disturbed by any formatting issues:
+  + Only use spaces for indentation.
+  + Create minimal diffs - disable on save actions like reformat source code or organize imports. 
+    If you feel the source code should be reformatted, create a separate PR for this change.
+  + Check for unnecessary whitespace with `git diff --check` before committing.
++ Make sure your commit messages are in the proper format. Your commit message should contain the key of the JIRA issue.
+```
+[MJAVADOC-XXX] - Subject of the JIRA Ticket
+ Optional supplemental description.
+```
++ Make sure you have added the necessary tests (JUnit/IT) for your changes.
++ Run all the tests with `mvn -Prun-its verify` to assure nothing else was accidentally broken.
++ Submit a pull request to the repository in the Apache organization.
++ Update your JIRA ticket and include a link to the pull request in the ticket.
+
+If you plan to contribute on a regular basis, please consider filing a [contributor license agreement][cla].
+
+Making Trivial Changes
+----------------------
+
+For changes of a trivial nature to comments and documentation, it is not always
+necessary to create a new ticket in JIRA.  In this case, it is appropriate to
+start the first line of a commit with '(doc)' instead of a ticket number.
+
+Additional Resources
+--------------------
+
++ [Contributing patches](https://maven.apache.org/guides/development/guide-maven-development.html#Creating_and_submitting_a_patch)
++ [Apache Maven JavaDoc JIRA project page](https://issues.apache.org/jira/projects/MJAVADOC/)
++ [Contributor License Agreement][cla]
++ [General GitHub documentation](https://help.github.com/)
++ [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
++ [Apache Maven Twitter Account](https://twitter.com/ASFMavenProject)
++ #Maven IRC channel on freenode.org
+
+[license]: https://www.apache.org/licenses/LICENSE-2.0
+[dev-ml-list]: https://maven.apache.org/mailing-lists.html
+[code-style]: https://maven.apache.org/developers/conventions/code.html
+[cla]: https://www.apache.org/licenses/#clas
+[maven-wiki]: https://cwiki.apache.org/confluence/display/MAVEN/Index
+[test-results]: https://builds.apache.org/job/maven-box/job/maven-javadoc-plugin/job/master/lastCompletedBuild/testReport/
+[build]: https://builds.apache.org/job/maven-box/job/maven-javadoc-plugin/job/master/
diff --git a/pom.xml b/pom.xml
index 5de8896..4a21374 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,12 +25,12 @@
   <parent>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-plugins</artifactId>
-    <version>30</version>
-    <relativePath>../../pom/maven/maven-plugins/pom.xml</relativePath>
+    <version>33</version>
+    <relativePath/>
   </parent>
 
   <artifactId>maven-javadoc-plugin</artifactId>
-  <version>3.0.1-SNAPSHOT</version>
+  <version>3.1.0-SNAPSHOT</version>
   <packaging>maven-plugin</packaging>
 
   <name>Apache Maven Javadoc Plugin</name>
@@ -61,7 +61,7 @@
   <distributionManagement>
     <site>
       <id>apache.website</id>
-      <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/components/${maven.site.path}</url>
+      <url>scm:svn:https://svn.apache.org/repos/asf/maven/website/components/${maven.site.path}</url>
     </site>
   </distributionManagement>
 
@@ -113,6 +113,12 @@
     <contributor>
       <name>Anton Klarén</name>
     </contributor>
+    <contributor>
+      <name>Kevin Risden</name>
+    </contributor>
+    <contributor>
+      <name>Michael Stumpf</name>
+    </contributor>
   </contributors>
 
   <dependencies>
@@ -168,12 +174,12 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-archiver</artifactId>
-      <version>3.1.1</version>
+      <version>3.2.0</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-invoker</artifactId>
-      <version>2.2</version>
+      <version>3.0.0</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
@@ -183,7 +189,7 @@
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-artifact-transfer</artifactId>
-      <version>0.9.1</version>
+      <version>0.10.1</version>
     </dependency>
 
     <!-- Doxia -->
@@ -227,19 +233,24 @@
     <dependency>
       <groupId>com.thoughtworks.qdox</groupId>
       <artifactId>qdox</artifactId>
-      <version>2.0-M7</version>
+      <version>2.0-M10</version>
     </dependency>
 
     <!-- Plexus -->
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-java</artifactId>
-      <version>0.9.5</version>
+      <version>1.0.1</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-archiver</artifactId>
-      <version>3.4</version>
+      <version>3.6.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-io</artifactId>
+      <version>3.1.1</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
@@ -249,12 +260,16 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-interactivity-api</artifactId>
-      <version>1.0-alpha-4</version>
+      <version>1.0-alpha-6</version>
       <exclusions>
         <exclusion>
           <groupId>plexus</groupId>
           <artifactId>plexus-utils</artifactId>
         </exclusion>
+        <exclusion>
+          <groupId>org.codehaus.plexus</groupId>
+          <artifactId>plexus-component-api</artifactId>
+        </exclusion>
       </exclusions>
     </dependency>
 
@@ -292,7 +307,7 @@
     <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
-      <version>2.12.0</version>
+      <version>2.23.4</version>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -322,6 +337,7 @@
               <!-- Checksum files cannot contain a license header -->
               <exclude>**/*.sha1</exclude>
               <!-- Javadoc package list files cannot contain a license header -->
+              <exclude>**/*element-list*</exclude>
               <exclude>**/*package-list*</exclude>
               <!-- This file is used to patch the generated Javadoc html files -->
               <exclude>src/main/resources/org/apache/maven/plugins/javadoc/frame-injection-fix.txt</exclude>
@@ -332,40 +348,10 @@
             </excludes>
           </configuration>
         </plugin>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-plugin-plugin</artifactId>
-          <version>3.5</version>
-        </plugin>
       </plugins>
     </pluginManagement>
     <plugins>
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-enforcer-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>enforce-bytecode-version</id>
-            <configuration>
-              <rules>
-                <enforceBytecodeVersion>
-                  <ignoreClasses>
-                    <ignoreClass>module-info</ignoreClass>
-                  </ignoreClasses>
-                </enforceBytecodeVersion>
-              </rules>
-            </configuration>
-          </execution>
-        </executions>
-        <dependencies>
-          <dependency>
-            <groupId>org.codehaus.mojo</groupId>
-            <artifactId>extra-enforcer-rules</artifactId>
-            <version>1.0-beta-6</version>
-          </dependency>
-        </dependencies>
-      </plugin>
-      <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
         <executions>
@@ -387,7 +373,6 @@
       <plugin>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-component-metadata</artifactId>
-        <version>1.7.1</version>
         <executions>
           <execution>
             <goals>
@@ -397,7 +382,6 @@
           </execution>
         </executions>
       </plugin>
-      
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
@@ -413,6 +397,18 @@
           </environmentVariables>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-plugin-plugin</artifactId>
+        <dependencies>
+          <!-- see MPLUGIN-346 -->
+          <dependency>
+            <groupId>org.codehaus.plexus</groupId>
+            <artifactId>plexus-utils</artifactId>
+            <version>3.1.1</version>
+          </dependency>
+        </dependencies>
+      </plugin>
     </plugins>
   </build>
 
@@ -435,12 +431,16 @@
               <properties>
                 <maven.compiler.source>${maven.compiler.source}</maven.compiler.source>
                 <maven.compiler.target>${maven.compiler.target}</maven.compiler.target>
+                <!-- e.g. ensure that Java7 picks up TLSv1.2 when connecting with Central -->
+                <https.protocols>${https.protocols}</https.protocols>
               </properties>
               <filterProperties>
                 <mrm.3rdparty.url>${mrm.3rdparty.url}</mrm.3rdparty.url>
               </filterProperties>
               <environmentVariables>
                 <JENKINS_MAVEN_AGENT_DISABLED>true</JENKINS_MAVEN_AGENT_DISABLED>
+                <!-- required for MJAVADOC-538 -->
+                <_JAVA_OPTIONS>-Dabc=def</_JAVA_OPTIONS>
               </environmentVariables>
             </configuration>
           </plugin>
@@ -507,7 +507,6 @@
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-changes-plugin</artifactId>
-            <version>2.9</version>
             <configuration>
               <!-- For JIRA-report -->
               <columnNames>Type,Key,Summary,Assignee,Status,Resolution,Fix Version</columnNames>
@@ -524,11 +523,6 @@
               </reportSet>
             </reportSets>
           </plugin>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-plugin-plugin</artifactId>
-            <version>3.5</version>
-          </plugin>
         </plugins>
       </reporting>
     </profile>
@@ -542,7 +536,7 @@
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
               <excludes>
-                <exlude>**/*Test*.java</exlude>
+                <exclude>**/*Test*.java</exclude>
               </excludes>
             </configuration>
           </plugin>
diff --git a/src/it/mrm/3rdparty/doclet-1.0.jar/org/apache/maven/plugins/javadoc/its/Doclet.class b/src/it/mrm/3rdparty/doclet-1.0.jar/org/apache/maven/plugins/javadoc/its/Doclet.class
new file mode 100644
index 0000000..66711f7
--- /dev/null
+++ b/src/it/mrm/3rdparty/doclet-1.0.jar/org/apache/maven/plugins/javadoc/its/Doclet.class
Binary files differ
diff --git a/src/it/mrm/3rdparty/doclet-1.0.pom b/src/it/mrm/3rdparty/doclet-1.0.pom
new file mode 100644
index 0000000..476c7a9
--- /dev/null
+++ b/src/it/mrm/3rdparty/doclet-1.0.pom
@@ -0,0 +1,27 @@
+<?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>org.apache.maven.plugins.javadoc.its</groupId>
+  <artifactId>doclet</artifactId>
+  <version>1.0</version>
+    
+</project>
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d1/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d1/pom.xml
new file mode 100644
index 0000000..423ac76
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d1/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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+    <artifactId>mjavadoc134c</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>mjavadoc134d1</artifactId>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d1/src/main/java/a/b/c/d/D1.java
similarity index 90%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-134_multiaggregate/b/c/d1/src/main/java/a/b/c/d/D1.java
index 53480de..3688552 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d1/src/main/java/a/b/c/d/D1.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package a.b.c.d;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,7 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+public class D1
+{
 
-}
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d2/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d2/pom.xml
new file mode 100644
index 0000000..f1e343e
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d2/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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+    <artifactId>mjavadoc134c</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>mjavadoc13d2</artifactId>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d2/src/main/java/a/b/c/d/D2.java
similarity index 90%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-134_multiaggregate/b/c/d2/src/main/java/a/b/c/d/D2.java
index 53480de..d588de3 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/d2/src/main/java/a/b/c/d/D2.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package a.b.c.d;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,7 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+public class D2
+{
 
-}
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/b/c/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/pom.xml
new file mode 100644
index 0000000..651c68d
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/c/pom.xml
@@ -0,0 +1,39 @@
+<?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>mjavadoc134b</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>mjavadoc134c</artifactId>
+  <packaging>pom</packaging>
+  
+  <modules>
+    <module>d1</module>
+    <module>d2</module>
+  </modules>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/b/e/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/b/e/pom.xml
new file mode 100644
index 0000000..6190c2e
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/e/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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+    <artifactId>mjavadoc134b</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>mjavadoc134e</artifactId>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-134_multiaggregate/b/e/src/main/java/a/b/e/E.java
similarity index 90%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-134_multiaggregate/b/e/src/main/java/a/b/e/E.java
index 53480de..9b8dcb7 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/e/src/main/java/a/b/e/E.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package a.b.e;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,7 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
-}
+public interface E
+{
+    
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/b/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/b/pom.xml
new file mode 100644
index 0000000..736b908
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/b/pom.xml
@@ -0,0 +1,39 @@
+<?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>mjavadoc134</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>mjavadoc134b</artifactId>
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>c</module>
+    <module>e</module>
+  </modules>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/f/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/f/pom.xml
new file mode 100644
index 0000000..df1e239
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/f/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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+    <artifactId>mjavadoc134</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>mjavadoc13df</artifactId>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-134_multiaggregate/f/src/main/java/a/f/F.java
similarity index 90%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-134_multiaggregate/f/src/main/java/a/f/F.java
index 53480de..1f72633 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/f/src/main/java/a/f/F.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package a.f;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,6 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
-}
+public interface F
+{
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/invoker.properties b/src/it/projects/MJAVADOC-134_multiaggregate/invoker.properties
new file mode 100644
index 0000000..a3d335e
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/invoker.properties
@@ -0,0 +1,18 @@
+# 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 = site
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/pom.xml b/src/it/projects/MJAVADOC-134_multiaggregate/pom.xml
new file mode 100644
index 0000000..c11907e
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/pom.xml
@@ -0,0 +1,86 @@
+<?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>mjavadoc134</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-134</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <modules>
+    <module>b</module>
+    <module>f</module>
+  </modules>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-site-plugin</artifactId>
+          <version>@sitePluginVersion@</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>aggregate</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+        <version>2.9</version>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>index</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>  
+</project>
diff --git a/src/it/projects/MJAVADOC-134_multiaggregate/verify.groovy b/src/it/projects/MJAVADOC-134_multiaggregate/verify.groovy
new file mode 100644
index 0000000..c2709c3
--- /dev/null
+++ b/src/it/projects/MJAVADOC-134_multiaggregate/verify.groovy
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+// A 
+assert new File( basedir, 'target/site/apidocs/a/b/c/d/D1.html').exists()
+assert new File( basedir, 'target/site/apidocs/a/b/c/d/D2.html').exists()
+assert new File( basedir, 'target/site/apidocs/a/b/e/E.html').exists()
+assert new File( basedir, 'target/site/apidocs/a/f/F.html').exists()
+
+// B
+assert new File( basedir, 'b/target/site/apidocs/a/b/c/d/D1.html').exists()
+assert new File( basedir, 'b/target/site/apidocs/a/b/c/d/D2.html').exists()
+assert new File( basedir, 'b/target/site/apidocs/a/b/e/E.html').exists()
+assert !(new File( basedir, 'b/target/site/apidocs/a/f/F.html').exists())
+
+// C
+assert new File( basedir, 'b/c/target/site/apidocs/a/b/c/d/D1.html').exists()
+assert new File( basedir, 'b/c/target/site/apidocs/a/b/c/d/D2.html').exists()
+assert !(new File( basedir, 'b/c/target/site/apidocs/a/b/e/E.html').exists())
+assert !(new File( basedir, 'b/c/target/site/apidocs/a/f/F.html').exists())
+
+// D1
+assert new File( basedir, 'b/c/d1/target/site/apidocs/a/b/c/d/D1.html').exists()
+assert !(new File( basedir, 'b/c/d1/target/site/apidocs/a/b/c/d/D2.html').exists())
+assert !(new File( basedir, 'b/c/d1/target/site/apidocs/a/b/e/E.html').exists())
+assert !(new File( basedir, 'b/c/d1/target/site/apidocs/a/f/F.html').exists())
+
+// D2
+assert !(new File( basedir, 'b/c/d2/target/site/apidocs/a/b/c/d/D1.html').exists())
+assert new File( basedir, 'b/c/d2/target/site/apidocs/a/b/c/d/D2.html').exists()
+assert !(new File( basedir, 'b/c/d2/target/site/apidocs/a/b/e/E.html').exists())
+assert !(new File( basedir, 'b/c/d2/target/site/apidocs/a/f/F.html').exists())
+
+// E
+assert !(new File( basedir, 'b/e/target/site/apidocs/a/b/c/d/D1.html').exists())
+assert !(new File( basedir, 'b/e/target/site/apidocs/a/b/c/d/D2.html').exists())
+assert new File( basedir, 'b/e/target/site/apidocs/a/b/e/E.html').exists()
+assert !(new File( basedir, 'b/e/target/site/apidocs/a/f/F.html').exists())
+
+// F
+assert !(new File( basedir, 'f/target/site/apidocs/a/b/c/d/D1.html').exists())
+assert !(new File( basedir, 'f/target/site/apidocs/a/b/c/d/D2.html').exists())
+assert !(new File( basedir, 'f/target/site/apidocs/a/b/e/E.html').exists())
+assert new File( basedir, 'f/target/site/apidocs/a/f/F.html').exists()
diff --git a/src/it/projects/MJAVADOC-257/invoker.properties b/src/it/projects/MJAVADOC-257/invoker.properties
index 08d1d7b..12cb573 100644
--- a/src/it/projects/MJAVADOC-257/invoker.properties
+++ b/src/it/projects/MJAVADOC-257/invoker.properties
@@ -16,3 +16,5 @@
 # under the License.

 

 invoker.goals=clean site

+# there are no new doclettags for plugin-tools

+invoker.java.version=10-

diff --git a/src/it/projects/MJAVADOC-325/verify.bsh b/src/it/projects/MJAVADOC-325/verify.bsh
index 7c4ce44..3c60e6c 100644
--- a/src/it/projects/MJAVADOC-325/verify.bsh
+++ b/src/it/projects/MJAVADOC-325/verify.bsh
@@ -30,7 +30,7 @@
 }

 

 String optionsContent = FileUtils.fileRead( optionsFile );

-String javaApiLink = "'http://docs.oracle.com/javase/1,5,0/docs/api'";

+String javaApiLink = "'https://docs.oracle.com/javase/1.5.0/docs/api'";

 

 if ( !optionsContent.contains( javaApiLink ) )

 {

diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/Api.java
similarity index 95%
rename from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
rename to src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/Api.java
index 53480de..7121d40 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/Api.java
@@ -19,7 +19,7 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+/** API */
+public class Api {
 
 }
diff --git a/src/it/projects/MJAVADOC-384/verify.bsh b/src/it/projects/MJAVADOC-384/verify.bsh
index dce4671..1c80f44 100644
--- a/src/it/projects/MJAVADOC-384/verify.bsh
+++ b/src/it/projects/MJAVADOC-384/verify.bsh
@@ -36,11 +36,19 @@
     }

 }

 

-File javadocFile = new File ( basedir, "target/site/apidocs/com/foo/bar/Api.html" );

-if ( !javadocFile.exists() ) 

+File[] existingJavadocFiles = new File[] {

+    new File( basedir, "target/site/apidocs/com/foo/bar/Api.html" ),

+    new File( basedir, "target/site/apidocs/com/foo/bar/internal/Api.html" ),

+};

+

+for ( File javadocFile : existingJavadocFiles )

 {

-    System.err.println( javadocFile.getAbsolutePath() + " is missing." );

-    return false;

+    if ( !javadocFile.exists() ) 

+    {

+        System.err.println( javadocFile.getAbsolutePath() + " is missing." );

+        return false;

+    }

 }

 

+

 return true;

diff --git a/src/it/projects/MJAVADOC-420_fixparam/invoker.properties b/src/it/projects/MJAVADOC-420_fixparam/invoker.properties
new file mode 100644
index 0000000..52b0251
--- /dev/null
+++ b/src/it/projects/MJAVADOC-420_fixparam/invoker.properties
@@ -0,0 +1,18 @@
+# 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=javadoc:fix compile
diff --git a/src/it/projects/MJAVADOC-420_fixparam/pom.xml b/src/it/projects/MJAVADOC-420_fixparam/pom.xml
new file mode 100644
index 0000000..0bfedd3
--- /dev/null
+++ b/src/it/projects/MJAVADOC-420_fixparam/pom.xml
@@ -0,0 +1,47 @@
+<?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>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId>
+  <artifactId>mjavadoc420</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-420</url>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <detectLinks>true</detectLinks>
+            <force>true</force>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+  
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-420_fixparam/src/main/java/com/example/FirstBug.java
similarity index 70%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-420_fixparam/src/main/java/com/example/FirstBug.java
index 53480de..cfd1cb4 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-420_fixparam/src/main/java/com/example/FirstBug.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package com.example;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,18 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+/**
+ * <p>FirstBug class.</p>
+ */
+public class FirstBug {
 
-}
+    /**
+     * <p>mymethod.</p>
+     *
+     * @param param a {@link java.lang.String} object.
+     * @param paramSecond a {@link java.lang.String} object.
+     */
+    public void mymethod( String param, String paramSecond ) {
+        
+    }
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-420_fixparam/verify.groovy
similarity index 74%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-420_fixparam/verify.groovy
index 53480de..0caa34d 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-420_fixparam/verify.groovy
@@ -1,5 +1,3 @@
-package com.foo.bar.internal;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -8,9 +6,9 @@
  * 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
@@ -19,7 +17,9 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+def file = new File( basedir, 'src/main/java/com/example/FirstBug.java' );
 
-}
+assert file.exists()
+
+// assert that javadoc of class correctly contains link, just like method details
+assert 1 == file.text.count('@param paramSecond a {@link java.lang.String} object.')
diff --git a/src/it/projects/MJAVADOC-427/invoker.properties b/src/it/projects/MJAVADOC-427/invoker.properties
new file mode 100644
index 0000000..aee4e3b
--- /dev/null
+++ b/src/it/projects/MJAVADOC-427/invoker.properties
@@ -0,0 +1,21 @@
+# 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=clean javadoc:javadoc
+
+# slf4j javadoc is hosted on https site with a "let's encrypt" certificate, signed by IdenTrust only trusted since 8u101 (JDK-8154757)
+invoker.java.version = 1.8.0.101+
diff --git a/src/it/projects/MJAVADOC-427/pom.xml b/src/it/projects/MJAVADOC-427/pom.xml
new file mode 100644
index 0000000..bf7a406
--- /dev/null
+++ b/src/it/projects/MJAVADOC-427/pom.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.
+-->
+
+<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>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId>
+  <artifactId>mjavadoc-427</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-427</url>
+  <description>Tests that the plugin follows redirects</description>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <!-- url of slf4j api is http, and javadoc is redirected to https -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.7.12</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@pom.version@</version>
+          <configuration>
+            <detectLinks>true</detectLinks>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-427/src/main/java/mjavadoc427/App.java
similarity index 79%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-427/src/main/java/mjavadoc427/App.java
index 53480de..75194f3 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-427/src/main/java/mjavadoc427/App.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package mjavadoc427;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,17 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+import org.slf4j.LoggerFactory;
+
+/**
+ * Link to slf4j {@link LoggerFactory}.
+ */
+public class App
+{
+
+    public LoggerFactory getLoggerFactory()
+    {
+        return null;
+    }
 
 }
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-427/verify.groovy
similarity index 67%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-427/verify.groovy
index 53480de..035c4d6 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-427/verify.groovy
@@ -1,5 +1,3 @@
-package com.foo.bar.internal;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -8,9 +6,9 @@
  * 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
@@ -19,7 +17,10 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+def file = new File( basedir, 'target/site/apidocs/mjavadoc427/App.html' );
 
-}
+assert file.exists()
+
+// assert that javadoc of class correctly contains link, just like method details
+assert file.text =~ /Link to slf4j <a href=".*?".*?><code>LoggerFactory<\/code><\/a>/
+assert file.text =~ /<pre[^<]*>public.*?<a href=".*?".*?>LoggerFactory<\/a>.*?getLoggerFactory.*?\(\)<\/pre>/
diff --git a/src/it/projects/MJAVADOC-434_fixcompile/invoker.properties b/src/it/projects/MJAVADOC-434_fixcompile/invoker.properties
new file mode 100644
index 0000000..52b0251
--- /dev/null
+++ b/src/it/projects/MJAVADOC-434_fixcompile/invoker.properties
@@ -0,0 +1,18 @@
+# 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=javadoc:fix compile
diff --git a/src/it/projects/MJAVADOC-434_fixcompile/pom.xml b/src/it/projects/MJAVADOC-434_fixcompile/pom.xml
new file mode 100644
index 0000000..75f71ba
--- /dev/null
+++ b/src/it/projects/MJAVADOC-434_fixcompile/pom.xml
@@ -0,0 +1,70 @@
+<?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>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId>
+  <artifactId>mjavadoc434</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-434</url>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <detectLinks>true</detectLinks>
+            <force>true</force>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <version>3.2.2.RELEASE</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-webmvc</artifactId>
+      <version>3.2.2.RELEASE</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.7.5</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <scope>provided</scope>
+      <version>2.5</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-434_fixcompile/src/main/java/test/A.java
similarity index 79%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-434_fixcompile/src/main/java/test/A.java
index 53480de..4500e05 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-434_fixcompile/src/main/java/test/A.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package test;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,8 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
+public abstract class A<T> {
+    protected abstract boolean a(String pathinfo);
+    public abstract boolean b(HttpRSSEState state);
+    protected abstract void c(HttpRSSEState state);
 }
diff --git a/src/it/projects/MJAVADOC-434_fixcompile/src/main/java/test/B.java b/src/it/projects/MJAVADOC-434_fixcompile/src/main/java/test/B.java
new file mode 100644
index 0000000..c3c20a8
--- /dev/null
+++ b/src/it/projects/MJAVADOC-434_fixcompile/src/main/java/test/B.java
@@ -0,0 +1,98 @@
+package test;
+
+/*
+ * 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.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@SuppressWarnings("")
+@Component
+/**
+ *
+ */
+public class B
+        extends A<HttpRSSEState> {
+    
+    private static final Logger logger = LoggerFactory.getLogger(
+            B.class);
+
+    protected static final String a = "";
+    protected static final String b = "";
+    protected static final String c ="";
+
+    protected static final String d = "";
+
+    protected List<String> e = Collections.emptyList();
+    private ArrayList<String> f = new ArrayList<String>();
+
+    public static final String g = "";
+    public static final String h = "";
+    public static final String i = "";
+
+    @Override
+    protected boolean a(String pathinfo) {
+        if (true) {
+            return true;
+        }
+        
+        if (true) {
+            return false;
+        }
+        return pathinfo.endsWith("");
+    }
+    
+    @Override
+    /**
+     */
+    public boolean b(HttpRSSEState state) {
+        //
+        return false;
+    }
+
+    @Override
+    protected void c(HttpRSSEState state) {
+        logger.debug("");
+
+        //
+        if (true) {
+            if (logger.isDebugEnabled())
+                logger.debug("");
+            
+
+        } else if (true) {
+            if (logger.isDebugEnabled())
+                logger.debug("");
+
+        }
+    }
+}
diff --git a/src/it/projects/MJAVADOC-434_fixcompile/src/main/java/test/C.java b/src/it/projects/MJAVADOC-434_fixcompile/src/main/java/test/C.java
new file mode 100644
index 0000000..0d58a9f
--- /dev/null
+++ b/src/it/projects/MJAVADOC-434_fixcompile/src/main/java/test/C.java
@@ -0,0 +1,88 @@
+package test;
+
+/*
+ * 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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.servlet.AsyncHandlerInterceptor;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+  * @author aoeu
+ *
+ */
+public class C
+        implements AsyncHandlerInterceptor {
+    
+    protected static final String a = "";
+    protected static final String b = "";
+    protected static final String d = "";
+    protected static final String e = "";
+    
+    private static final Logger logger = LoggerFactory.getLogger(
+            C.class);
+
+    @Override
+    public boolean preHandle(HttpServletRequest request,
+            HttpServletResponse response, Object handler) throws Exception {
+        if (true) {
+            logger.trace("");
+        }
+        return true;
+    }
+    
+    @Override
+    public void postHandle(HttpServletRequest request,
+            HttpServletResponse response, Object handler,
+            ModelAndView modelAndView) throws Exception {
+        //
+        if (true) {
+            logger.debug("");
+        }
+        
+        if (true) {
+            if (true) {
+                logger.debug("");
+            
+            }
+        }
+    }
+    
+    @Override
+    /**
+     * 
+     */
+    public void afterCompletion(HttpServletRequest request, HttpServletResponse response,
+            Object handler, Exception ex) throws Exception {
+        //
+    }
+
+    @Override
+    /**
+     * 
+     */
+    public void afterConcurrentHandlingStarted(HttpServletRequest request,
+            HttpServletResponse response, Object handler) throws Exception {
+        //
+    }
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-434_fixcompile/src/main/java/test/HttpRSSEState.java b/src/it/projects/MJAVADOC-434_fixcompile/src/main/java/test/HttpRSSEState.java
new file mode 100644
index 0000000..8b47ebc
--- /dev/null
+++ b/src/it/projects/MJAVADOC-434_fixcompile/src/main/java/test/HttpRSSEState.java
@@ -0,0 +1,54 @@
+package test;
+
+/*
+ * 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 javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+
+/**
+ * @author asdf
+ *
+ */
+public class HttpRSSEState {
+    HttpServletRequest request = null;
+    HttpServletResponse response = null;
+    HttpSession httpSession = null;
+    
+    public HttpServletRequest getRequest() {
+        return request;
+    }
+    public void setRequest(HttpServletRequest request) {
+        this.request = request;
+    }
+    public HttpServletResponse getResponse() {
+        return response;
+    }
+    public void setResponse(HttpServletResponse response) {
+        this.response = response;
+    }
+    public HttpSession getHttpSession() {
+        return httpSession;
+    }
+    public void setHttpSession(HttpSession httpSession) {
+        this.httpSession = httpSession;
+    }
+}
diff --git a/src/it/projects/MJAVADOC-449_aggr_modulepath/invoker.properties b/src/it/projects/MJAVADOC-449_aggr_modulepath/invoker.properties
new file mode 100644
index 0000000..fb9625f
--- /dev/null
+++ b/src/it/projects/MJAVADOC-449_aggr_modulepath/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=javadoc:aggregate
+
diff --git a/src/it/projects/MJAVADOC-449_aggr_modulepath/modulea/pom.xml b/src/it/projects/MJAVADOC-449_aggr_modulepath/modulea/pom.xml
new file mode 100644
index 0000000..aa6921b
--- /dev/null
+++ b/src/it/projects/MJAVADOC-449_aggr_modulepath/modulea/pom.xml
@@ -0,0 +1,32 @@
+<!-- ~ 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>modulea</groupId>
+  <artifactId>modulea</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.8.0</version>
+        <configuration>
+          <release>9</release>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-449_aggr_modulepath/modulea/src/main/java/com/javamodularity/modulea/HelloWorld.java
similarity index 72%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-449_aggr_modulepath/modulea/src/main/java/com/javamodularity/modulea/HelloWorld.java
index 53480de..26447fc 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-449_aggr_modulepath/modulea/src/main/java/com/javamodularity/modulea/HelloWorld.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package com.javamodularity.modulea;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,19 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+/**
+ * <p>Javadoc aggregation from module a.</p>
+ */
+public class HelloWorld {
 
+  /**
+   * <p>method f does something</p>
+   */
+  public void f() {
+  }
+   
+   public static void main(String... args) {
+      System.out.println("Hello Modular World!");
+   }
+   
 }
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-449_aggr_modulepath/modulea/src/main/java/module-info.java
similarity index 88%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-449_aggr_modulepath/modulea/src/main/java/module-info.java
index 53480de..f716447 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-449_aggr_modulepath/modulea/src/main/java/module-info.java
@@ -1,5 +1,3 @@
-package com.foo.bar.internal;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -8,9 +6,9 @@
  * 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
@@ -19,7 +17,9 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
+/**
+ * <p>modulea does something</p>
+ */ 
+module modulea {
+  exports com.javamodularity.modulea;
 }
diff --git a/src/it/projects/MJAVADOC-449_aggr_modulepath/moduleb/pom.xml b/src/it/projects/MJAVADOC-449_aggr_modulepath/moduleb/pom.xml
new file mode 100644
index 0000000..c4a7557
--- /dev/null
+++ b/src/it/projects/MJAVADOC-449_aggr_modulepath/moduleb/pom.xml
@@ -0,0 +1,32 @@
+<!-- ~ 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>moduleb</groupId>
+  <artifactId>moduleb</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.8.0</version>
+        <configuration>
+          <release>9</release>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-449_aggr_modulepath/moduleb/src/main/java/com/javamodularity/moduleb/HelloWorld.java
similarity index 72%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-449_aggr_modulepath/moduleb/src/main/java/com/javamodularity/moduleb/HelloWorld.java
index 53480de..4d9f4d2 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-449_aggr_modulepath/moduleb/src/main/java/com/javamodularity/moduleb/HelloWorld.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package com.javamodularity.moduleb;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,19 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+/**
+ * <p>Javadoc aggregation from module a.</p>
+ */
+public class HelloWorld {
 
+  /**
+   * <p>method f does something</p>
+   */
+  public void f() {
+  }
+   
+   public static void main(String... args) {
+      System.out.println("Hello Modular World!");
+   }
+   
 }
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-449_aggr_modulepath/moduleb/src/main/java/module-info.java
similarity index 88%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-449_aggr_modulepath/moduleb/src/main/java/module-info.java
index 53480de..bcf2890 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-449_aggr_modulepath/moduleb/src/main/java/module-info.java
@@ -1,5 +1,3 @@
-package com.foo.bar.internal;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -8,9 +6,9 @@
  * 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
@@ -19,7 +17,9 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
+/**
+ * <p>moduleb does something</p>
+ */ 
+module moduleb {
+  exports com.javamodularity.moduleb;
 }
diff --git a/src/it/projects/MJAVADOC-449_aggr_modulepath/pom.xml b/src/it/projects/MJAVADOC-449_aggr_modulepath/pom.xml
new file mode 100644
index 0000000..d77f74d
--- /dev/null
+++ b/src/it/projects/MJAVADOC-449_aggr_modulepath/pom.xml
@@ -0,0 +1,35 @@
+<?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>parent</groupId>
+  <artifactId>parent</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <modules>
+    <module>modulea</module>
+    <module>moduleb</module>
+  </modules>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <version>@project.version@</version>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/MJAVADOC-449_aggr_modulepath/verify.groovy b/src/it/projects/MJAVADOC-449_aggr_modulepath/verify.groovy
new file mode 100644
index 0000000..28fdb1f
--- /dev/null
+++ b/src/it/projects/MJAVADOC-449_aggr_modulepath/verify.groovy
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+ 
+int javaVersion = System.getProperty( "java.specification.version" ) as Integer
+if ( javaVersion >= 11 ) {
+    def index = new File( basedir, 'target/site/apidocs/index.html')
+
+	assert index.text =~ /<a href="modulea\/module-summary\.html">modulea<\/a>/
+	assert index.text =~ /<a href="moduleb\/module-summary\.html">moduleb<\/a>/
+	
+	assert new File( basedir, 'target/site/apidocs/modulea/module-summary.html').exists()
+	assert new File( basedir, 'target/site/apidocs/moduleb/module-summary.html').exists()
+} 
+else {
+    def overview = new File( basedir, 'target/site/apidocs/overview-summary.html')
+
+	assert overview.text =~ /<a href="modulea-summary.html">modulea<\/a>/
+	assert overview.text =~ /<a href="moduleb-summary.html">moduleb<\/a>/
+	
+	assert new File( basedir, 'target/site/apidocs/modulea-summary.html').exists()
+	assert new File( basedir, 'target/site/apidocs/moduleb-summary.html').exists()
+} 
diff --git a/src/it/projects/MJAVADOC-452_fix-duplicateparams/invoker.properties b/src/it/projects/MJAVADOC-452_fix-duplicateparams/invoker.properties
new file mode 100644
index 0000000..2f27cf0
--- /dev/null
+++ b/src/it/projects/MJAVADOC-452_fix-duplicateparams/invoker.properties
@@ -0,0 +1,18 @@
+# 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=javadoc:fix compile javadoc:javadoc
diff --git a/src/it/projects/MJAVADOC-452_fix-duplicateparams/pom.xml b/src/it/projects/MJAVADOC-452_fix-duplicateparams/pom.xml
new file mode 100644
index 0000000..c5e142c
--- /dev/null
+++ b/src/it/projects/MJAVADOC-452_fix-duplicateparams/pom.xml
@@ -0,0 +1,47 @@
+<?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>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId>
+  <artifactId>mjavadoc452</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-452</url>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <force>true</force>
+            <ignoreClirr>true</ignoreClirr>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-452_fix-duplicateparams/src/main/java/com/example/FirstBug.java
similarity index 72%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-452_fix-duplicateparams/src/main/java/com/example/FirstBug.java
index 53480de..b6586cc 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-452_fix-duplicateparams/src/main/java/com/example/FirstBug.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package com.example;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,18 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+/**
+ * <p>FirstBug class.</p>
+ */
+public class FirstBug {
 
-}
+    /**
+     * <p>mymethod.</p>
+     *
+     * @param param first param
+     * @param param copy-paste mistake of first param
+     */
+    public void mymethod( String param, String paramSecond ) {
+        
+    }
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-452_fix-duplicateparams/verify.groovy
similarity index 70%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-452_fix-duplicateparams/verify.groovy
index 53480de..8a9599a 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-452_fix-duplicateparams/verify.groovy
@@ -1,5 +1,3 @@
-package com.foo.bar.internal;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -8,9 +6,9 @@
  * 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
@@ -19,7 +17,10 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+def file = new File( basedir, 'src/main/java/com/example/FirstBug.java' );
 
-}
+assert file.exists()
+
+// having the same @param mentioned twice is allowed, ensure it stays this way.
+assert 1 == file.text.count('* @param param first param')
+assert 1 == file.text.count('* @param param copy-paste mistake of first param')
diff --git a/src/it/projects/MJAVADOC-495_offline-filescheme/invoker.properties b/src/it/projects/MJAVADOC-495_offline-filescheme/invoker.properties
new file mode 100644
index 0000000..660868e
--- /dev/null
+++ b/src/it/projects/MJAVADOC-495_offline-filescheme/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.1=clean javadoc:javadoc
+invoker.goals.2=clean javadoc:javadoc -o
diff --git a/src/it/projects/MJAVADOC-495_offline-filescheme/package-list b/src/it/projects/MJAVADOC-495_offline-filescheme/package-list
new file mode 100644
index 0000000..6b0ba6f
--- /dev/null
+++ b/src/it/projects/MJAVADOC-495_offline-filescheme/package-list
@@ -0,0 +1 @@
+com.baz
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-495_offline-filescheme/pom.xml b/src/it/projects/MJAVADOC-495_offline-filescheme/pom.xml
new file mode 100644
index 0000000..33e8d3a
--- /dev/null
+++ b/src/it/projects/MJAVADOC-495_offline-filescheme/pom.xml
@@ -0,0 +1,50 @@
+<?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>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId>
+  <artifactId>mjavadoc-495</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <links>
+              <link>${project.baseUri}</link>
+            </links>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-495_offline-filescheme/src/main/java/foo/Bar.java
similarity index 91%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-495_offline-filescheme/src/main/java/foo/Bar.java
index 53480de..05e463e 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-495_offline-filescheme/src/main/java/foo/Bar.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package foo;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,7 +19,5 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
+public class Bar {
 }
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-495_offline-filescheme/verify.groovy
similarity index 67%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-495_offline-filescheme/verify.groovy
index 53480de..ce90596 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-495_offline-filescheme/verify.groovy
@@ -1,5 +1,3 @@
-package com.foo.bar.internal;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -8,9 +6,9 @@
  * 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
@@ -18,8 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+ 
+assert new File( basedir, 'target/site/apidocs/options').readLines()
+                                                        .dropWhile{ it != '-link'}
+                                                        .drop(1)
+                                                        .first()
+                                                        .startsWith( "'file:/" )
 
-/** Not API */
-public class NotApi {
-
-}
diff --git a/src/it/projects/MJAVADOC-497/pom.xml b/src/it/projects/MJAVADOC-497/pom.xml
index 9b89c69..c664cd7 100644
--- a/src/it/projects/MJAVADOC-497/pom.xml
+++ b/src/it/projects/MJAVADOC-497/pom.xml
@@ -46,7 +46,7 @@
           <version>@pom.version@</version>
           <configuration>
             <subpackages>com.example.foo</subpackages>
-            <excludePackageNames>*.impl.*</excludePackageNames>
+            <excludePackageNames>**.impl</excludePackageNames>
           </configuration>
         </plugin>
       </plugins>
diff --git a/src/it/projects/MJAVADOC-497/verify.bsh b/src/it/projects/MJAVADOC-497/verify.bsh
index 8f23e77..d90f357 100644
--- a/src/it/projects/MJAVADOC-497/verify.bsh
+++ b/src/it/projects/MJAVADOC-497/verify.bsh
@@ -21,14 +21,25 @@
 

 try

 {

-    File packageList = new File( basedir, "target/site/apidocs/package-list" );

-    if ( !packageList.exists() )

+	File list;

+	 

+	String javaVersion = System.getProperty( "java.specification.version" );

+	if ( javaVersion.startsWith( "1." ) || javaVersion.equals( "9" ) )

+	{

+	    list = new File( basedir, "target/site/apidocs/package-list" );

+	}

+	else

+	{

+		list = new File( basedir, "target/site/apidocs/element-list" );

+	}

+	

+    if ( !list.exists() )

     {

         System.err.println( packageList + " is missing" );

         return false;

     }

 

-    FileReader fr = new FileReader( packageList );

+    FileReader fr = new FileReader( list );

     BufferedReader br = new BufferedReader( fr );

     String line = br.readLine();

     if ( !"com.example.foo".equals( line ) || br.readLine() != null )

diff --git a/src/it/projects/MJAVADOC-506_excl-module-info/pom.xml b/src/it/projects/MJAVADOC-506_excl-module-info/pom.xml
new file mode 100644
index 0000000..b2472ae
--- /dev/null
+++ b/src/it/projects/MJAVADOC-506_excl-module-info/pom.xml
@@ -0,0 +1,76 @@
+<?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>mjavadoc506</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-506</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+      <version>3.6</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.8.0</version>
+        <configuration>
+          <excludes>
+            <exclude>module-info.java</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>jar</goal> 
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <sourceFileExcludes>
+            <exclude>module-info.java</exclude> 
+          </sourceFileExcludes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-506_excl-module-info/src/main/java/com/foo/MyClass.java
similarity index 91%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-506_excl-module-info/src/main/java/com/foo/MyClass.java
index 53480de..7370ac0 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-506_excl-module-info/src/main/java/com/foo/MyClass.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package com.foo;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,7 +19,7 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+public class MyClass
+{
 
 }
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-506_excl-module-info/src/main/java/module-info.java
similarity index 91%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-506_excl-module-info/src/main/java/module-info.java
index 53480de..45f7f3d 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-506_excl-module-info/src/main/java/module-info.java
@@ -1,5 +1,3 @@
-package com.foo.bar.internal;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -19,7 +17,6 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
-}
+module M.N {
+    requires org.apache.commons.lang3;
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-506_excl-module-info/verify.groovy
similarity index 73%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-506_excl-module-info/verify.groovy
index 53480de..3a870ed 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-506_excl-module-info/verify.groovy
@@ -1,5 +1,3 @@
-package com.foo.bar.internal;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -8,9 +6,9 @@
  * 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
@@ -18,8 +16,12 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+ 
+def javaVersion = System.getProperty( "java.specification.version" )
+if ( javaVersion =~ /(1\..+)|9|10/ ) {
+  assert new File( basedir, 'target/apidocs/com/foo/MyClass.html').exists()
+} else {
+  assert new File( basedir, 'target/apidocs/M.N/com/foo/MyClass.html').exists()
+} 
 
-/** Not API */
-public class NotApi {
 
-}
diff --git a/src/it/projects/MJAVADOC-514_3rdparty-doclettags/invoker.properties b/src/it/projects/MJAVADOC-514_3rdparty-doclettags/invoker.properties
new file mode 100644
index 0000000..22c9049
--- /dev/null
+++ b/src/it/projects/MJAVADOC-514_3rdparty-doclettags/invoker.properties
@@ -0,0 +1,18 @@
+# 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=clean javadoc:javadoc
diff --git a/src/it/projects/MJAVADOC-514_3rdparty-doclettags/pom.xml b/src/it/projects/MJAVADOC-514_3rdparty-doclettags/pom.xml
new file mode 100644
index 0000000..65bacad
--- /dev/null
+++ b/src/it/projects/MJAVADOC-514_3rdparty-doclettags/pom.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<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>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId>
+  <artifactId>mjavadoc-514</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-514</url>
+
+  <repositories>
+    <repository>
+      <id>local.private</id>
+      <url>@mrm.3rdparty.url@</url>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+  
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <useStandardDocletOptions>false</useStandardDocletOptions>
+            <docletArtifacts>
+              <artifact>
+                <groupId>org.apache.maven.plugins.javadoc.its</groupId>
+                <artifactId>doclet</artifactId>
+                <version>1.0</version>
+              </artifact>
+            </docletArtifacts>
+            <doclet>org.apache.maven.plugins.javadoc.its.Doclet</doclet>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-514_3rdparty-doclettags/src/main/java/foo/bar/ALotOfLinkTags.java
similarity index 88%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-514_3rdparty-doclettags/src/main/java/foo/bar/ALotOfLinkTags.java
index 53480de..16954e8 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-514_3rdparty-doclettags/src/main/java/foo/bar/ALotOfLinkTags.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package foo.bar;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,7 +19,11 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
+/**
+ * 
+ * @author Robert Scholte
+ * @since 3.0.2
+ */
+public class ALotOfLinkTags
+{
 }
diff --git a/src/it/projects/MJAVADOC-526_aggr-managedDeps/invoker.properties b/src/it/projects/MJAVADOC-526_aggr-managedDeps/invoker.properties
new file mode 100644
index 0000000..fd7d8ec
--- /dev/null
+++ b/src/it/projects/MJAVADOC-526_aggr-managedDeps/invoker.properties
@@ -0,0 +1,18 @@
+# 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=javadoc:aggregate
diff --git a/src/it/projects/MJAVADOC-526_aggr-managedDeps/javadoc-child/pom.xml b/src/it/projects/MJAVADOC-526_aggr-managedDeps/javadoc-child/pom.xml
new file mode 100644
index 0000000..7016415
--- /dev/null
+++ b/src/it/projects/MJAVADOC-526_aggr-managedDeps/javadoc-child/pom.xml
@@ -0,0 +1,54 @@
+<?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>com.leokom</groupId>
+    <artifactId>javadoc-parent</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+  </parent>
+  
+  <artifactId>javadoc-child</artifactId>
+
+  <dependencies>
+	<dependency>
+	    <groupId>org.springframework.security</groupId>
+	    <artifactId>spring-security-acl</artifactId>
+	    <version>2.0.4</version>
+	    <scope>runtime</scope>
+	</dependency>
+  </dependencies>
+  
+  <dependencyManagement>
+  	<dependencies>
+  		<dependency>
+  			<groupId>org.springframework.security</groupId>
+  			<artifactId>spring-security-core</artifactId>
+  			<version>2.0.4</version>
+  			<!-- Overriding the runtime scope -->
+  			<scope>compile</scope>
+  		</dependency>
+  	</dependencies>
+  </dependencyManagement>
+</project>
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-526_aggr-managedDeps/javadoc-child/src/main/java/com/leokom/javadoc/JavadocMavenBugDemo.java
similarity index 73%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-526_aggr-managedDeps/javadoc-child/src/main/java/com/leokom/javadoc/JavadocMavenBugDemo.java
index 53480de..cccdbd5 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-526_aggr-managedDeps/javadoc-child/src/main/java/com/leokom/javadoc/JavadocMavenBugDemo.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package com.leokom.javadoc;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,7 +19,14 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+import org.springframework.security.BadCredentialsException;
 
+public class JavadocMavenBugDemo {
+	/**
+	 * @throws BadCredentialsException
+	 * @param args unused
+	 */
+	public static void main(String[] args) {
+		throw new BadCredentialsException("Demo");
+	}
 }
diff --git a/src/it/projects/MJAVADOC-526_aggr-managedDeps/pom.xml b/src/it/projects/MJAVADOC-526_aggr-managedDeps/pom.xml
new file mode 100644
index 0000000..e44f89f
--- /dev/null
+++ b/src/it/projects/MJAVADOC-526_aggr-managedDeps/pom.xml
@@ -0,0 +1,48 @@
+<?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>com.leokom</groupId>
+  <artifactId>javadoc-parent</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-526</url>
+  
+  <build>
+  	<pluginManagement>
+  		<plugins>
+  			<plugin>
+  				<groupId>org.apache.maven.plugins</groupId>
+  				<artifactId>maven-javadoc-plugin</artifactId>
+  				<version>@project.version@</version>
+  			</plugin>
+  		</plugins>
+  	</pluginManagement>
+  </build>
+
+  <modules>
+    <module>javadoc-child</module>
+  </modules>
+</project>
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-528/invoker.properties b/src/it/projects/MJAVADOC-528/invoker.properties
new file mode 100644
index 0000000..a4e250d
--- /dev/null
+++ b/src/it/projects/MJAVADOC-528/invoker.properties
@@ -0,0 +1,18 @@
+# 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=clean javadoc:javadoc

diff --git a/src/it/projects/MJAVADOC-528/pom.xml b/src/it/projects/MJAVADOC-528/pom.xml
new file mode 100644
index 0000000..6ee3712
--- /dev/null
+++ b/src/it/projects/MJAVADOC-528/pom.xml
@@ -0,0 +1,55 @@
+<?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>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId>

+  <artifactId>mjavadoc-528</artifactId>

+  <version>1.0-SNAPSHOT</version>

+

+  <properties>

+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

+  </properties>

+

+  <build>

+    <pluginManagement>

+      <plugins>

+        <plugin>

+          <groupId>org.apache.maven.plugins</groupId>

+          <artifactId>maven-javadoc-plugin</artifactId>

+          <version>@pom.version@</version>

+          <configuration>

+            <detectLinks>true</detectLinks>

+          </configuration>

+        </plugin>

+      </plugins>

+    </pluginManagement>

+  </build>

+

+  <dependencies>

+    <dependency>

+      <groupId>com.google.code.gson</groupId>

+      <artifactId>gson</artifactId>

+      <version>2.5</version>

+    </dependency>

+  </dependencies>

+</project>

diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-528/src/main/java/foo/bar/MyClass.java
similarity index 91%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-528/src/main/java/foo/bar/MyClass.java
index 53480de..e5960e3 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-528/src/main/java/foo/bar/MyClass.java
@@ -1,25 +1,24 @@
-package com.foo.bar.internal;
-
-/*
- * 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.
- */
-
-/** Not API */
-public class NotApi {
-
-}
+package foo.bar;

+

+/*

+ * 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 class MyClass

+{

+}

diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-528/verify.groovy
similarity index 84%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-528/verify.groovy
index 53480de..66dfbd1 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-528/verify.groovy
@@ -1,25 +1,21 @@
-package com.foo.bar.internal;
-
-/*
- * 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.
- */
-
-/** Not API */
-public class NotApi {
-
-}
+/*

+ * 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.

+ */

+

+File log = new File( basedir, 'build.log' )

+assert !( log.text =~ /.*Invalid cookie header:[^\r\n]+\. Invalid 'expires' attribute:.*/ )

diff --git a/src/it/projects/MJAVADOC-538/invoker.properties b/src/it/projects/MJAVADOC-538/invoker.properties
new file mode 100644
index 0000000..a4e250d
--- /dev/null
+++ b/src/it/projects/MJAVADOC-538/invoker.properties
@@ -0,0 +1,18 @@
+# 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=clean javadoc:javadoc

diff --git a/src/it/projects/MJAVADOC-538/pom.xml b/src/it/projects/MJAVADOC-538/pom.xml
new file mode 100644
index 0000000..ecac918
--- /dev/null
+++ b/src/it/projects/MJAVADOC-538/pom.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>

+

+<!--

+  Licensed to the Apache Software Foundation (ASF) under one

+  or more contributor license agreements.  See the NOTICE file

+  distributed with this work for additional information

+  regarding copyright ownership.  The ASF licenses this file

+  to you under the Apache License, Version 2.0 (the

+  "License"); you may not use this file except in compliance

+  with the License.  You may obtain a copy of the License at

+

+  http://www.apache.org/licenses/LICENSE-2.0

+

+  Unless required by applicable law or agreed to in writing,

+  software distributed under the License is distributed on an

+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+  KIND, either express or implied.  See the License for the

+  specific language governing permissions and limitations

+  under the License.

+-->

+

+<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>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId>

+  <artifactId>mjavadoc-538</artifactId>

+  <version>1.0-SNAPSHOT</version>

+  <url>https://issues.apache.org/jira/browse/MJAVADOC-538</url>

+

+  <properties>

+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

+  </properties>

+

+  <build>

+    <pluginManagement>

+      <plugins>

+        <plugin>

+          <groupId>org.apache.maven.plugins</groupId>

+          <artifactId>maven-javadoc-plugin</artifactId>

+          <version>@project.version@</version>

+          <configuration>

+            <failOnWarnings>true</failOnWarnings>

+          </configuration>

+        </plugin>

+      </plugins>

+    </pluginManagement>

+  </build>

+

+  <profiles>

+    <profile>

+      <activation>

+        <jdk>10</jdk>

+      </activation>

+      <build>

+        <pluginManagement>

+          <plugins>

+            <plugin>

+              <groupId>org.apache.maven.plugins</groupId>

+              <artifactId>maven-javadoc-plugin</artifactId>

+              <configuration>

+                <additionalOptions>

+                  <option>-html4</option>

+                </additionalOptions>

+              </configuration>

+            </plugin>

+          </plugins>

+        </pluginManagement>

+      </build>

+    </profile>

+  </profiles>

+</project>

diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-538/src/main/java/foo/bar/MyClass.java
similarity index 91%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-538/src/main/java/foo/bar/MyClass.java
index 53480de..e5960e3 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-538/src/main/java/foo/bar/MyClass.java
@@ -1,25 +1,24 @@
-package com.foo.bar.internal;
-
-/*
- * 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.
- */
-
-/** Not API */
-public class NotApi {
-
-}
+package foo.bar;

+

+/*

+ * 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 class MyClass

+{

+}

diff --git a/src/it/projects/MJAVADOC-551 spaces/invoker.properties b/src/it/projects/MJAVADOC-551 spaces/invoker.properties
new file mode 100644
index 0000000..e02dbac
--- /dev/null
+++ b/src/it/projects/MJAVADOC-551 spaces/invoker.properties
@@ -0,0 +1,18 @@
+# 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=javadoc:fix
diff --git a/src/it/projects/MJAVADOC-551 spaces/pom.xml b/src/it/projects/MJAVADOC-551 spaces/pom.xml
new file mode 100644
index 0000000..6270acf
--- /dev/null
+++ b/src/it/projects/MJAVADOC-551 spaces/pom.xml
@@ -0,0 +1,48 @@
+<?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>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId>
+  <artifactId>MJAVADOC-551</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-551</url>
+  
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <force>true</force>
+            <ignoreClirr>true</ignoreClirr>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>
diff --git a/src/it/projects/MJAVADOC-551 spaces/src/main/java/fix/test/App.java b/src/it/projects/MJAVADOC-551 spaces/src/main/java/fix/test/App.java
new file mode 100644
index 0000000..ee6f1f9
--- /dev/null
+++ b/src/it/projects/MJAVADOC-551 spaces/src/main/java/fix/test/App.java
@@ -0,0 +1,46 @@
+package fix.test;
+
+/*
+ * 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.
+ */
+
+/**
+ * App class
+ *
+ * @generatorClass toto
+ * @todo review it
+ * @version 1.0
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ */
+public class App
+{
+    /**
+     * The main method
+     *
+     * @param args  an array of strings that contains the arguments
+     */
+    public static void main( String[] args )
+    {
+        System.out.println( "Sample Application." );
+    }
+
+    protected void sampleMethod( String str )
+    {
+        System.out.println( str );
+    }
+}
diff --git a/src/it/projects/MJAVADOC-552_fix-author/invoker.properties b/src/it/projects/MJAVADOC-552_fix-author/invoker.properties
new file mode 100644
index 0000000..2f27cf0
--- /dev/null
+++ b/src/it/projects/MJAVADOC-552_fix-author/invoker.properties
@@ -0,0 +1,18 @@
+# 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=javadoc:fix compile javadoc:javadoc
diff --git a/src/it/projects/MJAVADOC-552_fix-author/pom.xml b/src/it/projects/MJAVADOC-552_fix-author/pom.xml
new file mode 100644
index 0000000..d8e2f31
--- /dev/null
+++ b/src/it/projects/MJAVADOC-552_fix-author/pom.xml
@@ -0,0 +1,47 @@
+<?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>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId>
+  <artifactId>mjavadoc552</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-552</url>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <force>true</force>
+            <ignoreClirr>true</ignoreClirr>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+  
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-552_fix-author/src/main/java/com/example/FirstBug.java
similarity index 77%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-552_fix-author/src/main/java/com/example/FirstBug.java
index 53480de..f498e05 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-552_fix-author/src/main/java/com/example/FirstBug.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package com.example;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,16 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+/**
+ * Class developed by several authors.
+ * 
+ * @author Developer, One
+ * @author Developer, Two
+ * @author Developer, Three
+ * @version 1.0.9, 2018-12-19
+ * @since 0.0.1
+ */
+public class FirstBug 
+{
 
-}
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-552_fix-author/verify.groovy
similarity index 74%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-552_fix-author/verify.groovy
index 53480de..095553a 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-552_fix-author/verify.groovy
@@ -1,5 +1,3 @@
-package com.foo.bar.internal;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -8,9 +6,9 @@
  * 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
@@ -19,7 +17,10 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+def file = new File( basedir, 'src/main/java/com/example/FirstBug.java' );
 
-}
+assert file.exists()
+
+assert 1 == file.text.count('* @author Developer, One')
+assert 1 == file.text.count('* @author Developer, Two')
+assert 1 == file.text.count('* @author Developer, Three')
diff --git a/src/it/projects/MJAVADOC-555_aggr_mixed/invoker.properties b/src/it/projects/MJAVADOC-555_aggr_mixed/invoker.properties
new file mode 100644
index 0000000..768d035
--- /dev/null
+++ b/src/it/projects/MJAVADOC-555_aggr_mixed/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:aggregate
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-555_aggr_mixed/module1/pom.xml b/src/it/projects/MJAVADOC-555_aggr_mixed/module1/pom.xml
new file mode 100644
index 0000000..288012b
--- /dev/null
+++ b/src/it/projects/MJAVADOC-555_aggr_mixed/module1/pom.xml
@@ -0,0 +1,32 @@
+<?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>javadoc-maven-report-exception</artifactId>
+		<groupId>testcase</groupId>
+		<version>1.0-SNAPSHOT</version>
+	</parent>
+	<artifactId>module1</artifactId>
+</project>
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-555_aggr_mixed/module1/src/main/java/module-info.java
similarity index 90%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-555_aggr_mixed/module1/src/main/java/module-info.java
index 53480de..0dd7ad2 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-555_aggr_mixed/module1/src/main/java/module-info.java
@@ -1,5 +1,3 @@
-package com.foo.bar.internal;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -8,9 +6,9 @@
  * 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
@@ -19,7 +17,7 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
-}
+module module1
+{
+	exports module1;
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-555_aggr_mixed/module1/src/main/java/module1/Main.java
similarity index 90%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-555_aggr_mixed/module1/src/main/java/module1/Main.java
index 53480de..e60dbdb 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-555_aggr_mixed/module1/src/main/java/module1/Main.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package module1;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,6 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
+public final class Main
+{
 }
diff --git a/src/it/projects/MJAVADOC-555_aggr_mixed/module2/pom.xml b/src/it/projects/MJAVADOC-555_aggr_mixed/module2/pom.xml
new file mode 100644
index 0000000..bc44c23
--- /dev/null
+++ b/src/it/projects/MJAVADOC-555_aggr_mixed/module2/pom.xml
@@ -0,0 +1,52 @@
+<?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>javadoc-maven-report-exception</artifactId>
+    <groupId>testcase</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>module2</artifactId>
+  
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-jar-plugin</artifactId>
+          <version>2.3.2</version>
+          <configuration>
+            <archive>
+              <manifestEntries>
+                <Automatic-Module-Name>module2</Automatic-Module-Name>
+              </manifestEntries>
+            </archive>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-555_aggr_mixed/module2/src/main/java/module2/Main.java
similarity index 90%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-555_aggr_mixed/module2/src/main/java/module2/Main.java
index 53480de..b864f0e 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-555_aggr_mixed/module2/src/main/java/module2/Main.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package module2;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,6 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
+public final class Main
+{
 }
diff --git a/src/it/projects/MJAVADOC-555_aggr_mixed/pom.xml b/src/it/projects/MJAVADOC-555_aggr_mixed/pom.xml
new file mode 100644
index 0000000..c881914
--- /dev/null
+++ b/src/it/projects/MJAVADOC-555_aggr_mixed/pom.xml
@@ -0,0 +1,69 @@
+<?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>
+
+  <artifactId>javadoc-maven-report-exception</artifactId>
+  <groupId>testcase</groupId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-555</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <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>
+        <executions>
+          <execution>
+            <id>aggregate</id>
+            <goals>
+              <goal>aggregate</goal>
+            </goals>
+            <phase>site</phase>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <modules>
+    <module>module1</module>
+    <module>module2</module>
+  </modules>
+
+</project>
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-555_aggr_mixed/verify.groovy b/src/it/projects/MJAVADOC-555_aggr_mixed/verify.groovy
new file mode 100644
index 0000000..e75b96c
--- /dev/null
+++ b/src/it/projects/MJAVADOC-555_aggr_mixed/verify.groovy
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+ 
+int javaVersion = System.getProperty( "java.specification.version" ) as Integer
+if ( javaVersion >= 11 ) {
+    def index = new File( basedir, 'target/site/apidocs/index.html')
+
+	assert index.text =~ /<a href="module1\/module-summary\.html">module1<\/a>/
+	assert index.text =~ /<a href="module2\/module-summary\.html">module2<\/a>/
+	
+	assert new File( basedir, 'target/site/apidocs/module1/module-summary.html').exists()
+	assert new File( basedir, 'target/site/apidocs/module2/module-summary.html').exists()
+} 
+else {
+    def overview = new File( basedir, 'target/site/apidocs/overview-summary.html')
+
+	assert overview.text =~ /<a href="module1-summary.html">module1<\/a>/
+	assert overview.text =~ /<a href="module2-summary.html">module2<\/a>/
+	
+	assert new File( basedir, 'target/site/apidocs/module1-summary.html').exists()
+	assert new File( basedir, 'target/site/apidocs/module2-summary.html').exists()
+} 
diff --git a/src/it/projects/MJAVADOC-555_link-automatic-modules/invoker.properties b/src/it/projects/MJAVADOC-555_link-automatic-modules/invoker.properties
new file mode 100644
index 0000000..d47ff2a
--- /dev/null
+++ b/src/it/projects/MJAVADOC-555_link-automatic-modules/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
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-555_link-automatic-modules/pom.xml b/src/it/projects/MJAVADOC-555_link-automatic-modules/pom.xml
new file mode 100644
index 0000000..6c5522c
--- /dev/null
+++ b/src/it/projects/MJAVADOC-555_link-automatic-modules/pom.xml
@@ -0,0 +1,75 @@
+<?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>javadoc-cannot-link-to-automatic-modules</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-555</url>
+  
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <guava.version>27.0.1-jre</guava.version>
+  </properties>
+
+  <build>
+    <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>
+        <executions>
+          <execution>
+            <id>attach-javadocs</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+            <configuration>
+              <links>
+                <link>https://google.github.io/guava/releases/${guava.version}/api/docs/</link>
+              </links>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>${guava.version}</version>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-555_link-automatic-modules/src/main/java/com/testcase/Testcase.java
similarity index 83%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-555_link-automatic-modules/src/main/java/com/testcase/Testcase.java
index 53480de..0dedddd 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-555_link-automatic-modules/src/main/java/com/testcase/Testcase.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package com.testcase;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,12 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+import com.google.common.collect.Multimap;
 
+public class Testcase
+{
+	public Multimap<String, String> test()
+	{
+		return null;
+	}
 }
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-555_link-automatic-modules/src/main/java/module-info.java
similarity index 90%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-555_link-automatic-modules/src/main/java/module-info.java
index 53480de..05a60d9 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-555_link-automatic-modules/src/main/java/module-info.java
@@ -1,5 +1,3 @@
-package com.foo.bar.internal;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -8,9 +6,9 @@
  * 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
@@ -18,8 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
-/** Not API */
-public class NotApi {
-
-}
+module jul_to_slf4j
+{
+	requires com.google.common;
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-555_link-automatic-modules/verify.groovy b/src/it/projects/MJAVADOC-555_link-automatic-modules/verify.groovy
new file mode 100644
index 0000000..df3df50
--- /dev/null
+++ b/src/it/projects/MJAVADOC-555_link-automatic-modules/verify.groovy
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+def classFile 
+int javaVersion = System.getProperty( "java.specification.version" ) as Integer
+if ( javaVersion >= 11 ) {
+ classFile = new File( basedir, 'target/apidocs/jul_to_slf4j/com/testcase/Testcase.html')
+} else {
+ classFile = new File( basedir, 'target/apidocs/com/testcase/Testcase.html')
+}
+
+def p = /<a href="([^"]+)"(?:[^>]+)>Multimap<\/a>/
+
+def m = classFile.text =~ p
+
+assert m.hasGroup()
+assert m[0][1] == "https://google.github.io/guava/releases/27.0.1-jre/api/docs/com/google/common/collect/Multimap.html?is-external=true" 
diff --git a/src/it/projects/MJAVADOC-556_hide-non-exported-packages/invoker.properties b/src/it/projects/MJAVADOC-556_hide-non-exported-packages/invoker.properties
new file mode 100644
index 0000000..81ca246
--- /dev/null
+++ b/src/it/projects/MJAVADOC-556_hide-non-exported-packages/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=javadoc:aggregate
diff --git a/src/it/projects/MJAVADOC-556_hide-non-exported-packages/module/pom.xml b/src/it/projects/MJAVADOC-556_hide-non-exported-packages/module/pom.xml
new file mode 100644
index 0000000..5435eea
--- /dev/null
+++ b/src/it/projects/MJAVADOC-556_hide-non-exported-packages/module/pom.xml
@@ -0,0 +1,43 @@
+<?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">
+    <parent>
+        <groupId>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId>
+        <artifactId>MJAVADOC-556</artifactId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>module</artifactId>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.8.0</version>
+                <configuration>
+                    <release>9</release>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-556_hide-non-exported-packages/module/src/main/java/module-info.java
similarity index 85%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-556_hide-non-exported-packages/module/src/main/java/module-info.java
index 53480de..ccb7c17 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-556_hide-non-exported-packages/module/src/main/java/module-info.java
@@ -1,5 +1,3 @@
-package com.foo.bar.internal;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -8,9 +6,9 @@
  * 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
- * 
+ *
+ *  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
@@ -19,7 +17,7 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
-}
+module module
+{
+    exports package1;
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-556_hide-non-exported-packages/module/src/main/java/package1/Main1.java
similarity index 85%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-556_hide-non-exported-packages/module/src/main/java/package1/Main1.java
index 53480de..f380ab9 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-556_hide-non-exported-packages/module/src/main/java/package1/Main1.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package package1;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
- * 
+ *
+ *  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
@@ -19,7 +19,6 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
+public final class Main1
+{
 }
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-556_hide-non-exported-packages/module/src/main/java/package2/Main2.java
similarity index 85%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-556_hide-non-exported-packages/module/src/main/java/package2/Main2.java
index 53480de..22de4c5 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-556_hide-non-exported-packages/module/src/main/java/package2/Main2.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package package2;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
- * 
+ *
+ *  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
@@ -19,7 +19,6 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
-
+public final class Main2
+{
 }
diff --git a/src/it/projects/MJAVADOC-556_hide-non-exported-packages/pom.xml b/src/it/projects/MJAVADOC-556_hide-non-exported-packages/pom.xml
new file mode 100644
index 0000000..7a12e5f
--- /dev/null
+++ b/src/it/projects/MJAVADOC-556_hide-non-exported-packages/pom.xml
@@ -0,0 +1,49 @@
+<?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>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId>
+    <artifactId>MJAVADOC-556</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <url>https://issues.apache.org/jira/browse/MJAVADOC-556</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-javadoc-plugin</artifactId>
+                    <version>@project.version@</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+    <modules>
+        <module>module</module>
+    </modules>
+</project>
diff --git a/src/it/projects/MJAVADOC-558_fix-unknownthrows/invoker.properties b/src/it/projects/MJAVADOC-558_fix-unknownthrows/invoker.properties
new file mode 100644
index 0000000..2f27cf0
--- /dev/null
+++ b/src/it/projects/MJAVADOC-558_fix-unknownthrows/invoker.properties
@@ -0,0 +1,18 @@
+# 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=javadoc:fix compile javadoc:javadoc
diff --git a/src/it/projects/MJAVADOC-558_fix-unknownthrows/pom.xml b/src/it/projects/MJAVADOC-558_fix-unknownthrows/pom.xml
new file mode 100644
index 0000000..c05ea6f
--- /dev/null
+++ b/src/it/projects/MJAVADOC-558_fix-unknownthrows/pom.xml
@@ -0,0 +1,47 @@
+<?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>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId>
+  <artifactId>mjavadoc558</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-558</url>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <force>true</force>
+            <ignoreClirr>true</ignoreClirr>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+  
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-558_fix-unknownthrows/src/main/java/com/example/FirstBug.java
similarity index 70%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-558_fix-unknownthrows/src/main/java/com/example/FirstBug.java
index 53480de..f0f0a79 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-558_fix-unknownthrows/src/main/java/com/example/FirstBug.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package com.example;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
@@ -19,7 +19,18 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+/**
+ * <p>FirstBug class.</p>
+ */
+public class FirstBug {
 
-}
+    /**
+     * <p>mymethod.</p>
+     *
+     * @throws IllegalArgumentException how could this happen?
+     * @throws UnknownException some internal runtime exception
+     */
+    public void mymethod() throws IllegalArgumentException {
+        
+    }
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-558_fix-unknownthrows/verify.groovy
similarity index 69%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-558_fix-unknownthrows/verify.groovy
index 53480de..dcdfddc 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-558_fix-unknownthrows/verify.groovy
@@ -1,5 +1,3 @@
-package com.foo.bar.internal;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -8,9 +6,9 @@
  * 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
@@ -19,7 +17,10 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+def file = new File( basedir, 'src/main/java/com/example/FirstBug.java' );
 
-}
+assert file.exists()
+
+assert 1 == file.text.count('* @throws java.lang.IllegalArgumentException how could this happen?')
+// Java 8 javadoc tool will fail due to unknown reference
+assert 0 == file.text.count('@throws UnknownException some internal runtime exception')
diff --git a/src/it/projects/MJAVADOC-562_release/invoker.properties b/src/it/projects/MJAVADOC-562_release/invoker.properties
new file mode 100644
index 0000000..9511718
--- /dev/null
+++ b/src/it/projects/MJAVADOC-562_release/invoker.properties
@@ -0,0 +1,18 @@
+# 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+
diff --git a/src/it/projects/MJAVADOC-562_release/pom.xml b/src/it/projects/MJAVADOC-562_release/pom.xml
new file mode 100644
index 0000000..7ea691c
--- /dev/null
+++ b/src/it/projects/MJAVADOC-562_release/pom.xml
@@ -0,0 +1,59 @@
+<?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>mjavadoc562</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <url>https://issues.apache.org/jira/browse/MJAVADOC-562</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <maven.compiler.release>9</maven.compiler.release>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.8.0</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/it/projects/MJAVADOC-562_release/src/main/java/com/foo/MyClass.java
similarity index 81%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/it/projects/MJAVADOC-562_release/src/main/java/com/foo/MyClass.java
index 53480de..5b31c66 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/it/projects/MJAVADOC-562_release/src/main/java/com/foo/MyClass.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package com.foo;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,7 +19,12 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+import java.util.Arrays;
 
+public class MyClass
+{
+    public static void main( String[] args )
+    {
+        Arrays.stream( args ).forEach( System.out::println );
+    }
 }
diff --git a/src/it/projects/dependencySource-2/MJAVADOC-280-2-projects/pom.xml b/src/it/projects/dependencySource-2/MJAVADOC-280-2-projects/pom.xml
index 2fdc256..284d57a 100644
--- a/src/it/projects/dependencySource-2/MJAVADOC-280-2-projects/pom.xml
+++ b/src/it/projects/dependencySource-2/MJAVADOC-280-2-projects/pom.xml
@@ -58,6 +58,11 @@
             </execution>

           </executions>

         </plugin>

+        <plugin>

+          <groupId>org.apache.maven.plugins</groupId>

+          <artifactId>maven-surefire-plugin</artifactId>

+          <version>2.22.0</version>

+        </plugin>

       </plugins>

     </pluginManagement>

   </build>

diff --git a/src/it/projects/dependencySource-4/MJAVADOC-280-4-projects/pom.xml b/src/it/projects/dependencySource-4/MJAVADOC-280-4-projects/pom.xml
index b67ffed..fb19c79 100644
--- a/src/it/projects/dependencySource-4/MJAVADOC-280-4-projects/pom.xml
+++ b/src/it/projects/dependencySource-4/MJAVADOC-280-4-projects/pom.xml
@@ -84,6 +84,11 @@
             </execution>

           </executions>

         </plugin>

+        <plugin>

+          <groupId>org.apache.maven.plugins</groupId>

+          <artifactId>maven-surefire-plugin</artifactId>

+          <version>2.22.0</version>

+        </plugin>

       </plugins>

     </pluginManagement>

   </build>

diff --git a/src/it/projects/detectLinks/pom.xml b/src/it/projects/detectLinks/pom.xml
index 2211198..ed387e8 100644
--- a/src/it/projects/detectLinks/pom.xml
+++ b/src/it/projects/detectLinks/pom.xml
@@ -53,8 +53,9 @@
     <!-- unknown apidocs link -->

     <dependency>

       <groupId>org.apache.maven</groupId>

-      <artifactId>maven-script-marmalade</artifactId>

-      <version>2.0-beta-2</version>

+      <artifactId>maven-script</artifactId>

+      <version>2.2.1</version>

+      <type>pom</type>

     </dependency>

   </dependencies>

 

diff --git a/src/it/projects/detectLinks/verify.bsh b/src/it/projects/detectLinks/verify.bsh
index 4e68ec2..145ebb4 100644
--- a/src/it/projects/detectLinks/verify.bsh
+++ b/src/it/projects/detectLinks/verify.bsh
@@ -69,7 +69,7 @@
         System.err.println( "-link not added: " + options1 );

         return false;

     }

-    if ( !contentOptions1.substring( link1 ).contains( "http://commons.apache.org/lang/apidocs" ) )

+    if ( !contentOptions1.substring( link1 ).contains( "commons.apache.org" ) )

     {

         System.err.println( "link for commons-lang not added: " + options1 );

         if ( !log.contains( "Error fetching link: http://commons.apache.org/lang/apidocs" ) )

@@ -77,7 +77,7 @@
             return false;

         }

     }

-    if ( !contentOptions1.substring( link1 ).contains( "http://junit.org/apidocs" ) )

+    if ( !contentOptions1.substring( link1 ).contains( "junit.org" ) )

     {

         System.err.println( "link for junit not added: " + options1 );

         if ( !log.contains( "Error fetching link: http://junit.org/apidocs" ) )

@@ -97,9 +97,9 @@
         System.err.println( "module2 -linkoffline module1 not added: " + options2 );

         return false;

     }

-    if ( !contentOptions2.substring( linkoffline2 ).contains( apidocs1.getAbsolutePath().replaceAll( "\\\\", "/" ) ) )

+    if ( !contentOptions2.substring( linkoffline2 ).contains( apidocs1.getCanonicalPath().replaceAll( "\\\\", "/" ) ) )

     {

-        System.err.println( apidocs1.getAbsolutePath().replaceAll( "\\\\", "/" ) + " not added: " + options2 );

+        System.err.println( apidocs1.getCanonicalPath().replaceAll( "\\\\", "/" ) + " not added: " + options2 );

         return false;

     }

     int link2 = contentOptions2.indexOf( "-link" );

@@ -108,7 +108,7 @@
         System.err.println( "-link not added: " + options2 );

         return false;

     }

-    if ( !contentOptions2.substring( link2 ).contains( "http://commons.apache.org/lang/apidocs" ) )

+    if ( !contentOptions2.substring( link2 ).contains( "commons.apache.org" ) )

     {

         System.err.println( "link for commons-lang not added: " + options2 );

         if ( !log.contains( "Error fetching link: http://commons.apache.org/lang/apidocs" ) )

@@ -116,7 +116,7 @@
             return false;

         }

     }

-    if ( !contentOptions2.substring( link2 ).contains( "http://junit.org/apidocs" ) )

+    if ( !contentOptions2.substring( link2 ).contains( "junit.org" ) )

     {

         System.err.println( "link for junit not added: " + options2 );

         if ( !log.contains( "Error fetching link: http://junit.org/apidocs" ) )

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AbstractFixJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/AbstractFixJavadocMojo.java
index 440e8a9..95e0863 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractFixJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractFixJavadocMojo.java
@@ -52,11 +52,11 @@
 import org.apache.maven.settings.Settings;

 import org.apache.maven.shared.invoker.MavenInvocationException;

 import org.codehaus.plexus.components.interactivity.InputHandler;

+import org.codehaus.plexus.languages.java.version.JavaVersion;

 import org.codehaus.plexus.util.FileUtils;

 import org.codehaus.plexus.util.IOUtil;

 import org.codehaus.plexus.util.ReaderFactory;

 import org.codehaus.plexus.util.StringUtils;

-import org.codehaus.plexus.util.WriterFactory;

 

 import java.io.BufferedReader;

 import java.io.File;

@@ -64,15 +64,17 @@
 import java.io.InputStream;

 import java.io.StringReader;

 import java.io.StringWriter;

-import java.io.Writer;

 import java.lang.reflect.Method;

 import java.net.MalformedURLException;

+import java.net.URISyntaxException;

 import java.net.URL;

 import java.net.URLClassLoader;

+import java.nio.file.Paths;

 import java.util.ArrayList;

 import java.util.Arrays;

 import java.util.Collection;

 import java.util.Collections;

+import java.util.HashSet;

 import java.util.Iterator;

 import java.util.LinkedHashMap;

 import java.util.LinkedList;

@@ -80,18 +82,18 @@
 import java.util.Locale;

 import java.util.Map;

 import java.util.Properties;

+import java.util.Set;

 import java.util.StringTokenizer;

 import java.util.regex.Matcher;

 import java.util.regex.Pattern;

 

 /**

  * Abstract class to fix Javadoc documentation and tags in source files.

- * <br/>

+ * <br>

  * See <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#wheretags">Where Tags

  * Can Be Used</a>.

  *

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: AbstractFixJavadocMojo.java 1801354 2017-07-09 08:49:46Z rfscholte $

  * @since 2.6

  */

 public abstract class AbstractFixJavadocMojo

@@ -313,9 +315,11 @@
     private boolean fixMethodComment;

 

     /**

-     * Flag to remove throws tags from unknown classes.

+     * <p>Flag to remove throws tags from unknown classes.</p>

+     * <p><strong>NOTE:</strong>Since 3.1.0 the default value has been changed to {@code true}, 

+     * due to JavaDoc 8 strictness. 

      */

-    @Parameter ( property = "removeUnknownThrows", defaultValue = "false" )

+    @Parameter ( property = "removeUnknownThrows", defaultValue = "true" )

     private boolean removeUnknownThrows;

 

     /**

@@ -391,7 +395,7 @@
     /**

      * Split {@link #fixTags} by comma.

      *

-     * @see {@link #init()}

+     * @see #init()

      */

     private String[] fixTagsSplitted;

 

@@ -683,6 +687,11 @@
         properties.put( "textOutputFile", clirrTextOutputFile.getAbsolutePath() );

         properties.put( "comparisonVersion", comparisonVersion );

         properties.put( "failOnError", "false" );

+        if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore( "8" ) )

+        {

+            // ensure that Java7 picks up TLSv1.2 when connecting with Central

+            properties.put( "https.protocols", "TLSv1.2" );

+        }

 

         File invokerDir = new File( project.getBuild().getDirectory(), "invoker" );

         invokerDir.mkdirs();

@@ -986,7 +995,16 @@
             return;

         }

 

-        File javaFile = new File( javaClass.getSource().getURL().getFile() );

+        File javaFile;

+        try

+        {

+            javaFile = Paths.get( javaClass.getSource().getURL().toURI() ).toFile();

+        }

+        catch ( URISyntaxException e )

+        {

+            throw new MojoExecutionException( e.getMessage() );

+        }

+        

         // the original java content in memory

         final String originalContent = StringUtils.unifyLineSeparators( FileUtils.fileRead( javaFile, encoding ) );

 

@@ -1139,10 +1157,8 @@
      * @param stringWriter    not null

      * @param originalContent not null

      * @param entity          not null

-     * @param changeDetected

-     * @return the updated changeDetected flag

      * @throws IOException if any

-     * @see #extractOriginalJavadoc(String, AbstractJavaEntity)

+     * @see #extractOriginalJavadoc

      */

     private void takeCareSingleComment( final StringWriter stringWriter, final String originalContent,

                                         final JavaAnnotatedElement entity )

@@ -1256,9 +1272,9 @@
      * <font color="#000000">DummyClass&nbsp;</font><font color="#000000">{}</font></code>

      * </code>

      *

-     * @param buffer    not null

-     * @param javaClass not null

-     * @param indent    not null

+     * @param stringWriter not null

+     * @param javaClass    not null

+     * @param indent       not null

      * @see #getDefaultClassJavadocComment(JavaClass)

      * @see #appendDefaultAuthorTag(StringBuilder, String)

      * @see #appendDefaultSinceTag(StringBuilder, String)

@@ -1411,7 +1427,7 @@
                 }

                 else

                 {

-                    sb.append( value.toString().substring( 0, 39 ) ).append( "\"{trunked}" );

+                    sb.append( value.toString(), 0, 39 ).append( "\"{trunked}" );

                 }

                 // CHECKSTYLE_ON: MagicNumber

             }

@@ -1490,11 +1506,11 @@
      * <font color="#000000">){}</font>

      * </code>

      *

-     * @param buffer     not null

+     * @param stringWriter   not null

      * @param javaExecutable not null

-     * @param indent     not null

+     * @param indent         not null

      * @throws MojoExecutionException if any

-     * @see #getDefaultMethodJavadocComment(JavaMethod)

+     * @see #getDefaultMethodJavadocComment

      * @see #appendDefaultSinceTag(StringBuilder, String)

      */

     private void addDefaultMethodComment( final StringWriter stringWriter, final JavaExecutable javaExecutable,

@@ -1570,7 +1586,6 @@
      * @param originalContent not null

      * @param entity          not null

      * @param indent          not null

-     * @param changeDetected

      * @return the updated changeDetected flag

      * @throws MojoExecutionException if any

      * @throws IOException            if any

@@ -1799,7 +1814,7 @@
         while ( linktagMatcher.find() )

         {

             int startName = linktagMatcher.end();

-            resolvedComment.append( comment.substring( startIndex, startName ) );

+            resolvedComment.append( comment, startIndex, startName );

             int endName = comment.indexOf( "}", startName );

             if ( endName >= 0 )

             {

@@ -1943,21 +1958,20 @@
                 }

 

                 String paramName = params.get( 0 );

-                if ( docletTag.getName().equals( PARAM_TAG ) )

+                switch ( docletTag.getName() ) 

                 {

-                    javaEntityTags.putJavadocParamTag( paramName, originalJavadocTag );

-                }

-                else if ( docletTag.getName().equals( RETURN_TAG ) )

-                {

-                    javaEntityTags.setJavadocReturnTag( originalJavadocTag );

-                }

-                else if ( docletTag.getName().equals( THROWS_TAG ) )

-                {

-                    javaEntityTags.putJavadocThrowsTag( paramName, originalJavadocTag );

-                }

-                else

-                {

-                    javaEntityTags.getUnknownTags().add( originalJavadocTag );

+                    case PARAM_TAG:

+                        javaEntityTags.putJavadocParamTag( paramName, docletTag.getValue(), originalJavadocTag );

+                        break;

+                    case RETURN_TAG:

+                        javaEntityTags.setJavadocReturnTag( originalJavadocTag );

+                        break;

+                    case THROWS_TAG:

+                        javaEntityTags.putJavadocThrowsTag( paramName, originalJavadocTag );

+                        break;

+                    default:

+                        javaEntityTags.getUnknownTags().add( originalJavadocTag );

+                        break;

                 }

             }

             else

@@ -1994,7 +2008,7 @@
 

                 if ( docletTag.getName().equals( PARAM_TAG ) )

                 {

-                    writeParamTag( sb, javaExecutable, javaEntityTags, params );

+                    writeParamTag( sb, javaExecutable, javaEntityTags, params.get( 0 ), docletTag.getValue() );

                 }

                 else if ( docletTag.getName().equals( RETURN_TAG ) && javaExecutable instanceof JavaMethod )

                 {

@@ -2047,14 +2061,12 @@
     }

 

     private void writeParamTag( final StringBuilder sb, final JavaExecutable javaExecutable,

-                                final JavaEntityTags javaEntityTags, List<String> params )

+                                final JavaEntityTags javaEntityTags, String paramName, String paramValue )

     {

-        String paramName = params.get( 0 );

-

         if ( !fixTag( PARAM_TAG ) )

         {

             // write original param tag if found

-            String originalJavadocTag = javaEntityTags.getJavadocParamTag( paramName );

+            String originalJavadocTag = javaEntityTags.getJavadocParamTag( paramValue );

             if ( originalJavadocTag != null )

             {

                 sb.append( originalJavadocTag );

@@ -2096,7 +2108,7 @@
         }

         else

         {

-            String originalJavadocTag = javaEntityTags.getJavadocParamTag( paramName );

+            String originalJavadocTag = javaEntityTags.getJavadocParamTag( paramValue );

             if ( originalJavadocTag != null )

             {

                 sb.append( originalJavadocTag );

@@ -2184,14 +2196,14 @@
         

         if ( clazz != null )

         {

-            if ( ClassUtils.isAssignable( clazz, RuntimeException.class ) )

+            if ( RuntimeException.class.isAssignableFrom( clazz ) )

             {

                 sb.append( StringUtils.replace( originalJavadocTag, exceptionClassName, clazz.getName() ) );

 

                 // added qualified name

                 javaEntityTags.putJavadocThrowsTag( clazz.getName(), originalJavadocTag );

             }

-            else if ( ClassUtils.isAssignable( clazz, Throwable.class ) )

+            else if ( Throwable.class.isAssignableFrom( clazz ) )

             {

                 getLog().debug( "Removing '" + originalJavadocTag + "'; Throwable not specified by "

                     + getJavaMethodAsString( javaExecutable ) + " and it is not a RuntimeException." );

@@ -2247,7 +2259,7 @@
                 {

                     for ( JavaParameter javaParameter : javaExecutable.getParameters() )

                     {

-                        if ( javaEntityTags.getJavadocParamTag( javaParameter.getName(), true ) == null )

+                        if ( !javaEntityTags.hasJavadocParamTag( javaParameter.getName() ) )

                         {

                             appendDefaultParamTag( sb, indent, javaParameter );

                         }

@@ -2258,7 +2270,7 @@
                 {

                     for ( JavaTypeVariable<JavaGenericDeclaration> typeParam : javaExecutable.getTypeParameters() )

                     {

-                        if ( javaEntityTags.getJavadocParamTag( "<" + typeParam.getName() + ">", true ) == null )

+                        if ( !javaEntityTags.hasJavadocParamTag( "<" + typeParam.getName() + ">" ) )

                         {

                             appendDefaultParamTag( sb, indent, typeParam );

                         }

@@ -2783,7 +2795,7 @@
      * @param javaMethod the QDox JavaMethod object not null

      * @return <code>true</code> if <code>javaMethod</code> exists in the given <code>clazz</code>,

      *         <code>false</code> otherwise.

-     * @see #isInherited(JavaMethod)

+     * @see #isInherited(JavaExecutable)

      */

     private boolean isInherited( Class<?> clazz, JavaExecutable javaMethod )

     {

@@ -2939,8 +2951,8 @@
      * @param className not null

      * @return the Class corresponding to the given class name using the project classloader.

      * @throws MojoExecutionException if class not found

-     * @see {@link ClassUtils#getClass(ClassLoader, String, boolean)}

-     * @see {@link #getProjectClassLoader()}

+     * @see ClassUtils#getClass(ClassLoader, String, boolean)

+     * @see #getProjectClassLoader()

      */

     private Class<?> getClass( String className )

         throws MojoExecutionException

@@ -3030,18 +3042,8 @@
     private static void writeFile( final File javaFile, final String encoding, final String content )

         throws IOException

     {

-        Writer writer = null;

-        try

-        {

-            writer = WriterFactory.newWriter( javaFile, encoding );

-            writer.write( StringUtils.unifyLineSeparators( content ) );

-            writer.close();

-            writer = null;

-        }

-        finally

-        {

-            IOUtil.close( writer );

-        }

+        String unified = StringUtils.unifyLineSeparators( content );

+        FileUtils.fileWrite( javaFile, encoding, unified );

     }

 

     /**

@@ -3301,18 +3303,19 @@
 

         String originalJavadoc = extractOriginalJavadocContent( javaClassContent, entity );

 

-        List<String> params = docletTag.getParameters();

-        String paramValue = params.get( 0 );

-

         StringBuilder sb = new StringBuilder();

         BufferedReader lr = new BufferedReader( new StringReader( originalJavadoc ) );

         String line;

         boolean found = false;

+        

+        // matching first line of doclettag

+        Pattern p = Pattern.compile( "(\\s*\\*\\s?@" + docletTag.getName() + ")\\s+"

+            + "(\\Q" + docletTag.getValue().split( "\r\n|\r|\n" )[0] + "\\E)" );

+        

         while ( ( line = lr.readLine() ) != null )

         {

-            String l = StringUtils.removeDuplicateWhitespace( line.trim() );

-            if ( l.startsWith( "* @" + docletTag.getName() + " " + paramValue ) || l.startsWith(

-                "*@" + docletTag.getName() + " " + paramValue ) )

+            Matcher m = p.matcher( line );

+            if ( m.matches() )

             {

                 if ( fixTag( LINK_TAG ) )

                 {

@@ -3323,7 +3326,7 @@
             }

             else

             {

-                if ( l.startsWith( "* @" ) || l.startsWith( "*@" ) )

+                if ( line.trim().startsWith( "* @" ) || line.trim().startsWith( "*@" ) )

                 {

                     found = false;

                 }

@@ -3619,7 +3622,7 @@
         }

 

         String textTrimmed = text.trim();

-        return text.substring( text.indexOf( textTrimmed ), text.length() );

+        return text.substring( text.indexOf( textTrimmed ) );

     }

 

     /**

@@ -3665,6 +3668,8 @@
          * Map with java parameter as key and original Javadoc lines as values.

          */

         private Map<String, String> tagParams;

+        

+        private Set<String> documentedParams = new HashSet<>();

 

         /**

          * Original javadoc lines.

@@ -3681,7 +3686,7 @@
          */

         private List<String> unknownsTags;

 

-        public JavaEntityTags( JavaAnnotatedElement entity, boolean isJavaMethod )

+        JavaEntityTags( JavaAnnotatedElement entity, boolean isJavaMethod )

         {

             this.entity = entity;

             this.isJavaMethod = isJavaMethod;

@@ -3711,27 +3716,27 @@
             return unknownsTags;

         }

 

-        public void putJavadocParamTag( String paramName, String originalJavadocTag )

+        public void putJavadocParamTag( String paramName, String paramValue, String originalJavadocTag )

         {

-            tagParams.put( paramName, originalJavadocTag );

+            documentedParams.add( paramName );

+            tagParams.put( paramValue, originalJavadocTag );

         }

 

-        public String getJavadocParamTag( String paramName )

+        public String getJavadocParamTag( String paramValue )

         {

-            return getJavadocParamTag( paramName, false );

-        }

-

-        public String getJavadocParamTag( String paramName, boolean nullable )

-        {

-            String originalJavadocTag = tagParams.get( paramName );

-            if ( !nullable && originalJavadocTag == null && getLog().isWarnEnabled() )

+            String originalJavadocTag = tagParams.get( paramValue );

+            if ( originalJavadocTag == null && getLog().isWarnEnabled() )

             {

-                getLog().warn( getMessage( paramName, "javaEntityTags.tagParams" ) );

+                getLog().warn( getMessage( paramValue, "javaEntityTags.tagParams" ) );

             }

-

             return originalJavadocTag;

         }

 

+        public boolean hasJavadocParamTag( String paramName )

+        {

+            return documentedParams.contains( paramName );

+        }

+

         public void putJavadocThrowsTag( String paramName, String originalJavadocTag )

         {

             tagThrows.put( paramName, originalJavadocTag );

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 afe3654..189604a 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -20,8 +20,6 @@
  */

 

 import org.apache.commons.lang3.ClassUtils;

-import org.apache.commons.lang3.JavaVersion;

-import org.apache.commons.lang3.SystemUtils;

 import org.apache.maven.artifact.Artifact;

 import org.apache.maven.artifact.ArtifactUtils;

 import org.apache.maven.artifact.handler.ArtifactHandler;

@@ -55,6 +53,7 @@
 import org.apache.maven.plugins.javadoc.resolver.JavadocBundle;

 import org.apache.maven.plugins.javadoc.resolver.ResourceResolver;

 import org.apache.maven.plugins.javadoc.resolver.SourceResolverConfig;

+import org.apache.maven.project.DefaultProjectBuildingRequest;

 import org.apache.maven.project.MavenProject;

 import org.apache.maven.project.ProjectBuilder;

 import org.apache.maven.project.ProjectBuildingException;

@@ -62,18 +61,18 @@
 import org.apache.maven.reporting.MavenReportException;

 import org.apache.maven.settings.Proxy;

 import org.apache.maven.settings.Settings;

-import org.apache.maven.shared.artifact.DefaultArtifactCoordinate;

+import org.apache.maven.shared.transfer.artifact.DefaultArtifactCoordinate;

 import org.apache.maven.shared.artifact.filter.resolve.AndFilter;

 import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter;

 import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter;

 import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter;

 import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;

-import org.apache.maven.shared.artifact.resolve.ArtifactResolver;

-import org.apache.maven.shared.artifact.resolve.ArtifactResolverException;

-import org.apache.maven.shared.artifact.resolve.ArtifactResult;

-import org.apache.maven.shared.dependencies.DefaultDependableCoordinate;

-import org.apache.maven.shared.dependencies.resolve.DependencyResolver;

-import org.apache.maven.shared.dependencies.resolve.DependencyResolverException;

+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver;

+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;

+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResult;

+import org.apache.maven.shared.transfer.dependencies.DefaultDependableCoordinate;

+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolver;

+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverException;

 import org.apache.maven.shared.invoker.MavenInvocationException;

 import org.apache.maven.toolchain.Toolchain;

 import org.apache.maven.toolchain.ToolchainManager;

@@ -83,9 +82,12 @@
 import org.codehaus.plexus.archiver.manager.ArchiverManager;

 import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;

 import org.codehaus.plexus.components.io.fileselectors.IncludeExcludeFileSelector;

+import org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor;

 import org.codehaus.plexus.languages.java.jpms.LocationManager;

+import org.codehaus.plexus.languages.java.jpms.ResolvePathRequest;

 import org.codehaus.plexus.languages.java.jpms.ResolvePathsRequest;

 import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult;

+import org.codehaus.plexus.languages.java.version.JavaVersion;

 import org.codehaus.plexus.util.DirectoryScanner;

 import org.codehaus.plexus.util.FileUtils;

 import org.codehaus.plexus.util.IOUtil;

@@ -99,20 +101,20 @@
 

 import java.io.File;

 import java.io.FileNotFoundException;

-import java.io.FileOutputStream;

 import java.io.IOException;

 import java.io.InputStream;

-import java.io.OutputStream;

 import java.io.Writer;

-import java.lang.reflect.InvocationTargetException;

 import java.lang.reflect.Method;

 import java.net.MalformedURLException;

 import java.net.URI;

 import java.net.URISyntaxException;

 import java.net.URL;

 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;

 import java.util.Calendar;

@@ -126,11 +128,10 @@
 import java.util.List;

 import java.util.Locale;

 import java.util.Map;

+import java.util.Map.Entry;

 import java.util.Properties;

 import java.util.Set;

 import java.util.StringTokenizer;

-import java.util.regex.Matcher;

-import java.util.regex.Pattern;

 

 import static org.apache.maven.plugins.javadoc.JavadocUtil.toRelative;

 import static org.apache.maven.plugins.javadoc.JavadocUtil.toList;

@@ -142,7 +143,6 @@
  *

  * @author <a href="mailto:brett@apache.org">Brett Porter</a>

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: AbstractJavadocMojo.java 1801354 2017-07-09 08:49:46Z rfscholte $

  * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html">

  *      The Java API Documentation Generator, 7</a>

  * @since 2.0

@@ -169,43 +169,6 @@
     public static final String TEST_JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER = "test-javadoc-resources";

 

     /**

-     * The default Javadoc API urls according the

-     * <a href="http://www.oracle.com/technetwork/java/javase/documentation/api-jsp-136079.html">Sun API

-     * Specifications</a>:

-     * <pre>

-     * &lt;javaApiLinks&gt;

-     *   &lt;property&gt;

-     *     &lt;name&gt;api_1.3&lt;/name&gt;

-     *     &lt;value&gt;http://docs.oracle.com/javase/1.3/docs/api/&lt;/value&gt;

-     *   &lt;/property&gt;

-     *   &lt;property&gt;

-     *     &lt;name&gt;api_1.4&lt;/name&gt;

-     *     &lt;value&gt;http://docs.oracle.com/javase/1.4.2/docs/api/&lt;/value&gt;

-     *   &lt;/property&gt;

-     *   &lt;property&gt;

-     *     &lt;name&gt;api_1.5&lt;/name&gt;

-     *     &lt;value&gt;http://docs.oracle.com/javase/1.5.0/docs/api/&lt;/value&gt;

-     *   &lt;/property&gt;

-     *   &lt;property&gt;

-     *     &lt;name&gt;api_1.6&lt;/name&gt;

-     *     &lt;value&gt;http://docs.oracle.com/javase/6/docs/api/&lt;/value&gt;

-     *   &lt;/property&gt;

-     *   &lt;property&gt;

-     *     &lt;name&gt;api_1.7&lt;/name&gt;

-     *     &lt;value&gt;http://docs.oracle.com/javase/7/docs/api/&lt;/value&gt;

-     *   &lt;/property&gt;

-     *   &lt;property&gt;

-     *     &lt;name&gt;api_1.8&lt;/name&gt;

-     *     &lt;value&gt;http://docs.oracle.com/javase/8/docs/api/&lt;/value&gt;

-     *   &lt;/property&gt;

-     * &lt;/javaApiLinks&gt;

-     * </pre>

-     *

-     * @since 2.6

-     */

-    public static final Properties DEFAULT_JAVA_API_LINKS = new Properties();

-

-    /**

      * The Javadoc script file name when <code>debug</code> parameter is on, i.e. javadoc.bat or javadoc.sh

      */

     protected static final String DEBUG_JAVADOC_SCRIPT_NAME = "javadoc." + ( SystemUtils.IS_OS_WINDOWS ? "bat" : "sh" );

@@ -248,6 +211,10 @@
      * Default location for css

      */

     private static final String RESOURCE_CSS_DIR = RESOURCE_DIR + "/css";

+    

+    private static final String PACKAGE_LIST = "package-list";

+    private static final String ELEMENT_LIST = "element-list";

+

 

     /**

      * For Javadoc options appears since Java 1.4.

@@ -256,7 +223,7 @@
      *

      * @since 2.1

      */

-    private static final JavadocVersion SINCE_JAVADOC_1_4 = JavadocVersion.parse( "1.4" );

+    private static final JavaVersion SINCE_JAVADOC_1_4 = JavaVersion.parse( "1.4" );

 

     /**

      * For Javadoc options appears since Java 1.4.2.

@@ -266,7 +233,7 @@
      *

      * @since 2.1

      */

-    private static final JavadocVersion SINCE_JAVADOC_1_4_2 = JavadocVersion.parse( "1.4.2" );

+    private static final JavaVersion SINCE_JAVADOC_1_4_2 = JavaVersion.parse( "1.4.2" );

 

     /**

      * For Javadoc options appears since Java 5.0.

@@ -276,7 +243,7 @@
      *

      * @since 2.1

      */

-    private static final JavadocVersion SINCE_JAVADOC_1_5 = JavadocVersion.parse( "1.5" );

+    private static final JavaVersion SINCE_JAVADOC_1_5 = JavaVersion.parse( "1.5" );

 

     /**

      * For Javadoc options appears since Java 6.0.

@@ -285,7 +252,7 @@
      *

      * @since 2.4

      */

-    private static final JavadocVersion SINCE_JAVADOC_1_6 = JavadocVersion.parse( "1.6" );

+    private static final JavaVersion SINCE_JAVADOC_1_6 = JavaVersion.parse( "1.6" );

 

     /**

      * For Javadoc options appears since Java 8.0.

@@ -294,13 +261,12 @@
      *

      * @since 3.0.0

      */

-    private static final JavadocVersion SINCE_JAVADOC_1_8 = JavadocVersion.parse( "1.8" );

+    private static final JavaVersion SINCE_JAVADOC_1_8 = JavaVersion.parse( "1.8" );

 

     /**

      * 

      */

-    // JAVA_VERSION can have -ea suffix, which is not supported (yet)

-    private static final JavadocVersion JAVA_VERSION = JavadocVersion.parse( SystemUtils.JAVA_SPECIFICATION_VERSION );

+    private static final JavaVersion JAVA_VERSION = JavaVersion.JAVA_SPECIFICATION_VERSION;

 

     // ----------------------------------------------------------------------

     // Mojo components

@@ -386,9 +352,9 @@
     private File javadocDirectory;

 

     /**

-     * Set an additional option(s) on the command line. This value should include quotes as necessary for

-     * parameters that include spaces. Useful for a custom doclet.

-     * 

+     * Set an additional option(s) on the command line. All input will be passed as-is to the

+     * {@code @options} file. You must take care of quoting and escaping. Useful for a custom doclet.

+     *

      * @since 3.0.0

      */

     @Parameter

@@ -490,7 +456,7 @@
     /**

      * Version of the Javadoc Tool executable to use.

      */

-    private JavadocVersion javadocRuntimeVersion;

+    private JavaVersion javadocRuntimeVersion;

 

     /**

      * Specifies whether the Javadoc generation should be skipped.

@@ -521,7 +487,7 @@
      * Specifies to use the

      * <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#standard">

      * options provided by the Standard Doclet</a> for a custom doclet.

-     * <br/>

+     * <br>

      * Example:

      * <pre>

      * &lt;docletArtifacts&gt;

@@ -601,15 +567,19 @@
     private boolean detectJavaApiLink;

 

     /**

-     * Use this parameter <b>only</b> if the <a href="http://java.sun.com/reference/api/index.html">Sun Javadoc API</a>

-     * urls have been changed or to use custom urls for Javadoc API url.

-     * <br/>

-     * See

-     * <a href="./apidocs/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.html#DEFAULT_JAVA_API_LINKS">Javadoc</a>

-     * for the default values.

-     * <br/>

-     *

-     * @see #DEFAULT_JAVA_API_LINKS

+     * Use this parameter <b>only</b> if if you want to override the default URLs.

+     * 

+     * The key should match {@code api_x}, where {@code x} matches the Java version.  

+     * 

+     *  For example:

+     *  <dl>

+     *   <dt>api_1.5</dt>

+     *   <dd>https://docs.oracle.com/javase/1.5.0/docs/api/</dd>

+     *   <dt>api_1.8<dt>

+     *   <dd>https://docs.oracle.com/javase/8/docs/api/</dd>

+     *   <dt>api_9</dd>

+     *   <dd>https://docs.oracle.com/javase/9/docs/api/</dd>

+     * </dl>

      * @since 2.6

      */

     @Parameter( property = "javaApiLinks" )

@@ -763,7 +733,14 @@
      * Unconditionally excludes the specified packages and their subpackages from the list formed by

      * <code>-subpackages</code>. Multiple packages can be separated by commas (<code>,</code>), colons (<code>:</code>)

      * or semicolons (<code>;</code>).

-     * <br/>

+     * <p>

+     * Wildcards work as followed:

+     * <ul>

+     *   <li>a wildcard at the beginning should match 1 or more folders</li>

+     *   <li>any other wildcard must match exactly one folder</li>

+     * </ul>

+     * </p>

+     * <p>

      * Example:

      * <pre>

      * &lt;excludePackageNames&gt;*.internal:org.acme.exclude1.*:org.acme.exclude2&lt;/excludePackageNames&gt;

@@ -773,6 +750,7 @@
      * <br/>

      * Since <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/whatsnew-1.4.html#summary">Java

      * 1.4</a>.

+     * </p>

      */

     @Parameter( property = "excludePackageNames" )

     private String excludePackageNames;

@@ -880,6 +858,15 @@
      */

     @Parameter( property = "source" )

     private String source;

+    

+    /**

+     * Provide source compatibility with specified release

+     * 

+     * @since JDK 9

+     * @since 3.1.0

+     */

+    @Parameter( defaultValue = "${maven.compiler.release}" )

+    private String release;

 

     /**

      * Specifies the source paths where the subpackages are located. The <code>sourcepath</code> can contain

@@ -1130,7 +1117,7 @@
 

     /**

      * Creates links to existing javadoc-generated documentation of external referenced classes.

-     * <br/>

+     * <br>

      * <b>Notes</b>:

      * <ol>

      * <li>only used if {@link #isOffline} is set to <code>false</code>.</li>

@@ -1290,9 +1277,8 @@
 

     /**

      * Omits the class/interface hierarchy pages from the generated docs.

-     * <br/>

-     * See <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#notree">notree</a>.

-     * <br/>

+     * <br>

+     * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#notree">notree</a> option

      */

     @Parameter( property = "notree", defaultValue = "false" )

     private boolean notree;

@@ -1316,18 +1302,16 @@
      * <br/>

      * <b>Note</b>: if {@link #detectOfflineLinks} is defined, the offline links between the project modules are

      * automatically added if the goal is calling in a non-aggregator way.

-     * <br/>

-     * See <a href="./apidocs/org/apache/maven/plugin/javadoc/options/OfflineLink.html">Javadoc</a>.

-     * <br/>

+     * <br>

+     * @see <a href="./apidocs/org/apache/maven/plugin/javadoc/options/OfflineLink.html">Javadoc</a>.

      */

     @Parameter( property = "offlineLinks" )

     private OfflineLink[] offlineLinks;

 

     /**

      * Specifies the destination directory where javadoc saves the generated HTML files.

-     * <br/>

-     * See <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#d">d</a>.

-     * <br/>

+     * <br>

+     * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#d">d</a> option

      */

     @Parameter( property = "destDir", alias = "destDir", defaultValue = "${project.build.directory}/apidocs",

                     required = true )

@@ -1348,8 +1332,7 @@
     /**

      * Generates compile-time warnings for missing serial tags.

      * <br/>

-     * See <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#serialwarn">serialwarn</a>

-     * <br/>

+     * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#serialwarn">serialwarn</a> option 

      */

     @Parameter( property = "serialwarn", defaultValue = "false" )

     private boolean serialwarn;

@@ -1648,13 +1631,16 @@
     private File sourceDependencyCacheDir;

 

     /**

-     * Whether to include transitive dependencies in the list of dependency -sources jars to include

-     * in this javadoc run.

+     * Whether to include transitive dependencies in the list of dependency -sources jars to include in this javadoc

+     * run.

      *

      * @see #includeDependencySources

      * @since 2.7

+     * @deprecated if these sources depend on transitive dependencies, those dependencies should be added to the pom as

+     *             direct dependencies

      */

     @Parameter( defaultValue = "false" )

+    @Deprecated

     private boolean includeTransitiveDependencySources;

 

     /**

@@ -1744,19 +1730,6 @@
     private Map<String, String> jdkToolchain;

 

     // ----------------------------------------------------------------------

-    // static

-    // ----------------------------------------------------------------------

-

-    static

-    {

-        DEFAULT_JAVA_API_LINKS.put( "api_1.5", "https://docs.oracle.com/javase/1.5.0/docs/api/" );

-        DEFAULT_JAVA_API_LINKS.put( "api_1.6", "https://docs.oracle.com/javase/6/docs/api/" );

-        DEFAULT_JAVA_API_LINKS.put( "api_1.7", "https://docs.oracle.com/javase/7/docs/api/" );

-        DEFAULT_JAVA_API_LINKS.put( "api_1.8", "https://docs.oracle.com/javase/8/docs/api/" );

-        DEFAULT_JAVA_API_LINKS.put( "api_9",   "https://docs.oracle.com/javase/9/docs/api/" );

-    }

-

-    // ----------------------------------------------------------------------

     // protected methods

     // ----------------------------------------------------------------------

 

@@ -1809,6 +1782,15 @@
 

         return Collections.singletonList( new File( p.getBuild().getOutputDirectory() ) );

     }

+    

+    protected File getArtifactFile( MavenProject project )

+    {

+        if ( project.getArtifact() != null )

+        {

+            return project.getArtifact().getFile();

+        }

+        return null;

+    }

 

     /**

      * @param p not null maven project

@@ -1922,11 +1904,9 @@
 

     protected final void verifyRemovedParameter( String paramName )

     {

-        Object pluginConfiguration = mojo.getConfiguration();

-        if ( pluginConfiguration instanceof Xpp3Dom )

+        Xpp3Dom configDom = mojo.getConfiguration();

+        if ( configDom != null )

         {

-            Xpp3Dom configDom = (Xpp3Dom) pluginConfiguration;

-

             if ( configDom.getChild( paramName ) != null )

             {

                 throw new IllegalArgumentException( "parameter '" + paramName

@@ -1937,11 +1917,9 @@
 

     private void verifyReplacedParameter( String oldParamName, String newParamNew )

     {

-        Object pluginConfiguration = mojo.getConfiguration();

-        if ( pluginConfiguration instanceof Xpp3Dom )

+        Xpp3Dom configDom = mojo.getConfiguration();

+        if ( configDom != null )

         {

-            Xpp3Dom configDom = (Xpp3Dom) pluginConfiguration;

-

             if ( configDom.getChild( oldParamName ) != null )

             {

                 throw new IllegalArgumentException( "parameter '" + oldParamName

@@ -1966,11 +1944,6 @@
             return;

         }

 

-        if ( isAggregator() && !project.isExecutionRoot() )

-        {

-            return;

-        }

-

         if ( getLog().isDebugEnabled() )

         {

             this.debug = true;

@@ -1987,19 +1960,16 @@
             throw new MavenReportException( "Failed to generate javadoc options file: " + e.getMessage(), e );

         }

 

-        Map<String, Collection<String>> sourcePaths = getSourcePaths();

+        Map<String, Collection<Path>> sourcePaths = getSourcePaths();

         

-        Collection<String> collectedSourcePaths = collect( sourcePaths.values() );

+        Collection<Path> collectedSourcePaths = collect( sourcePaths.values() );

         

-        List<String> files = getFiles( collectedSourcePaths );

+        Map<Path, Collection<String>> files = getFiles( collectedSourcePaths );

         if ( !canGenerateReport( files ) )

         {

             return;

         }

 

-        List<String> packageNames = getPackageNames( collectedSourcePaths, files );

-        List<String> filesWithUnnamedPackages = getFilesWithUnnamedPackages( collectedSourcePaths, files );

-

         // ----------------------------------------------------------------------

         // Find the javadoc executable and version

         // ----------------------------------------------------------------------

@@ -2015,6 +1985,16 @@
         }

         setFJavadocVersion( new File( jExecutable ) );

 

+        List<String> packageNames;

+        if ( javadocRuntimeVersion.isAtLeast( "9" ) )

+        {

+            packageNames = getPackageNamesRespectingJavaModules( sourcePaths );

+        }

+        else

+        {

+            packageNames = getPackageNames( files );

+        }

+

         // ----------------------------------------------------------------------

         // Javadoc output directory as File

         // ----------------------------------------------------------------------

@@ -2116,9 +2096,11 @@
             // Write argfile file and include it in the command line

             // ----------------------------------------------------------------------

 

-            if ( !filesWithUnnamedPackages.isEmpty() )

+            List<String> specialFiles = getSpecialFiles( files );

+

+            if ( !specialFiles.isEmpty() )

             {

-                addCommandLineArgFile( cmd, javadocOutputDirectory, filesWithUnnamedPackages );

+                addCommandLineArgFile( cmd, javadocOutputDirectory, specialFiles );

             }

         }

         else

@@ -2126,10 +2108,19 @@
             // ----------------------------------------------------------------------

             // Write argfile file and include it in the command line

             // ----------------------------------------------------------------------

+            

+            List<String> allFiles = new ArrayList<>();

+            for ( Map.Entry<Path, Collection<String>> filesEntry : files.entrySet() )

+            {

+                for ( String file : filesEntry.getValue() )

+                {

+                    allFiles.add( filesEntry.getKey().resolve( file ).toString() );

+                }

+            }

 

             if ( !files.isEmpty() )

             {

-                addCommandLineArgFile( cmd, javadocOutputDirectory, files );

+                addCommandLineArgFile( cmd, javadocOutputDirectory, allFiles );

             }

         }

 

@@ -2190,10 +2181,10 @@
         }

     }

 

-    protected final Collection<String> collect( Collection<Collection<String>> sourcePaths )

+    protected final <T> Collection<T> collect( Collection<Collection<T>> sourcePaths )

     {

-        Collection<String> collectedSourcePaths = new LinkedHashSet<>();

-        for ( Collection<String> sp : sourcePaths )

+        Collection<T> collectedSourcePaths = new LinkedHashSet<>();

+        for ( Collection<T> sp : sourcePaths )

         {

             collectedSourcePaths.addAll( sp );

         }

@@ -2207,23 +2198,25 @@
      * @return a List that contains the specific path for every source file

      * @throws MavenReportException {@link MavenReportException}

      */

-    protected List<String> getFiles( Collection<String> sourcePaths )

+    protected Map<Path, Collection<String>> getFiles( Collection<Path> sourcePaths )

         throws MavenReportException

     {

-        List<String> files = new ArrayList<>();

+        Map<Path, Collection<String>> mappedFiles = new LinkedHashMap<>( sourcePaths.size() );

         if ( StringUtils.isEmpty( subpackages ) )

         {

-            String[] excludedPackages = getExcludedPackages();

-

-            for ( String sourcePath : sourcePaths )

+            Collection<String> excludedPackages = getExcludedPackages();

+            

+            for ( Path sourcePath : sourcePaths )

             {

-                File sourceDirectory = new File( sourcePath );

-                JavadocUtil.addFilesFromSource( files, sourceDirectory, sourceFileIncludes, sourceFileExcludes,

-                                                excludedPackages );

+                List<String> files = new ArrayList<>();

+                File sourceDirectory = sourcePath.toFile();

+                files.addAll( JavadocUtil.getFilesFromSource( sourceDirectory, sourceFileIncludes, sourceFileExcludes,

+                                                              excludedPackages ) );

+                mappedFiles.put( sourcePath, files );

             }

         }

 

-        return files;

+        return mappedFiles;

     }

 

     /**

@@ -2232,17 +2225,17 @@
      *

      * @return a Collection of the project absolute source paths as <code>String</code>

      * @throws MavenReportException {@link MavenReportException}

-     * @see JavadocUtil#pruneDirs(MavenProject, List)

+     * @see JavadocUtil#pruneDirs(MavenProject, Collection)

      */

-    protected Map<String, Collection<String>> getSourcePaths()

+    protected Map<String, Collection<Path>> getSourcePaths()

         throws MavenReportException

     {

-        Map<String, Collection<String>> mappedSourcePaths = new LinkedHashMap<>();

+        Map<String, Collection<Path>> mappedSourcePaths = new LinkedHashMap<>();

 

         if ( StringUtils.isEmpty( sourcepath ) )

         {

             

-            Set<String> sourcePaths =

+            Set<Path> sourcePaths =

                 new LinkedHashSet<>( JavadocUtil.pruneDirs( project, getProjectSourceRoots( project ) ) );

 

             if ( project.getExecutionProject() != null )

@@ -2260,7 +2253,7 @@
                 File javadocDir = getJavadocDirectory();

                 if ( javadocDir.exists() && javadocDir.isDirectory() )

                 {

-                    Collection<String> l = JavadocUtil.pruneDirs( project, Collections.singletonList(

+                    Collection<Path> l = JavadocUtil.pruneDirs( project, Collections.singletonList(

                         getJavadocDirectory().getAbsolutePath() ) );

                     sourcePaths.addAll( l );

                 }

@@ -2273,13 +2266,13 @@
                 mappedSourcePaths.putAll( getDependencySourcePaths() );

             }

 

-            if ( isAggregator() && project.isExecutionRoot() )

+            if ( isAggregator() )

             {

-                for ( MavenProject subProject : reactorProjects )

+                for ( MavenProject subProject : getAggregatedProjects() )

                 {

                     if ( subProject != project )

                     {

-                        Collection<String> additionalSourcePaths = new ArrayList<>();

+                        Collection<Path> additionalSourcePaths = new ArrayList<>();

 

                         List<String> sourceRoots = getProjectSourceRoots( subProject );

 

@@ -2302,7 +2295,7 @@
                             File javadocDir = new File( subProject.getBasedir(), javadocDirRelative );

                             if ( javadocDir.exists() && javadocDir.isDirectory() )

                             {

-                                Collection<String> l = JavadocUtil.pruneDirs( subProject, Collections.singletonList(

+                                Collection<Path> l = JavadocUtil.pruneDirs( subProject, Collections.singletonList(

                                         javadocDir.getAbsolutePath() ) );

                                 additionalSourcePaths.addAll( l );

                             }

@@ -2316,11 +2309,12 @@
         }

         else

         {

-            Collection<String> sourcePaths = new ArrayList<>( Arrays.asList( JavadocUtil.splitPath( sourcepath ) ) );

-            sourcePaths = JavadocUtil.pruneDirs( project, sourcePaths );

+            Collection<Path> sourcePaths =

+                JavadocUtil.pruneDirs( project,

+                                       new ArrayList<>( Arrays.asList( JavadocUtil.splitPath( sourcepath ) ) ) );

             if ( getJavadocDirectory() != null )

             {

-                Collection<String> l = JavadocUtil.pruneDirs( project, Collections.singletonList(

+                Collection<Path> l = JavadocUtil.pruneDirs( project, Collections.singletonList(

                     getJavadocDirectory().getAbsolutePath() ) );

                 sourcePaths.addAll( l );

             }

@@ -2331,10 +2325,61 @@
         return mappedSourcePaths;

     }

 

+    private Collection<MavenProject> getAggregatedProjects()

+    {

+        Map<Path, MavenProject> reactorProjectsMap = new HashMap<>();

+        for ( MavenProject reactorProject : this.reactorProjects )

+        {

+            reactorProjectsMap.put( reactorProject.getBasedir().toPath(), reactorProject );

+        }

+        

+        return modulesForAggregatedProject( project, reactorProjectsMap );

+    }

+

+    /**

+     * Recursively add the modules of the aggregatedProject to the set of aggregatedModules.

+     * 

+     * @param aggregatedProject the project being aggregated

+     * @param reactorProjectsMap map of (still) available reactor projects 

+     * @throws MavenReportException if any

+     */

+    private Set<MavenProject> modulesForAggregatedProject( MavenProject aggregatedProject,

+                                                           Map<Path, MavenProject> reactorProjectsMap )

+    {

+        // Maven does not supply an easy way to get the projects representing

+        // the modules of a project. So we will get the paths to the base

+        // directories of the modules from the project and compare with the

+        // base directories of the projects in the reactor.

+

+        if ( aggregatedProject.getModules().isEmpty() )

+        {

+            return Collections.singleton( aggregatedProject );

+        }

+

+        List<Path> modulePaths = new LinkedList<Path>();

+        for ( String module :  aggregatedProject.getModules() )

+        {

+            modulePaths.add( new File( aggregatedProject.getBasedir(), module ).toPath() );

+        }

+

+        Set<MavenProject> aggregatedModules = new LinkedHashSet<>();

+        

+        for ( Path modulePath : modulePaths )

+        {

+            MavenProject module = reactorProjectsMap.remove( modulePath );

+            if ( module != null )

+            {

+                aggregatedModules.addAll( modulesForAggregatedProject( module, reactorProjectsMap ) );

+            }

+        }

+        

+        return aggregatedModules;

+    }

+

     /**

      * Override this method to customize the configuration for resolving dependency sources. The default

      * behavior enables the resolution of -sources jar files.

-     * @param config {@linke SourceResolverConfig}

+     * @param config {@link SourceResolverConfig}

      * @return {@link SourceResolverConfig}

      */

     protected SourceResolverConfig configureDependencySourceResolution( final SourceResolverConfig config )

@@ -2348,7 +2393,7 @@
      * @return List of source paths.

      * @throws MavenReportException {@link MavenReportException}

      */

-    protected final Map<String, Collection<String>> getDependencySourcePaths()

+    protected final Map<String, Collection<Path>> getDependencySourcePaths()

         throws MavenReportException

     {

         try

@@ -2397,12 +2442,7 @@
         {

             return resourceResolver.resolveDependencySourcePaths( config );

         }

-        catch ( final ArtifactResolutionException e )

-        {

-            throw new MavenReportException(

-                "Failed to resolve one or more javadoc source/resource artifacts:\n\n" + e.getMessage(), e );

-        }

-        catch ( final ArtifactNotFoundException e )

+        catch ( final ArtifactResolutionException | ArtifactNotFoundException e )

         {

             throw new MavenReportException(

                 "Failed to resolve one or more javadoc source/resource artifacts:\n\n" + e.getMessage(), e );

@@ -2448,16 +2488,17 @@
      * @param files the project files

      * @return a boolean that indicates whether javadoc report can be generated or not

      */

-    protected boolean canGenerateReport( List<String> files )

+    protected boolean canGenerateReport( Map<Path, Collection<String>> files )

     {

-        boolean canGenerate = true;

-

-        if ( files.isEmpty() && StringUtils.isEmpty( subpackages ) )

+        for ( Collection<String> filesValues : files.values() )

         {

-            canGenerate = false;

+            if ( !filesValues.isEmpty() )

+            {

+                return true;

+            }

         }

 

-        return canGenerate;

+        return !StringUtils.isEmpty( subpackages );

     }

 

     // ----------------------------------------------------------------------

@@ -2468,21 +2509,20 @@
      * Method to get the excluded source files from the javadoc and create the argument string

      * that will be included in the javadoc commandline execution.

      *

-     * @param sourcePaths the collection of paths to the source files

+     * @param sourceFolders the collection of paths to the source files

      * @return a String that contains the exclude argument that will be used by javadoc

      * @throws MavenReportException

      */

-    private String getExcludedPackages( Collection<String> sourcePaths )

+    private String getExcludedPackages( Collection<Path> sourcePaths )

         throws MavenReportException

     {

         List<String> excludedNames = null;

-

+        

         if ( StringUtils.isNotEmpty( sourcepath ) && StringUtils.isNotEmpty( subpackages ) )

         {

-            String[] excludedPackages = getExcludedPackages();

-            String[] subpackagesList = subpackages.split( "[:]" );

-

-            excludedNames = JavadocUtil.getExcludedNames( sourcePaths, subpackagesList, excludedPackages );

+            Collection<String> excludedPackages = getExcludedPackages();

+            

+            excludedNames = JavadocUtil.getExcludedPackages( sourcePaths, excludedPackages );

         }

 

         String excludeArg = "";

@@ -2503,7 +2543,7 @@
      *         string (colon (<code>:</code>) on Solaris or semi-colon (<code>;</code>) on Windows).

      * @see File#pathSeparator

      */

-    private String getSourcePath( Collection<String> sourcePaths )

+    private String getSourcePath( Collection<Path> sourcePaths )

     {

         String sourcePath = null;

 

@@ -2522,7 +2562,7 @@
      * @return an array of String objects that contain the package names

      * @throws MavenReportException

      */

-    private String[] getExcludedPackages()

+    private Collection<String> getExcludedPackages()

         throws MavenReportException

     {

         Set<String> excluded = new LinkedHashSet<>();

@@ -2559,18 +2599,7 @@
             excluded.addAll( trimValues( packageNames ) );

         }

 

-        String[] result = new String[excluded.size()];

-        if ( isNotEmpty( excluded ) )

-        {

-            int idx = 0;

-            for ( String exclude : excluded )

-            {

-                result[idx] = exclude.replace( '.', File.separatorChar );

-                idx++;

-            }

-        }

-

-        return result;

+        return excluded;

     }

 

     private static List<String> trimValues( List<String> items )

@@ -2602,7 +2631,7 @@
         throws MavenReportException

     {

         List<File> classpathElements = new ArrayList<>();

-        Map<String, Artifact> compileArtifactMap = new HashMap<>();

+        Map<String, Artifact> compileArtifactMap = new LinkedHashMap<>();

 

         if ( isTest() )

         {

@@ -2611,10 +2640,13 @@
         

         populateCompileArtifactMap( compileArtifactMap, project.getArtifacts() );

 

-        if ( isAggregator() && project.isExecutionRoot() )

+        

+        if ( isAggregator() )

         {

+            Collection<MavenProject> aggregatorProjects = getAggregatedProjects();

+

             List<String> reactorArtifacts = new ArrayList<>();

-            for ( MavenProject p : reactorProjects )

+            for ( MavenProject p : aggregatorProjects )

             {

                 reactorArtifacts.add( p.getGroupId() + ':' + p.getArtifactId() );

             }

@@ -2623,11 +2655,19 @@
                                                                      new PatternExclusionsFilter( reactorArtifacts ),

                                                                      getDependencyScopeFilter() ) );

 

-            for ( MavenProject subProject : reactorProjects )

+            for ( MavenProject subProject : aggregatorProjects )

             {

                 if ( subProject != project )

                 {

-                    classpathElements.addAll( getProjectBuildOutputDirs( subProject ) );

+                    File projectArtifactFile = getArtifactFile( subProject );

+                    if ( projectArtifactFile != null )

+                    {

+                        classpathElements.add( projectArtifactFile );

+                    }

+                    else

+                    {

+                        classpathElements.addAll( getProjectBuildOutputDirs( subProject ) );

+                    }

 

                     try

                     {

@@ -2642,10 +2682,16 @@
                         buildingRequest =

                             buildingRequest.setRemoteRepositories( subProject.getRemoteArtifactRepositories() );

                         

+                        List<Dependency> managedDependencies = null;

+                        if ( subProject.getDependencyManagement() != null )

+                        {

+                            managedDependencies = subProject.getDependencyManagement().getDependencies();

+                        }

+                        

                         for ( ArtifactResult artifactResult

                                     : dependencyResolver.resolveDependencies( buildingRequest,

                                                                               subProject.getDependencies(),

-                                                                              null,

+                                                                              managedDependencies,

                                                                               dependencyFilter ) )

                         {

                             populateCompileArtifactMap( compileArtifactMap,

@@ -2694,7 +2740,7 @@
     /**

      * @param dependency {@link Dependency}

      * @return {@link Artifact}

-     * @throws MavenReportException

+     * @throws MavenReportException when artifact could not be resolved

      */

     public Artifact resolveDependency( Dependency dependency )

         throws MavenReportException

@@ -2742,23 +2788,7 @@
                     tc = tcs.get( 0 );

                 }

             }

-            catch ( NoSuchMethodException e )

-            {

-                // ignore

-            }

-            catch ( SecurityException e )

-            {

-                // ignore

-            }

-            catch ( IllegalAccessException e )

-            {

-                // ignore

-            }

-            catch ( IllegalArgumentException e )

-            {

-                // ignore

-            }

-            catch ( InvocationTargetException e )

+            catch ( SecurityException | ReflectiveOperationException e )

             {

                 // ignore

             }

@@ -3103,15 +3133,14 @@
                 taglet.getTagletArtifact().getArtifactId() ) ) && ( StringUtils.isNotEmpty(

                 taglet.getTagletArtifact().getVersion() ) ) )

             {

-                pathParts.addAll( getArtifactsAbsolutePath( taglet.getTagletArtifact() ) );

-

-                pathParts = JavadocUtil.pruneFiles( pathParts );

+                pathParts.addAll( JavadocUtil.pruneFiles( getArtifactsAbsolutePath( taglet.getTagletArtifact() ) ) );

             }

             else if ( StringUtils.isNotEmpty( taglet.getTagletpath() ) )

             {

-                pathParts.add( taglet.getTagletpath() );

-

-                pathParts = JavadocUtil.pruneDirs( project, pathParts );

+                for ( Path dir : JavadocUtil.pruneDirs( project, Collections.singletonList( taglet.getTagletpath() ) ) )

+                {

+                    pathParts.add( dir.toString()  );

+                }

             }

         }

 

@@ -3163,7 +3192,7 @@
 

         links.addAll( getDependenciesLinks() );

 

-        return links;

+        return followLinks( links );

     }

 

     private Set<Group> collectGroups()

@@ -3513,7 +3542,7 @@
             coordinate.setGroupId( javadocArtifact.getGroupId() );

             coordinate.setArtifactId( javadocArtifact.getArtifactId() );

             coordinate.setVersion( javadocArtifact.getVersion() );

-

+            

             Iterable<ArtifactResult> deps =

                 dependencyResolver.resolveDependencies( session.getProjectBuildingRequest(), coordinate,

                                                         ScopeFilter.including( "compile", "provided" ) );

@@ -3549,7 +3578,11 @@
         coordinate.setArtifactId( javadocArtifact.getArtifactId() );

         coordinate.setVersion( javadocArtifact.getVersion() );

 

-        return artifactResolver.resolveArtifact( session.getProjectBuildingRequest(), coordinate ).getArtifact();

+        DefaultProjectBuildingRequest buildingRequest =

+            new DefaultProjectBuildingRequest( session.getProjectBuildingRequest() );

+        buildingRequest.setRemoteRepositories( project.getRemoteArtifactRepositories() );

+        

+        return artifactResolver.resolveArtifact( buildingRequest, coordinate ).getArtifact();

     }

 

     /**

@@ -3689,7 +3722,7 @@
         }

         // For Apple's JDK 1.6.x (and older?) on Mac OSX

         // CHECKSTYLE_OFF: MagicNumber

-        else if ( SystemUtils.IS_OS_MAC_OSX && !SystemUtils.isJavaVersionAtLeast( JavaVersion.JAVA_1_7 ) )

+        else if ( SystemUtils.IS_OS_MAC_OSX && !JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast( "1.7" ) )

         // CHECKSTYLE_ON: MagicNumber

         {

             javadocExe = new File( SystemUtils.getJavaHome() + File.separator + "bin", javadocCommand );

@@ -3740,30 +3773,12 @@
     private void setFJavadocVersion( File jExecutable )

         throws MavenReportException

     {

-        JavadocVersion jVersion;

+        JavaVersion jVersion;

         try

         {

             jVersion = JavadocUtil.getJavadocVersion( jExecutable );

         }

-        catch ( IOException e )

-        {

-            if ( getLog().isWarnEnabled() )

-            {

-                getLog().warn( "Unable to find the javadoc version: " + e.getMessage() );

-                getLog().warn( "Using the Java version instead of, i.e. " + JAVA_VERSION );

-            }

-            jVersion = JAVA_VERSION;

-        }

-        catch ( CommandLineException e )

-        {

-            if ( getLog().isWarnEnabled() )

-            {

-                getLog().warn( "Unable to find the javadoc version: " + e.getMessage() );

-                getLog().warn( "Using the Java version instead of, i.e. " + JAVA_VERSION );

-            }

-            jVersion = JAVA_VERSION;

-        }

-        catch ( IllegalArgumentException e )

+        catch ( IOException | CommandLineException | IllegalArgumentException e )

         {

             if ( getLog().isWarnEnabled() )

             {

@@ -3777,14 +3792,14 @@
         {

             try

             {

-                javadocRuntimeVersion = JavadocVersion.parse( javadocVersion );

+                javadocRuntimeVersion = JavaVersion.parse( javadocVersion );

             }

             catch ( NumberFormatException e )

             {

                 throw new MavenReportException( "Unable to parse javadoc version: " + e.getMessage(), e );

             }

 

-            if ( javadocRuntimeVersion != jVersion && getLog().isWarnEnabled() )

+            if ( javadocRuntimeVersion.compareTo( jVersion ) != 0 && getLog().isWarnEnabled() )

             {

                 getLog().warn( "Are you sure about the <javadocVersion/> parameter? It seems to be " + jVersion );

             }

@@ -3802,7 +3817,7 @@
      * @return <code>true</code> if the javadoc version is equal or greater than the

      *         required version

      */

-    private boolean isJavaDocVersionAtLeast( JavadocVersion requiredVersion )

+    private boolean isJavaDocVersionAtLeast( JavaVersion requiredVersion )

     {

         return JAVA_VERSION.compareTo( requiredVersion ) >= 0;

     }

@@ -3831,10 +3846,10 @@
      * @param b                   the flag which controls if the argument is added or not.

      * @param value               the argument value to be added.

      * @param requiredJavaVersion the required Java version, for example 1.31f or 1.4f

-     * @see #addArgIf(java.util.List, boolean, String)

-     * @see #isJavaDocVersionAtLeast(float)

+     * @see #addArgIf(List, boolean, String)

+     * @see #isJavaDocVersionAtLeast(JavaVersion)

      */

-    private void addArgIf( List<String> arguments, boolean b, String value, JavadocVersion requiredJavaVersion )

+    private void addArgIf( List<String> arguments, boolean b, String value, JavaVersion requiredJavaVersion )

     {

         if ( b )

         {

@@ -3862,7 +3877,7 @@
      * @param arguments a list of arguments, not null

      * @param key       the argument name.

      * @param value     the argument value to be added.

-     * @see #addArgIfNotEmpty(java.util.List, String, String, boolean)

+     * @see #addArgIfNotEmpty(List, String, String, boolean)

      */

     private void addArgIfNotEmpty( List<String> arguments, String key, String value )

     {

@@ -3882,10 +3897,10 @@
      * @param splitValue          if <code>true</code> given value will be tokenized by comma

      * @param requiredJavaVersion the required Java version, for example 1.31f or 1.4f

      * @see #addArgIfNotEmpty(List, String, String, boolean, boolean)

-     * @see #isJavaDocVersionAtLeast(float)

+     * @see #isJavaDocVersionAtLeast(JavaVersion)

      */

     private void addArgIfNotEmpty( List<String> arguments, String key, String value, boolean repeatKey,

-                                   boolean splitValue, JavadocVersion requiredJavaVersion )

+                                   boolean splitValue, JavaVersion requiredJavaVersion )

     {

         if ( StringUtils.isNotEmpty( value ) )

         {

@@ -3975,10 +3990,10 @@
      * @param key                 the argument name.

      * @param value               the argument value to be added.

      * @param requiredJavaVersion the required Java version, for example 1.31f or 1.4f

-     * @see #addArgIfNotEmpty(java.util.List, String, String, float, boolean)

+     * @see #addArgIfNotEmpty(List, String, String, JavaVersion, boolean)

      */

     private void addArgIfNotEmpty( List<String> arguments, String key, String value,

-                                   JavadocVersion requiredJavaVersion )

+                                   JavaVersion requiredJavaVersion )

     {

         addArgIfNotEmpty( arguments, key, value, requiredJavaVersion, false );

     }

@@ -3992,10 +4007,10 @@
      * @param value               the argument value to be added.

      * @param requiredJavaVersion the required Java version, for example 1.31f or 1.4f

      * @param repeatKey           repeat or not the key in the command line

-     * @see #addArgIfNotEmpty(java.util.List, String, String)

-     * @see #isJavaDocVersionAtLeast(float)

+     * @see #addArgIfNotEmpty(List, String, String)

+     * @see #isJavaDocVersionAtLeast

      */

-    private void addArgIfNotEmpty( List<String> arguments, String key, String value, JavadocVersion requiredJavaVersion,

+    private void addArgIfNotEmpty( List<String> arguments, String key, String value, JavaVersion requiredJavaVersion,

                                    boolean repeatKey )

     {

         if ( StringUtils.isNotEmpty( value ) )

@@ -4087,6 +4102,11 @@
             {

                 continue;

             }

+            

+            if ( isOffline && !link.startsWith( "file:" ) )

+            {

+                continue;

+            }

 

             while ( link.endsWith( "/" ) )

             {

@@ -4219,9 +4239,9 @@
             JavadocUtil.copyJavadocResources( anOutputDirectory, getJavadocDirectory(), excludedocfilessubdir );

         }

 

-        if ( isAggregator() && project.isExecutionRoot() )

+        if ( isAggregator() )

         {

-            for ( MavenProject subProject : reactorProjects )

+            for ( MavenProject subProject : getAggregatedProjects()  )

             {

                 if ( subProject != project && getJavadocDirectory() != null )

                 {

@@ -4313,31 +4333,53 @@
      * @param files       not null

      * @return the list of package names for files in the sourcePaths

      */

-    private List<String> getPackageNames( Collection<String> sourcePaths, List<String> files )

+    private List<String> getPackageNames( Map<Path, Collection<String>> sourcePaths )

     {

-        return getPackageNamesOrFilesWithUnnamedPackages( sourcePaths, files, true );

+        List<String> returnList = new ArrayList<>();

+        

+        if ( !StringUtils.isEmpty( sourcepath ) )

+        {

+            return returnList;

+        }

+        

+        for ( Entry<Path, Collection<String>> currentPathEntry : sourcePaths.entrySet() )

+        {

+            for ( String currentFile : currentPathEntry.getValue() )

+            {

+                /*

+                 * Remove the miscellaneous files

+                 * http://docs.oracle.com/javase/1.4.2/docs/tooldocs/solaris/javadoc.html#unprocessed

+                 */

+                if ( currentFile.contains( "doc-files" ) )

+                {

+                    continue;

+                }

+        

+                int lastIndexOfSeparator = currentFile.lastIndexOf( "/" );

+                if ( lastIndexOfSeparator != -1 )

+                {

+                    String packagename = currentFile.substring( 0, lastIndexOfSeparator ).replace( '/', '.' );

+        

+                    if ( !returnList.contains( packagename ) )

+                    {

+                        returnList.add( packagename );

+                    }

+                }

+            }

+        }

+        

+        return returnList;

     }

 

     /**

-     * @param sourcePaths could be null

-     * @param files       not null

-     * @return a list files with unnamed package names for files in the sourecPaths

-     */

-    private List<String> getFilesWithUnnamedPackages( Collection<String> sourcePaths, List<String> files )

-    {

-        return getPackageNamesOrFilesWithUnnamedPackages( sourcePaths, files, false );

-    }

-

-    /**

-     * @param sourcePaths     not null, containing absolute and relative paths

-     * @param files           not null, containing list of quoted files

-     * @param onlyPackageName boolean for only package name

-     * @return a list of package names or files with unnamed package names, depending the value of the unnamed flag

-     * @see #getFiles(List)

+     * @param allSourcePaths     not null, containing absolute and relative paths

+     * @return a list of exported package names for files in allSourcePaths

+     * @throws MavenReportException if any

+     * @see #getFiles

      * @see #getSourcePaths()

      */

-    private List<String> getPackageNamesOrFilesWithUnnamedPackages( Collection<String> sourcePaths, List<String> files,

-                                                                    boolean onlyPackageName )

+    private List<String> getPackageNamesRespectingJavaModules( Map<String, Collection<Path>> allSourcePaths )

+            throws MavenReportException

     {

         List<String> returnList = new ArrayList<>();

 

@@ -4345,47 +4387,67 @@
         {

             return returnList;

         }

+        LocationManager locationManager = new LocationManager();

 

-        for ( String currentFile : files )

+        for ( Collection<Path> artifactSourcePaths: allSourcePaths.values() )

         {

-            currentFile = currentFile.replace( '\\', '/' );

-

-            for ( String currentSourcePath : sourcePaths )

+            Set<String> exportedPackages = new HashSet<>();

+            boolean exportAllPackages;

+            File mainDescriptor = findMainDescriptor( artifactSourcePaths );

+            if ( mainDescriptor != null && !isTest() )

             {

-                currentSourcePath = currentSourcePath.replace( '\\', '/' );

-

-                if ( !currentSourcePath.endsWith( "/" ) )

+                ResolvePathsRequest<File> request =

+                        ResolvePathsRequest.withFiles( Collections.<File>emptyList() ).

+                                setMainModuleDescriptor( mainDescriptor );

+    

+                try

                 {

-                    currentSourcePath += "/";

+                    Set<JavaModuleDescriptor.JavaExports> exports = locationManager.resolvePaths( request ).

+                            getMainModuleDescriptor().exports();

+                    if ( exports.isEmpty() )

+                    {

+                        continue;

+                    }

+                    for ( JavaModuleDescriptor.JavaExports export : exports )

+                    {

+                        exportedPackages.add( export.source() );

+                    }

                 }

-

-                if ( currentFile.contains( currentSourcePath ) )

+                catch ( IOException e )

                 {

-                    String packagename = currentFile.substring( currentSourcePath.length() + 1 );

-

+                    throw new MavenReportException( e.getMessage(), e );

+                }

+                exportAllPackages = false;

+            }

+            else

+            {

+                exportAllPackages = true;

+            }

+            

+            for ( Map.Entry<Path, Collection<String>> currentPathEntry : getFiles( artifactSourcePaths ).entrySet() )

+            {

+                for ( String currentFile : currentPathEntry.getValue() )

+                {

                     /*

                      * Remove the miscellaneous files

                      * http://docs.oracle.com/javase/1.4.2/docs/tooldocs/solaris/javadoc.html#unprocessed

                      */

-                    if ( packagename.contains( "doc-files" ) )

+                    if ( currentFile.contains( "doc-files" ) )

                     {

                         continue;

                     }

 

-                    if ( onlyPackageName && packagename.lastIndexOf( "/" ) != -1 )

+                    int lastIndexOfSeparator = currentFile.lastIndexOf( File.separatorChar );

+                    if ( lastIndexOfSeparator != -1 )

                     {

-                        packagename = packagename.substring( 0, packagename.lastIndexOf( "/" ) );

-                        packagename = packagename.replace( '/', '.' );

+                        String packagename =

+                            currentFile.substring( 0, lastIndexOfSeparator ).replace( File.separatorChar, '.' );

 

-                        if ( !returnList.contains( packagename ) )

+                        if ( exportAllPackages || exportedPackages.contains( packagename ) )

                         {

                             returnList.add( packagename );

                         }

                     }

-                    if ( !onlyPackageName && packagename.lastIndexOf( "/" ) == -1 )

-                    {

-                        returnList.add( currentFile );

-                    }

                 }

             }

         }

@@ -4394,6 +4456,109 @@
     }

 

     /**

+     * @param sourcePaths could be null

+     * @param files       not null

+     * @return a list files with unnamed package names for files in the sourcePaths

+     */

+    private List<String> getFilesWithUnnamedPackages( Map<Path, Collection<String>> sourcePaths )

+    {

+        List<String> returnList = new ArrayList<>();

+        

+        if ( !StringUtils.isEmpty( sourcepath ) )

+        {

+            return returnList;

+        }

+        

+        for ( Entry<Path, Collection<String>> currentPathEntry : sourcePaths.entrySet() )

+        {

+            Path currentSourcePath = currentPathEntry.getKey();

+        

+            for ( String currentFile : currentPathEntry.getValue() )

+            {

+                /*

+                 * Remove the miscellaneous files

+                 * http://docs.oracle.com/javase/1.4.2/docs/tooldocs/solaris/javadoc.html#unprocessed

+                 */

+                if ( currentFile.contains( "doc-files" ) )

+                {

+                    continue;

+                }

+        

+                if ( currentFile.indexOf( File.separatorChar ) == -1 )

+                {

+                    returnList.add( currentSourcePath.resolve( currentFile ).toAbsolutePath().toString() );

+                }

+            }

+        }

+        

+        return returnList;

+    }

+    

+    /**

+     * Either return only the module descriptor or all sourcefiles per sourcepath

+     * @param sourcePaths could be null

+     * @param files       not null

+     * @return a list of files

+     */

+    private List<String> getSpecialFiles( Map<Path, Collection<String>> sourcePaths )

+    {

+        if ( !StringUtils.isEmpty( sourcepath ) )

+        {

+            return new ArrayList<>();

+        }

+        

+        boolean containsModuleDescriptor = false;

+        for ( Collection<String> sourcepathFiles : sourcePaths.values() )

+        {

+            containsModuleDescriptor = sourcepathFiles.contains( "module-info.java" );

+            if ( containsModuleDescriptor )

+            {

+                break;

+            }

+        }

+        

+        if ( containsModuleDescriptor )

+        {

+            return getModuleSourcePathFiles( sourcePaths );

+        }

+        else

+        {

+            return getFilesWithUnnamedPackages( sourcePaths );

+        }

+    }

+

+    private List<String> getModuleSourcePathFiles( Map<Path, Collection<String>> sourcePaths )

+    {

+        List<String> returnList = new ArrayList<>();

+        

+        for ( Entry<Path, Collection<String>> currentPathEntry : sourcePaths.entrySet() )

+        {

+            Path currentSourcePath = currentPathEntry.getKey();

+            if ( currentPathEntry.getValue().contains( "module-info.java" ) )

+            {

+                returnList.add( currentSourcePath.resolve( "module-info.java" ).toAbsolutePath().toString() );

+            }

+            else

+            {

+                for ( String currentFile : currentPathEntry.getValue() )

+                {

+                    /*

+                     * Remove the miscellaneous files

+                     * http://docs.oracle.com/javase/1.4.2/docs/tooldocs/solaris/javadoc.html#unprocessed

+                     */

+                    if ( currentFile.contains( "doc-files" ) )

+                    {

+                        continue;

+                    }

+            

+                    returnList.add( currentSourcePath.resolve( currentFile ).toAbsolutePath().toString() );

+                }

+            }

+        }

+        return returnList;

+    }

+

+    /**

      * Generate an <code>options</code> file for all options and arguments and add the <code>@options</code> in the

      * command line.

      *

@@ -4411,12 +4576,18 @@
         File optionsFile = new File( javadocOutputDirectory, OPTIONS_FILE_NAME );

 

         StringBuilder options = new StringBuilder();

-        options.append( StringUtils.join( arguments.toArray( new String[arguments.size()] ),

+        options.append( StringUtils.join( arguments.iterator(),

                                           SystemUtils.LINE_SEPARATOR ) );

 

+        /* default to platform encoding */

+        String outputFileEncoding = null;

+        if ( JAVA_VERSION.isAtLeast( "9" ) )

+        {

+            outputFileEncoding = StandardCharsets.UTF_8.name();

+        }

         try

         {

-            FileUtils.fileWrite( optionsFile.getAbsolutePath(), null /* platform encoding */, options.toString() );

+            FileUtils.fileWrite( optionsFile.getAbsolutePath(), outputFileEncoding, options.toString() );

         }

         catch ( IOException e )

         {

@@ -4441,7 +4612,7 @@
      * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/whatsnew-1.4.html#runningjavadoc">

      *      What s New in Javadoc 1.4

      *      </a>

-     * @see #isJavaDocVersionAtLeast(float)

+     * @see #isJavaDocVersionAtLeast(JavaVersion)

      * @see #ARGFILE_FILE_NAME

      * @see #FILES_FILE_NAME

      */

@@ -4460,10 +4631,16 @@
             cmd.createArg().setValue( "@" + FILES_FILE_NAME );

         }

 

+        List<String> quotedFiles = new ArrayList<>( files.size() );

+        for ( String file : files )

+        {

+            quotedFiles.add( JavadocUtil.quotedPathArgument( file ) );

+        }

+        

         try

         {

             FileUtils.fileWrite( argfileFile.getAbsolutePath(), null /* platform encoding */,

-                                 StringUtils.join( files.iterator(), SystemUtils.LINE_SEPARATOR ) );

+                                 StringUtils.join( quotedFiles.iterator(), SystemUtils.LINE_SEPARATOR ) );

         }

         catch ( IOException e )

         {

@@ -4634,12 +4811,6 @@
         {

             throw new MavenReportException( "Option <stylesheet/> supports only \"maven\" or \"java\" value." );

         }

-

-        // default java api links

-        if ( javaApiLinks == null || javaApiLinks.size() == 0 )

-        {

-            javaApiLinks = DEFAULT_JAVA_API_LINKS;

-        }

     }

 

     /**

@@ -4649,17 +4820,17 @@
      * Standard Javadoc Options wrapped by this Plugin.

      *

      * @param javadocOutputDirectory not null

-     * @param arguments   not null

-     * @param sourcePaths not null

+     * @param arguments              not null

+     * @param allSourcePaths         not null

      * @throws MavenReportException if any

      * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#javadocoptions">http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#javadocoptions</a>

      */

     private void addJavadocOptions( File javadocOutputDirectory,

                                     List<String> arguments,

-                                    Map<String, Collection<String>> allSourcePaths )

+                                    Map<String, Collection<Path>> allSourcePaths )

         throws MavenReportException

     {

-        Collection<String> sourcePaths = collect( allSourcePaths.values() );

+        Collection<Path> sourcePaths = collect( allSourcePaths.values() );

         

         validateJavadocOptions();

 

@@ -4686,82 +4857,102 @@
         {

             addArgIf( arguments, breakiterator, "-breakiterator", SINCE_JAVADOC_1_5 );

         }

-

-        List<String> roots = getProjectSourceRoots( getProject() );

         

-        File mainDescriptor = findMainDescriptor( roots );

-

-        final LocationManager locationManager = new LocationManager();

-

-        if ( mainDescriptor != null && !isTest() )

-        {

-            ResolvePathsRequest<File> request =

-                ResolvePathsRequest.withFiles( getPathElements() ).setMainModuleDescriptor( mainDescriptor );

-            try

-            {

-                ResolvePathsResult<File> result = locationManager.resolvePaths( request );

-

-                String classpath = StringUtils.join( result.getClasspathElements().iterator(), File.pathSeparator );

-                addArgIfNotEmpty( arguments, "--class-path", JavadocUtil.quotedPathArgument( classpath ) );

-

-                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() ) );

-                }

-                

-                String modulepath =

-                    StringUtils.join( modulePathElements.iterator(), File.pathSeparator );

-                addArgIfNotEmpty( arguments, "--module-path", JavadocUtil.quotedPathArgument( modulepath ) );

-            }

-            catch ( IOException e )

-            {

-                throw new MavenReportException( e.getMessage(), e );

-            }

-        }

-        else

-        {

-            String classpath = StringUtils.join( getPathElements().iterator(), File.pathSeparator );

-            addArgIfNotEmpty( arguments, "-classpath", JavadocUtil.quotedPathArgument( classpath ) );

-        }

-

-        Collection<String> reactorKeys = new HashSet<>( session.getProjects().size() );

+        Map<String, MavenProject> reactorKeys = new HashMap<>( session.getProjects().size() );

         for ( MavenProject reactorProject : session.getProjects() )

         {

-            reactorKeys.add( ArtifactUtils.versionlessKey( reactorProject.getGroupId(),

-                                                           reactorProject.getArtifactId() ) );

+            reactorKeys.put( ArtifactUtils.versionlessKey( reactorProject.getGroupId(),

+                                                           reactorProject.getArtifactId() ), reactorProject );

         }

         

-        Path moduleSourceDir = null;

-        if ( allSourcePaths.size() > 1 )

+        final LocationManager locationManager = new LocationManager();

+        

+        Collection<String> additionalModules = new ArrayList<>();

+        

+        boolean containsModuleDescriptor = false;

+        for ( Collection<Path> sourcepaths : allSourcePaths.values() )

         {

-            for ( Map.Entry<String, Collection<String>> projectSourcepaths : allSourcePaths.entrySet() )

+            if ( findMainDescriptor( sourcepaths ) != null )

             {

-                if ( reactorKeys.contains( projectSourcepaths.getKey() ) )

+                containsModuleDescriptor = true;

+            }

+        }

+        

+        

+        Path moduleSourceDir = null;

+        if ( containsModuleDescriptor && allSourcePaths.size() > 1 )

+        {

+            for ( Map.Entry<String, Collection<Path>> projectSourcepaths : allSourcePaths.entrySet() )

+            {

+                MavenProject aggregatorProject = reactorKeys.get( projectSourcepaths.getKey() );

+                if ( aggregatorProject != null )

                 {

-                    File moduleDescriptor = findMainDescriptor( projectSourcepaths.getValue() );

-                    if ( moduleDescriptor != null )

+                    String moduleName = null;

+                    

+                    // Prefer jar over outputDirectory, since it may may contain an automatic module name

+                    File artifactFile = getArtifactFile( aggregatorProject );

+                    if ( artifactFile != null ) 

+                    {

+                        ResolvePathRequest<File> request = ResolvePathRequest.ofFile( artifactFile );

+                        try

+                        {

+                            moduleName = locationManager.resolvePath( request ).getModuleDescriptor().name();

+                        }

+                        catch ( RuntimeException e )

+                        {

+                            // most likely an invalid module name based on filename

+                            if ( !"java.lang.module.FindException".equals( e.getClass().getName() ) )

+                            {

+                                throw e;

+                            }

+                        }

+                        catch ( IOException e )

+                        {

+                            throw new MavenReportException( e.getMessage(), e );

+                        }

+                    }

+                    else

+                    {

+                        File moduleDescriptor = findMainDescriptor( projectSourcepaths.getValue() );

+                        

+                        if ( moduleDescriptor != null )

+                        {

+                            ResolvePathsRequest<File> request =

+                                            ResolvePathsRequest.ofFiles( Collections.<File>emptyList() )

+                                                               .setMainModuleDescriptor( moduleDescriptor );

+

+                            try

+                            {

+                                moduleName =

+                                    locationManager.resolvePaths( request ).getMainModuleDescriptor().name();

+                            }

+                            catch ( IOException e )

+                            {

+                                throw new MavenReportException( e.getMessage(), e );

+                            }

+                        }

+                    }

+                    if ( moduleName != null )

                     {

                         moduleSourceDir = javadocOutputDirectory.toPath().resolve( "src" );

                         try

                         {

                             moduleSourceDir = Files.createDirectories( moduleSourceDir );

-                            ResolvePathsRequest<File> request =

-                                ResolvePathsRequest.withFiles( Collections.<File>emptyList() )

-                                                   .setMainModuleDescriptor( moduleDescriptor );

                             

-                            String moduleName =

-                                locationManager.resolvePaths( request ).getMainModuleDescriptor().name();

+                            additionalModules.add( moduleName );

                             

                             addArgIfNotEmpty( arguments, "--patch-module", moduleName + '='

                                 + JavadocUtil.quotedPathArgument( getSourcePath( projectSourcepaths.getValue() ) ) );

                             

-                            Files.createDirectory( moduleSourceDir.resolve( moduleName ) );

+                            Path modulePath = moduleSourceDir.resolve( moduleName );

+                            if ( !Files.isDirectory( modulePath ) )

+                            {

+                                Files.createDirectory( modulePath );

+                            }

                         }

                         catch ( IOException e )

                         {

-                            throw new MavenReportException( e.getMessage() );

+                            throw new MavenReportException( e.getMessage(), e );

                         }

                     }

                     else

@@ -4778,6 +4969,66 @@
                 }

             }

         }

+

+        Collection<Path> roots = new ArrayList<>();

+        for ( String path : getProjectSourceRoots( getProject() ) )

+        {

+            roots.add( Paths.get( path ) );

+        }

+        

+        File mainDescriptor = findMainDescriptor( roots );

+

+        if ( javadocRuntimeVersion.isAtLeast( "9" ) && ( isAggregator() || mainDescriptor != null ) && !isTest() )

+        {

+            ResolvePathsRequest<File> request =

+                ResolvePathsRequest.ofFiles( getPathElements() ).setAdditionalModules( additionalModules );

+            

+            if ( mainDescriptor != null )

+            {

+                request.setMainModuleDescriptor( mainDescriptor );

+            }

+            

+            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() ) );

+                }

+

+                Collection<File> classPathElements = new ArrayList<>( result.getClasspathElements().size() );

+                for ( File file : result.getClasspathElements() )

+                {

+                    if ( file.isDirectory() && new File( file, "module-info.class" ).exists() )

+                    {

+                        modulePathElements.add( file );

+                    }

+                    else

+                    {

+                        classPathElements.add( file );

+                    }

+                }

+                

+                String classpath = StringUtils.join( classPathElements.iterator(), File.pathSeparator );

+                addArgIfNotEmpty( arguments, "--class-path", JavadocUtil.quotedPathArgument( classpath ) );

+                

+                String modulepath =

+                    StringUtils.join( modulePathElements.iterator(), File.pathSeparator );

+                addArgIfNotEmpty( arguments, "--module-path", JavadocUtil.quotedPathArgument( modulepath ) );

+            }

+            catch ( IOException e )

+            {

+                throw new MavenReportException( e.getMessage(), e );

+            }

+        }

+        else

+        {

+            String classpath = StringUtils.join( getPathElements().iterator(), File.pathSeparator );

+            addArgIfNotEmpty( arguments, "-classpath", JavadocUtil.quotedPathArgument( classpath ) );

+        }

         

         if ( StringUtils.isNotEmpty( doclet ) )

         {

@@ -4809,7 +5060,15 @@
             addArgIf( arguments, quiet, "-quiet", SINCE_JAVADOC_1_5 );

         }

 

-        addArgIfNotEmpty( arguments, "-source", JavadocUtil.quotedArgument( source ), SINCE_JAVADOC_1_4 );

+        if ( release != null )

+        {

+            arguments.add( "--release" );

+            arguments.add( release );

+        }

+        else

+        {

+            addArgIfNotEmpty( arguments, "-source", JavadocUtil.quotedArgument( source ), SINCE_JAVADOC_1_4 );

+        }

 

         if ( ( StringUtils.isEmpty( sourcepath ) ) && ( StringUtils.isNotEmpty( subpackages ) ) )

         {

@@ -4840,18 +5099,15 @@
 

         if ( additionalOptions != null && additionalOptions.length > 0 )

         {

-            for ( String option : additionalOptions )

-            {

-                arguments.add( option );

-            }

+            Collections.addAll( arguments, additionalOptions );

         }

     }

 

-    private File findMainDescriptor( Collection<String> roots )

+    private File findMainDescriptor( Collection<Path> roots )

     {

-        for ( String root : roots )

+        for ( Path root : roots )

         {

-            File descriptorFile = new File( root, "module-info.java" ).getAbsoluteFile();

+            File descriptorFile = root.resolve( "module-info.java" ).toAbsolutePath().toFile();

             if ( descriptorFile.exists() )

             {

                 return descriptorFile;

@@ -4917,10 +5173,7 @@
 

         addArgIf( arguments, keywords, "-keywords", SINCE_JAVADOC_1_4_2 );

 

-        if ( !isOffline )

-        {

-            addLinkArguments( arguments );

-        }

+        addLinkArguments( arguments );

 

         addLinkofflineArguments( arguments );

 

@@ -5257,8 +5510,8 @@
             writeDebugJavadocScript( cmdLine, javadocOutputDirectory );

         }

 

-        CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer();

-        CommandLineUtils.StringStreamConsumer out = new CommandLineUtils.StringStreamConsumer();

+        CommandLineUtils.StringStreamConsumer err = new JavadocUtil.JavadocOutputStreamConsumer();

+        CommandLineUtils.StringStreamConsumer out = new JavadocUtil.JavadocOutputStreamConsumer();

         try

         {

             int exitCode = CommandLineUtils.executeCommandLine( cmd, out, err );

@@ -5685,7 +5938,7 @@
      * @return the detected Javadoc links using the Maven conventions for all dependencies defined in the current

      *         project or an empty list.

      * @see #detectLinks

-     * @see #isValidJavadocLink(String)

+     * @see #isValidJavadocLink

      * @since 2.6

      */

     private List<String> getDependenciesLinks()

@@ -5745,53 +5998,72 @@
      * @see <a href="http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#source">source parameter</a>

      * @since 2.6

      */

-    private OfflineLink getDefaultJavadocApiLink()

+    protected final OfflineLink getDefaultJavadocApiLink()

     {

         if ( !detectJavaApiLink )

         {

             return null;

         }

 

-        final String pluginId = "org.apache.maven.plugins:maven-compiler-plugin";

-        JavadocVersion sourceVersion = javadocRuntimeVersion;

-        String sourceConfigured = getPluginParameter( project, pluginId, "source" );

-        if ( sourceConfigured != null )

+        final JavaVersion javaApiversion;

+        if ( release != null )

         {

-            try

-            {

-                sourceVersion = JavadocVersion.parse( sourceConfigured );

-            }

-            catch ( NumberFormatException e )

-            {

-                getLog().debug(

-                    "NumberFormatException for the source parameter in the maven-compiler-plugin. " + "Ignored it", e );

-            }

+            javaApiversion = JavaVersion.parse( release );

         }

         else

         {

-            getLog().debug( "No maven-compiler-plugin defined in ${build.plugins} or in "

-                                + "${project.build.pluginManagement} for the " + project.getId()

-                                + ". Added Javadoc API link according the javadoc executable version i.e.: "

-                                + javadocRuntimeVersion );

+            final String pluginId = "org.apache.maven.plugins:maven-compiler-plugin";

+            String sourceConfigured = getPluginParameter( project, pluginId, "source" );

+            if ( sourceConfigured != null )

+            {

+                javaApiversion = JavaVersion.parse( sourceConfigured );

+            }

+            else

+            {

+                getLog().debug( "No maven-compiler-plugin defined in ${build.plugins} or in "

+                                    + "${project.build.pluginManagement} for the " + project.getId()

+                                    + ". Added Javadoc API link according the javadoc executable version i.e.: "

+                                    + javadocRuntimeVersion );

+                

+                javaApiversion = javadocRuntimeVersion;

+            }

         }

-

-        String apiVersion;

         

-        Matcher apiMatcher = Pattern.compile( "(1\\.\\d|\\d\\d*)" ).matcher( sourceVersion.toString() );

-        if ( apiMatcher.find() )

+        final String javaApiKey;

+        if ( javaApiversion.asMajor().isAtLeast( "9" ) )

         {

-            apiVersion = apiMatcher.group( 1 );

+            javaApiKey = "api_" + javaApiversion.asMajor();

         }

         else

         {

-            apiVersion = null;

+            javaApiKey = "api_1." + javaApiversion.asMajor().toString().charAt( 0 );

         }

-

-        String javaApiLink = javaApiLinks.getProperty( "api_" + apiVersion, null );

-

+        

+        final String javaApiLink;

+        if ( javaApiLinks != null && javaApiLinks.containsKey( javaApiKey ) )

+        {

+            javaApiLink = javaApiLinks.getProperty( javaApiKey );  

+        }

+        else if ( javaApiversion.isAtLeast( "11" ) )

+        {

+            javaApiLink = String.format( "https://docs.oracle.com/en/java/javase/%s/docs/api/", javaApiversion );

+        }

+        else if ( javaApiversion.asMajor().isAtLeast( "6" ) )

+        {

+            javaApiLink = String.format( "https://docs.oracle.com/javase/%s/docs/api/", javaApiversion.asMajor() );

+        }

+        else if ( javaApiversion.isAtLeast( "1.5" ) )

+        {

+            javaApiLink = "https://docs.oracle.com/javase/1.5.0/docs/api/";

+        }

+        else

+        {

+            javaApiLink = null;

+        }

+        

         if ( getLog().isDebugEnabled() )

         {

-            if ( StringUtils.isNotEmpty( javaApiLink ) )

+            if ( javaApiLink != null )

             {

                 getLog().debug( "Found Java API link: " + javaApiLink );

             }

@@ -5806,39 +6078,68 @@
             return null;

         }

 

-        File javaApiPackageListFile = new File( getJavadocOptionsFile().getParentFile(), "package-list" );

+        final Path javaApiListFile;

+        final String resourceName;

+        if ( javaApiversion.isAtLeast( "10" ) )

+        {

+            javaApiListFile = getJavadocOptionsFile().getParentFile().toPath().resolve( "element-list" );

+            resourceName = "java-api-element-list-" + javaApiversion.toString().substring( 0, 2 );

+        }

+        else if ( javaApiversion.asMajor().isAtLeast( "9" ) )

+        {

+            javaApiListFile = getJavadocOptionsFile().getParentFile().toPath().resolve( "package-list" );

+            resourceName = "java-api-package-list-9";

+        }

+        else

+        {

+            javaApiListFile = getJavadocOptionsFile().getParentFile().toPath().resolve( "package-list" );

+            resourceName = "java-api-package-list-1." + javaApiversion.asMajor().toString().charAt( 0 );

+        }

 

         OfflineLink link = new OfflineLink();

-        link.setLocation( javaApiPackageListFile.getParentFile().getAbsolutePath() );

+        link.setLocation( javaApiListFile.getParent().toAbsolutePath().toString() );

         link.setUrl( javaApiLink );

 

-        InputStream in = null;

-        OutputStream out = null;

-        try

+        try ( InputStream in = this.getClass().getResourceAsStream( resourceName ) )

         {

-            in = this.getClass().getResourceAsStream( "java-api-package-list-" + apiVersion );

-            out = new FileOutputStream( javaApiPackageListFile );

-            IOUtil.copy( in, out );

-            out.close();

-            out = null;

-            in.close();

-            in = null;

+            // TODO only copy when changed

+            Files.copy( in, javaApiListFile, StandardCopyOption.REPLACE_EXISTING );

         }

         catch ( IOException ioe )

         {

-            logError( "Can't get java-api-package-list-" + apiVersion + ": " + ioe.getMessage(), ioe );

+            logError( "Can't get " + resourceName + ": " + ioe.getMessage(), ioe );

             return null;

         }

-        finally

-        {

-            IOUtil.close( in );

-            IOUtil.close( out );

-        }

 

         return link;

     }

 

     /**

+     * Follows all of the given links, and returns their last redirect locations. Ordering is kept.

+     * This is necessary because javadoc tool doesn't follow links, see JDK-8190312 (MJAVADOC-427, MJAVADOC-487)

+     *

+     * @param links Links to follow.

+     * @return Last redirect location of all the links.

+     */

+    private Set<String> followLinks( Set<String> links )

+    {

+        Set<String> redirectLinks = new LinkedHashSet<>( links.size() );

+        for ( String link : links )

+        {

+            try

+            {

+                redirectLinks.add( JavadocUtil.getRedirectUrl( new URI( link ).toURL(), settings ).toString() );

+            }

+            catch ( Exception e )

+            {

+                // only print in debug, it should have been logged already in warn/error because link isn't valid

+                getLog().debug( "Could not follow " + link + ". Reason: " + e.getMessage() );

+            }

+        }

+        return redirectLinks;

+    }

+

+    /**

      * @param link not null

      * @param detecting <code>true</code> if the link is generated by

      * <code>detectLinks</code>, or <code>false</code> otherwise

@@ -5851,12 +6152,15 @@
     {

         try

         {

-            URI linkUri;

+            final URI packageListUri;

+            final URI elementListUri;

+            

             if ( link.trim().toLowerCase( Locale.ENGLISH ).startsWith( "http:" ) || link.trim().toLowerCase(

                 Locale.ENGLISH ).startsWith( "https:" ) || link.trim().toLowerCase( Locale.ENGLISH ).startsWith(

                 "ftp:" ) || link.trim().toLowerCase( Locale.ENGLISH ).startsWith( "file:" ) )

             {

-                linkUri = new URI( link + "/package-list" );

+                packageListUri = new URI( link + '/' + PACKAGE_LIST );

+                elementListUri = new URI( link + '/' + ELEMENT_LIST );

             }

             else

             {

@@ -5877,27 +6181,44 @@
                         getLog().error( "The given File link: " + dir + " is not a dir." );

                     }

                 }

-                linkUri = new File( dir, "package-list" ).toURI();

+                packageListUri = new File( dir, PACKAGE_LIST ).toURI();

+                elementListUri = new File( dir, ELEMENT_LIST ).toURI();

             }

 

-            if ( !JavadocUtil.isValidPackageList( linkUri.toURL(), settings, validateLinks ) )

+            

+            IOException elementListIOException = null;

+            try 

             {

-                if ( getLog().isErrorEnabled() )

+                if ( JavadocUtil.isValidElementList( elementListUri.toURL(), settings, validateLinks ) )

                 {

-                    if ( detecting )

-                    {

-                        getLog().warn( "Invalid link: " + link + "/package-list. Ignored it." );

-                    }

-                    else

-                    {

-                        getLog().error( "Invalid link: " + link + "/package-list. Ignored it." );

-                    }

+                    return true;

                 }

-

-                return false;

+            }

+            catch ( IOException e ) 

+            {

+                elementListIOException = e;

+            }

+            

+            if ( JavadocUtil.isValidPackageList( packageListUri.toURL(), settings, validateLinks ) )

+            {

+                return true;

             }

 

-            return true;

+            if ( getLog().isErrorEnabled() )

+            {

+                if ( detecting )

+                {

+                    getLog().warn( "Invalid links: "

+                                    + link + " with /" + PACKAGE_LIST + " or / " + ELEMENT_LIST + ". Ignored it." );

+                }

+                else

+                {

+                    getLog().error( "Invalid links: " 

+                                    + link + " with /" + PACKAGE_LIST + " or / " + ELEMENT_LIST + ". Ignored it." );

+                }

+            }

+

+            return false;

         }

         catch ( URISyntaxException e )

         {

@@ -5905,11 +6226,11 @@
             {

                 if ( detecting )

                 {

-                    getLog().warn( "Malformed link: " + link + "/package-list. Ignored it." );

+                    getLog().warn( "Malformed link: " + e.getInput() + ". Ignored it." );

                 }

                 else

                 {

-                    getLog().error( "Malformed link: " + link + "/package-list. Ignored it." );

+                    getLog().error( "Malformed link: " + e.getInput() + ". Ignored it." );

                 }

             }

             return false;

@@ -5920,11 +6241,11 @@
             {

                 if ( detecting )

                 {

-                    getLog().warn( "Error fetching link: " + link + "/package-list. Ignored it." );

+                    getLog().warn( "Error fetching link: " + link + ". Ignored it." );

                 }

                 else

                 {

-                    getLog().error( "Error fetching link: " + link + "/package-list. Ignored it." );

+                    getLog().error( "Error fetching link: " + link + ". Ignored it." );

                 }

             }

             return false;

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocJar.java b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocJar.java
index 3478bce..9e4f3cc 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocJar.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocJar.java
@@ -25,10 +25,11 @@
 import org.apache.maven.plugins.annotations.ResolutionScope;

 

 /**

- * Bundles the Javadoc documentation for main <code>Java code</code> in an <b>aggregator</b> project into a jar

- * using the standard <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.

+ * <p>Bundles the Javadoc documentation for main <code>Java code</code> in an <b>aggregator</b> project into a jar

+ * using the standard <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.</p>

  *

- * @version $Id: AggregatorJavadocJar.java 1749408 2016-06-20 22:54:15Z schulte $

+ * <p>Since version 3.1.0 an aggregated jar is created for every module of a Maven multimodule project.</p>

+ * 

  * @since 2.6

  */

 @Mojo( name = "aggregate-jar", defaultPhase = LifecyclePhase.PACKAGE, aggregator = true,

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReport.java b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReport.java
index 27e0641..0f42aa2 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReport.java
@@ -25,11 +25,12 @@
 import org.apache.maven.plugins.annotations.ResolutionScope;

 

 /**

- * Generates documentation for the <code>Java code</code> in an <b>aggregator</b> project using the standard

- * <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.

+ * <p>Generates documentation for the <code>Java code</code> in an <b>aggregator</b> project using the standard

+ * <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.</p>

+ * 

+ * <p>Since version 3.1.0 an aggregated report is created for every module of a Maven multimodule project.</p> 

  *

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: AggregatorJavadocReport.java 1749408 2016-06-20 22:54:15Z schulte $

  * @since 2.5

  */

 @Mojo( name = "aggregate", aggregator = true, requiresDependencyResolution = ResolutionScope.COMPILE )

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocJar.java b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocJar.java
index 7f8158f..e25e0a4 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocJar.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocJar.java
@@ -25,10 +25,11 @@
 import org.apache.maven.plugins.annotations.ResolutionScope;

 

 /**

- * Bundles the Javadoc documentation for <code>Java Test code</code> in an <b>aggregator</b> project into a jar

- * using the standard <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.

- *

- * @version $Id: AggregatorTestJavadocJar.java 1749408 2016-06-20 22:54:15Z schulte $

+ * <p>Bundles the Javadoc documentation for <code>Java Test code</code> in an <b>aggregator</b> project into a jar

+ * using the standard <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.</p>

+ * 

+ * <p>Since version 3.1.0 an aggregated jar is created for every module of a Maven multimodule project.</p>

+ * 

  * @since 2.6

  */

 @Mojo( name = "test-aggregate-jar", defaultPhase = LifecyclePhase.PACKAGE, aggregator = true,

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocReport.java b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocReport.java
index 8968ce3..8bf44d9 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AggregatorTestJavadocReport.java
@@ -25,11 +25,12 @@
 import org.apache.maven.plugins.annotations.ResolutionScope;

 

 /**

- * Generates documentation for the <code>Java Test code</code> in an <b>aggregator</b> project using the standard

- * <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.

+ * <p>Generates documentation for the <code>Java Test code</code> in an <b>aggregator</b> project using the standard

+ * <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.</p>

  *

+ * <p>Since version 3.1.0 an aggregated report is created for every module of a Maven multimodule project.</p>

+ * 

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: AggregatorTestJavadocReport.java 1749408 2016-06-20 22:54:15Z schulte $

  * @since 2.5

  */

 @Mojo( name = "test-aggregate", aggregator = true, requiresDependencyResolution = ResolutionScope.TEST )

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/FixJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/FixJavadocMojo.java
index 0876175..128c04d 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/FixJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/FixJavadocMojo.java
@@ -30,7 +30,6 @@
  * Be Used</a>.

  *

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: FixJavadocMojo.java 1642248 2014-11-28 00:10:50Z hboutemy $

  * @since 2.6

  */

 @Mojo( name = "fix", requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = true )

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocJar.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocJar.java
index 3060678..8208f5c 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocJar.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocJar.java
@@ -46,7 +46,6 @@
  * Bundles the Javadoc documentation for <code>main Java code</code> in an <b>NON aggregator</b> project into

  * a jar using the standard <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.

  *

- * @version $Id: JavadocJar.java 1752018 2016-07-09 16:35:25Z rfscholte $

  * @since 2.0

  */

 @Mojo( name = "jar", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.COMPILE,

@@ -175,7 +174,7 @@
             innerDestDir = new File( getOutputDirectory() );

         }

 

-        if ( !( "pom".equalsIgnoreCase( project.getPackaging() ) && isAggregator() ) )

+        if ( isAggregator() || !"pom".equalsIgnoreCase( project.getPackaging() ) )

         {

             ArtifactHandler artifactHandler = project.getArtifact().getArtifactHandler();

             if ( !"java".equals( artifactHandler.getLanguage() ) )

@@ -269,14 +268,13 @@
         archiver.setArchiver( jarArchiver );

         archiver.setOutputFile( javadocJar );

 

-        File contentDirectory = javadocFiles;

-        if ( !contentDirectory.exists() )

+        if ( !javadocFiles.exists() )

         {

             getLog().warn( "JAR will be empty - no content was marked for inclusion!" );

         }

         else

         {

-            archiver.getArchiver().addDirectory( contentDirectory, DEFAULT_INCLUDES, DEFAULT_EXCLUDES );

+            archiver.getArchiver().addDirectory( javadocFiles, DEFAULT_INCLUDES, DEFAULT_EXCLUDES );

         }

 

         List<Resource> resources = project.getBuild().getResources();

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocNoForkReport.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocNoForkReport.java
index f588ba4..a2fbbd2 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocNoForkReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocNoForkReport.java
@@ -30,7 +30,6 @@
  * goal does require generation of sources before site generation, e.g. by invoking <tt>mvn clean deploy site</tt>.
  *
  * @author <a href="mailto:mfriedenhagen@apache.org">Mirko Friedenhagen</a>
- * @version $Id$
  * @since 2.10
  * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>
  * @see <a href="http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/javadoc.html#options">Javadoc Options</a>
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java
index f431114..feeec56 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocReport.java
@@ -20,9 +20,10 @@
  */

 

 import java.io.File;

+import java.nio.file.Path;

 import java.util.Collection;

-import java.util.List;

 import java.util.Locale;

+import java.util.Map;

 import java.util.ResourceBundle;

 

 import org.apache.maven.doxia.siterenderer.RenderingContext;

@@ -45,7 +46,6 @@
  *

  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: JavadocReport.java 1800564 2017-07-02 14:08:18Z michaelo $

  * @since 2.0

  * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>

  * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#options">Javadoc Options</a>

@@ -133,15 +133,7 @@
         {

             executeReport( locale );

         }

-        catch ( MavenReportException e )

-        {

-            if ( failOnError )

-            {

-                throw e;

-            }

-            getLog().error( "Error while creating javadoc report: " + e.getMessage(), e );

-        }

-        catch ( RuntimeException e )

+        catch ( MavenReportException | RuntimeException e )

         {

             if ( failOnError )

             {

@@ -168,9 +160,9 @@
     /**

      * {@inheritDoc}

      *

-     * <br/>

+     * <br>

      * The logic is the following:

-     * <table>

+     * <table summary="Can-generate-report Matrix">

      *   <tbody>

      *     <tr>

      *       <th> isAggregator </th>

@@ -234,10 +226,10 @@
     {

         boolean canGenerate = false;

 

-        if ( !this.isAggregator() || ( this.isAggregator() && this.project.isExecutionRoot() ) )

+        if ( this.isAggregator() || !"pom".equals( this.project.getPackaging() ) )

         {

-            Collection<String> sourcePaths;

-            List<String> files;

+            Collection<Path> sourcePaths;

+            Map<Path, Collection<String>> files;

             try

             {

                 sourcePaths = collect( getSourcePaths().values() );

@@ -289,7 +281,7 @@
     }

 

     /**

-     * @param theDestDir The destiation directory.

+     * @param theDestDir The destination directory.

      */

     public void setDestDir( String theDestDir )

     {

@@ -328,11 +320,7 @@
             Locale locale = Locale.getDefault();

             generate( sink, locale );

         }

-        catch ( MavenReportException e )

-        {

-            failOnError( "An error has occurred in " + getName( Locale.ENGLISH ) + " report generation", e );

-        }

-        catch ( RuntimeException e )

+        catch ( MavenReportException | RuntimeException e )

         {

             failOnError( "An error has occurred in " + getName( Locale.ENGLISH ) + " report generation", e );

         }

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
index 73ae0f2..8c4f4f9 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
@@ -19,7 +19,7 @@
  * under the License.

  */

 

-import org.apache.commons.lang3.SystemUtils;

+import org.apache.http.HttpHeaders;

 import org.apache.http.HttpHost;

 import org.apache.http.HttpResponse;

 import org.apache.http.HttpStatus;

@@ -29,9 +29,12 @@
 import org.apache.http.client.HttpClient;

 import org.apache.http.client.methods.HttpGet;

 import org.apache.http.client.params.ClientPNames;

+import org.apache.http.client.params.CookiePolicy;

+import org.apache.http.client.protocol.HttpClientContext;

 import org.apache.http.conn.params.ConnRoutePNames;

 import org.apache.http.impl.client.DefaultHttpClient;

 import org.apache.http.impl.conn.PoolingClientConnectionManager;

+import org.apache.http.message.BasicHeader;

 import org.apache.http.params.CoreConnectionPNames;

 import org.apache.http.params.CoreProtocolPNames;

 import org.apache.maven.plugin.logging.Log;

@@ -48,6 +51,7 @@
 import org.apache.maven.shared.invoker.PrintStreamHandler;

 import org.apache.maven.wagon.proxy.ProxyInfo;

 import org.apache.maven.wagon.proxy.ProxyUtils;

+import org.codehaus.plexus.languages.java.version.JavaVersion;

 import org.codehaus.plexus.util.DirectoryScanner;

 import org.codehaus.plexus.util.FileUtils;

 import org.codehaus.plexus.util.IOUtil;

@@ -58,22 +62,27 @@
 import org.codehaus.plexus.util.cli.Commandline;

 

 import java.io.BufferedReader;

-import java.io.ByteArrayOutputStream;

 import java.io.File;

 import java.io.FileInputStream;

 import java.io.FileNotFoundException;

 import java.io.FileOutputStream;

 import java.io.IOException;

-import java.io.InputStream;

 import java.io.InputStreamReader;

 import java.io.OutputStream;

-import java.io.OutputStreamWriter;

 import java.io.PrintStream;

 import java.io.UnsupportedEncodingException;

 import java.lang.reflect.Modifier;

 import java.net.SocketTimeoutException;

+import java.net.URI;

 import java.net.URL;

 import java.net.URLClassLoader;

+import java.nio.charset.Charset;

+import java.nio.charset.IllegalCharsetNameException;

+import java.nio.file.FileVisitResult;

+import java.nio.file.Files;

+import java.nio.file.Path;

+import java.nio.file.SimpleFileVisitor;

+import java.nio.file.attribute.BasicFileAttributes;

 import java.util.ArrayList;

 import java.util.Arrays;

 import java.util.Collection;

@@ -95,7 +104,6 @@
  * Set of utilities methods for Javadoc.

  *

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: JavadocUtil.java 1801354 2017-07-09 08:49:46Z rfscholte $

  * @since 2.4

  */

 public class JavadocUtil

@@ -106,20 +114,21 @@
     /** Error message when VM could not be started using invoker. */

     protected static final String ERROR_INIT_VM =

         "Error occurred during initialization of VM, try to reduce the Java heap size for the MAVEN_OPTS "

-        + "environnement variable using -Xms:<size> and -Xmx:<size>.";

+            + "environment variable using -Xms:<size> and -Xmx:<size>.";

 

     /**

-     * Method that removes the invalid directories in the specified directories.

-     * <b>Note</b>: All elements in <code>dirs</code> could be an absolute or relative against the project's base

-     * directory <code>String</code> path.

+     * Method that removes the invalid directories in the specified directories. <b>Note</b>: All elements in

+     * <code>dirs</code> could be an absolute or relative against the project's base directory <code>String</code> path.

      *

      * @param project the current Maven project not null

      * @param dirs the collection of <code>String</code> directories path that will be validated.

      * @return a List of valid <code>String</code> directories absolute paths.

      */

-    public static Collection<String> pruneDirs( MavenProject project, Collection<String> dirs )

+    public static Collection<Path> pruneDirs( MavenProject project, Collection<String> dirs )

     {

-        Set<String> pruned = new LinkedHashSet<>( dirs.size() );

+        final Path projectBasedir = project.getBasedir().toPath();

+

+        Set<Path> pruned = new LinkedHashSet<>( dirs.size() );

         for ( String dir : dirs )

         {

             if ( dir == null )

@@ -127,15 +136,11 @@
                 continue;

             }

 

-            File directory = new File( dir );

-            if ( !directory.isAbsolute() )

-            {

-                directory = new File( project.getBasedir(), directory.getPath() );

-            }

+            Path directory = projectBasedir.resolve( dir );

 

-            if ( directory.isDirectory() )

+            if ( Files.isDirectory( directory ) )

             {

-                pruned.add( directory.getAbsolutePath() );

+                pruned.add( directory.toAbsolutePath() );

             }

         }

 

@@ -143,8 +148,8 @@
     }

 

     /**

-     * Method that removes the invalid files in the specified files.

-     * <b>Note</b>: All elements in <code>files</code> should be an absolute <code>String</code> path.

+     * Method that removes the invalid files in the specified files. <b>Note</b>: All elements in <code>files</code>

+     * should be an absolute <code>String</code> path.

      *

      * @param files the list of <code>String</code> files paths that will be validated.

      * @return a List of valid <code>File</code> objects.

@@ -159,13 +164,14 @@
                 pruned.add( f );

             }

         }

- 

+

         return pruned;

     }

 

     /**

-     * Determine whether a file should be excluded from the provided list of paths, based on whether

-     * it exists and is already present in the list.

+     * Determine whether a file should be excluded from the provided list of paths, based on whether it exists and is

+     * already present in the list.

+     *

      * @param f The files.

      * @param pruned The list of pruned files..

      * @return true if the file could be pruned false otherwise.

@@ -180,39 +186,32 @@
                 return false;

             }

         }

-        

+

         return true;

     }

 

     /**

-     * Method that gets all the source files to be excluded from the javadoc on the given

-     * source paths.

+     * Method that gets all the source files to be excluded from the javadoc on the given source paths.

      *

-     * @param sourcePaths      the path to the source files

-     * @param subpackagesList  list of subpackages to be included in the javadoc

+     * @param sourcePaths the path to the source files

      * @param excludedPackages the package names to be excluded in the javadoc

-     * @return a List of the source files to be excluded in the generated javadoc

+     * @return a List of the packages to be excluded in the generated javadoc

      */

-    protected static List<String> getExcludedNames( Collection<String> sourcePaths, String[] subpackagesList,

-                                                    String[] excludedPackages )

+    protected static List<String> getExcludedPackages( Collection<Path> sourcePaths,

+                                                       Collection<String> excludedPackages )

     {

         List<String> excludedNames = new ArrayList<>();

-        for ( String path : sourcePaths )

+        for ( Path sourcePath : sourcePaths )

         {

-            for ( String aSubpackagesList : subpackagesList )

-            {

-                List<String> excludes = getExcludedPackages( path, excludedPackages );

-                excludedNames.addAll( excludes );

-            }

+            excludedNames.addAll( getExcludedPackages( sourcePath, excludedPackages ) );

         }

 

         return excludedNames;

     }

 

     /**

-     * Convenience method to wrap an argument value in single quotes (i.e. <code>'</code>). Intended for values

-     * which may contain whitespaces.

-     * <br/>

+     * Convenience method to wrap an argument value in single quotes (i.e. <code>'</code>). Intended for values which

+     * may contain whitespaces. <br>

      * To prevent javadoc error, the line separator (i.e. <code>\n</code>) are skipped.

      *

      * @param value the argument value.

@@ -238,8 +237,8 @@
     }

 

     /**

-     * Convenience method to format a path argument so that it is properly interpreted by the javadoc tool. Intended

-     * for path values which may contain whitespaces.

+     * Convenience method to format a path argument so that it is properly interpreted by the javadoc tool. Intended for

+     * path values which may contain whitespaces.

      *

      * @param value the argument value.

      * @return path argument with quote

@@ -275,8 +274,8 @@
     }

 

     /**

-     * Convenience method that copy all <code>doc-files</code> directories from <code>javadocDir</code>

-     * to the <code>outputDirectory</code>.

+     * Convenience method that copy all <code>doc-files</code> directories from <code>javadocDir</code> to the

+     * <code>outputDirectory</code>.

      *

      * @param outputDirectory the output directory

      * @param javadocDir the javadoc directory

@@ -292,8 +291,7 @@
             return;

         }

 

-        List<String> excludes = new ArrayList<>();

-        excludes.addAll( Arrays.asList( FileUtils.getDefaultExcludes() ) );

+        List<String> excludes = new ArrayList<>( Arrays.asList( FileUtils.getDefaultExcludes() ) );

 

         if ( StringUtils.isNotEmpty( excludedocfilessubdir ) )

         {

@@ -315,8 +313,8 @@
             FileUtils.mkdir( docFileOutput.getAbsolutePath() );

             FileUtils.copyDirectoryStructure( new File( javadocDir, docFile ), docFileOutput );

             List<String> files =

-                FileUtils.getFileAndDirectoryNames( docFileOutput, StringUtils.join( excludes.iterator(), "," ),

-                                                    null, true, true, true, true );

+                FileUtils.getFileAndDirectoryNames( docFileOutput, StringUtils.join( excludes.iterator(), "," ), null,

+                                                    true, true, true, true );

             for ( String filename : files )

             {

                 File file = new File( filename );

@@ -334,74 +332,43 @@
     }

 

     /**

-     * Method that gets the files or classes that would be included in the javadocs using the subpackages

-     * parameter.

+     * Method that gets the files or classes that would be included in the javadocs using the subpackages parameter.

      *

      * @param sourceDirectory the directory where the source files are located

-     * @param fileList        the list of all files found in the sourceDirectory

+     * @param fileList the list of all relative files found in the sourceDirectory

      * @param excludePackages package names to be excluded in the javadoc

      * @return a StringBuilder that contains the appended file names of the files to be included in the javadoc

      */

-    protected static List<String> getIncludedFiles( File sourceDirectory, String[] fileList, String[] excludePackages )

+    protected static List<String> getIncludedFiles( File sourceDirectory, String[] fileList,

+                                                    Collection<String> excludePackages )

     {

         List<String> files = new ArrayList<>();

 

-        for ( String aFileList : fileList )

+        List<Pattern> excludePackagePatterns = new ArrayList<>( excludePackages.size() );

+        for ( String excludePackage :  excludePackages )

         {

-            boolean include = true;

-            for ( int k = 0; k < excludePackages.length && include; k++ )

+            excludePackagePatterns.add( Pattern.compile( excludePackage.replace( '.', File.separatorChar )

+                                                                       .replace( "\\", "\\\\" )

+                                                                       .replace( "*", ".+" )

+                                                                       .concat( "[\\\\/][^\\\\/]+\\.java" )

+                                                                                ) );

+        }

+

+        for ( String file : fileList )

+        {

+            boolean excluded = false;

+            for ( Pattern excludePackagePattern :  excludePackagePatterns )

             {

-                // handle wildcards (*) in the excludePackageNames

-                String[] excludeName = excludePackages[k].split( "[*]" );

-

-                if ( excludeName.length == 0 )

+                if ( excludePackagePattern.matcher( file ).matches() )

                 {

-                    continue;

-                }

-

-                if ( excludeName.length > 1 )

-                {

-                    int u = 0;

-                    while ( include && u < excludeName.length )

-                    {

-                        if ( !"".equals( excludeName[u].trim() ) && aFileList.contains( excludeName[u] ) )

-                        {

-                            include = false;

-                        }

-                        u++;

-                    }

-                }

-                else

-                {

-                    if ( aFileList.startsWith( sourceDirectory.toString() + File.separatorChar + excludeName[0] ) )

-                    {

-                        if ( excludeName[0].endsWith( String.valueOf( File.separatorChar ) ) )

-                        {

-                            int i = aFileList.lastIndexOf( File.separatorChar );

-                            String packageName = aFileList.substring( 0, i + 1 );

-                            File currentPackage = new File( packageName );

-                            File excludedPackage = new File( sourceDirectory, excludeName[0] );

-                            if ( currentPackage.equals( excludedPackage )

-                                && aFileList.substring( i ).contains( ".java" ) )

-                            {

-                                include = true;

-                            }

-                            else

-                            {

-                                include = false;

-                            }

-                        }

-                        else

-                        {

-                            include = false;

-                        }

-                    }

+                    excluded = true;

+                    break;

                 }

             }

 

-            if ( include )

+            if ( !excluded )

             {

-                files.add( quotedPathArgument( aFileList ) );

+                files.add( file );

             }

         }

 

@@ -409,66 +376,76 @@
     }

 

     /**

-     * Method that gets the complete package names (including subpackages) of the packages that were defined

-     * in the excludePackageNames parameter.

+     * Method that gets the complete package names (including subpackages) of the packages that were defined in the

+     * excludePackageNames parameter.

      *

-     * @param sourceDirectory     the directory where the source files are located

+     * @param sourceDirectory the directory where the source files are located

      * @param excludePackagenames package names to be excluded in the javadoc

      * @return a List of the packagenames to be excluded

      */

-    protected static List<String> getExcludedPackages( String sourceDirectory, String[] excludePackagenames )

+    protected static Collection<String> getExcludedPackages( final Path sourceDirectory,

+                                                             Collection<String> excludePackagenames )

     {

+        final String regexFileSeparator = File.separator.replace( "\\", "\\\\" );

+

+        final Collection<String> fileList = new ArrayList<>();

+

+        try

+        {

+            Files.walkFileTree( sourceDirectory, new SimpleFileVisitor<Path>()

+            {

+                @Override

+                public FileVisitResult visitFile( Path file, BasicFileAttributes attrs )

+                    throws IOException

+                {

+                    if ( file.getFileName().toString().endsWith( ".java" ) )

+                    {

+                        fileList.add( sourceDirectory.relativize( file.getParent() ).toString() );

+                    }

+                    return FileVisitResult.CONTINUE;

+                }

+            } );

+        }

+        catch ( IOException e )

+        {

+            // noop

+        }

+

         List<String> files = new ArrayList<>();

         for ( String excludePackagename : excludePackagenames )

         {

-            String[] fileList = FileUtils.getFilesFromExtension( sourceDirectory, new String[] { "java" } );

+            // Usage of wildcard was bad specified and bad implemented, i.e. using String.contains()

+            //   without respecting surrounding context

+            // Following implementation should match requirements as defined in the examples:

+            // - A wildcard at the beginning should match 1 or more folders

+            // - Any other wildcard must match exactly one folder

+            Pattern p = Pattern.compile( excludePackagename.replace( ".", regexFileSeparator )

+                                                           .replaceFirst( "^\\*", ".+" )

+                                                           .replace( "*", "[^" + regexFileSeparator + "]+" ) );

+

             for ( String aFileList : fileList )

             {

-                String[] excludeName = excludePackagename.split( "[*]" );

-                int u = 0;

-                while ( u < excludeName.length )

+                if ( p.matcher( aFileList ).matches() )

                 {

-                    if ( !"".equals( excludeName[u].trim() ) && aFileList.contains( excludeName[u] )

-                        && !sourceDirectory.contains( excludeName[u] ) )

-                    {

-                        files.add( aFileList );

-                    }

-                    u++;

+                    files.add( aFileList.replace( File.separatorChar, '.' ) );

                 }

             }

         }

 

-        List<String> excluded = new ArrayList<>();

-        for ( String file : files )

-        {

-            int idx = file.lastIndexOf( File.separatorChar );

-            String tmpStr = file.substring( 0, idx );

-            tmpStr = tmpStr.replace( '\\', '/' );

-            String[] srcSplit = tmpStr.split( Pattern.quote( sourceDirectory.replace( '\\', '/' ) + '/' ) );

-            String excludedPackage = srcSplit[1].replace( '/', '.' );

-

-            if ( !excluded.contains( excludedPackage ) )

-            {

-                excluded.add( excludedPackage );

-            }

-        }

-

-        return excluded;

+        return files;

     }

 

     /**

      * Convenience method that gets the files to be included in the javadoc.

      *

      * @param sourceDirectory the directory where the source files are located

-     * @param files the variable that contains the appended filenames of the files to be included in the javadoc

      * @param excludePackages the packages to be excluded in the javadocs

      * @param sourceFileIncludes files to include.

      * @param sourceFileExcludes files to exclude.

      */

-    protected static void addFilesFromSource( List<String> files, File sourceDirectory,

-                                              List<String> sourceFileIncludes,

-                                              List<String> sourceFileExcludes,

-                                              String[] excludePackages )

+    protected static List<String> getFilesFromSource( File sourceDirectory, List<String> sourceFileIncludes,

+                                                      List<String> sourceFileExcludes,

+                                                      Collection<String> excludePackages )

     {

         DirectoryScanner ds = new DirectoryScanner();

         if ( sourceFileIncludes == null )

@@ -484,24 +461,24 @@
         ds.scan();

 

         String[] fileList = ds.getIncludedFiles();

-        String[] pathList = new String[fileList.length];

-        for ( int x = 0; x < fileList.length; x++ )

+

+        List<String> files = new ArrayList<>();

+        if ( fileList.length != 0 )

         {

-            pathList[x] = new File( sourceDirectory, fileList[x] ).getAbsolutePath();

+            for ( String includedFile : getIncludedFiles( sourceDirectory, fileList, excludePackages ) )

+            {

+                files.add( includedFile );

+            }

         }

 

-

-        if (  pathList.length != 0 )

-        {

-            List<String> tmpFiles = getIncludedFiles( sourceDirectory, pathList, excludePackages );

-            files.addAll( tmpFiles );

-        }

+        return files;

     }

 

     /**

      * Call the Javadoc tool and parse its output to find its version, i.e.:

+     *

      * <pre>

-     * javadoc.exe(or .sh) -J-version

+     * javadoc.exe( or.sh ) - J - version

      * </pre>

      *

      * @param javadocExe not null file

@@ -512,7 +489,7 @@
      * @throws PatternSyntaxException if the output contains a syntax error in the regular-expression pattern.

      * @see #extractJavadocVersion(String)

      */

-    protected static JavadocVersion getJavadocVersion( File javadocExe )

+    protected static JavaVersion getJavadocVersion( File javadocExe )

         throws IOException, CommandLineException, IllegalArgumentException

     {

         if ( ( javadocExe == null ) || ( !javadocExe.exists() ) || ( !javadocExe.isFile() ) )

@@ -540,55 +517,54 @@
 

         if ( StringUtils.isNotEmpty( err.getOutput() ) )

         {

-            return JavadocVersion.parse( extractJavadocVersion( err.getOutput() ) );

+            return JavaVersion.parse( extractJavadocVersion( err.getOutput() ) );

         }

         else if ( StringUtils.isNotEmpty( out.getOutput() ) )

         {

-            return JavadocVersion.parse( extractJavadocVersion( out.getOutput() ) );

+            return JavaVersion.parse( extractJavadocVersion( out.getOutput() ) );

         }

 

         throw new IllegalArgumentException( "No output found from the command line 'javadoc -J-version'" );

     }

 

     /**

-     * Parse the output for 'javadoc -J-version' and return the javadoc version recognized.

-     * <br/>

+     * Parse the output for 'javadoc -J-version' and return the javadoc version recognized. <br>

      * Here are some output for 'javadoc -J-version' depending the JDK used:

-     * <table>

+     * <table summary="Output for 'javadoc -J-version' per JDK">

      * <tr>

-     *   <th>JDK</th>

-     *   <th>Output for 'javadoc -J-version'</th>

+     * <th>JDK</th>

+     * <th>Output for 'javadoc -J-version'</th>

      * </tr>

      * <tr>

-     *   <td>Sun 1.4</td>

-     *   <td>java full version "1.4.2_12-b03"</td>

+     * <td>Sun 1.4</td>

+     * <td>java full version "1.4.2_12-b03"</td>

      * </tr>

      * <tr>

-     *   <td>Sun 1.5</td>

-     *   <td>java full version "1.5.0_07-164"</td>

+     * <td>Sun 1.5</td>

+     * <td>java full version "1.5.0_07-164"</td>

      * </tr>

      * <tr>

-     *   <td>IBM 1.4</td>

-     *   <td>javadoc full version "J2RE 1.4.2 IBM Windows 32 build cn1420-20040626"</td>

+     * <td>IBM 1.4</td>

+     * <td>javadoc full version "J2RE 1.4.2 IBM Windows 32 build cn1420-20040626"</td>

      * </tr>

      * <tr>

-     *   <td>IBM 1.5 (French JVM)</td>

-     *   <td>javadoc version complète de "J2RE 1.5.0 IBM Windows 32 build pwi32pdev-20070426a"</td>

+     * <td>IBM 1.5 (French JVM)</td>

+     * <td>javadoc version complète de "J2RE 1.5.0 IBM Windows 32 build pwi32pdev-20070426a"</td>

      * </tr>

      * <tr>

-     *   <td>FreeBSD 1.5</td>

-     *   <td>java full version "diablo-1.5.0-b01"</td>

+     * <td>FreeBSD 1.5</td>

+     * <td>java full version "diablo-1.5.0-b01"</td>

      * </tr>

      * <tr>

-     *   <td>BEA jrockit 1.5</td>

-     *   <td>java full version "1.5.0_11-b03"</td>

+     * <td>BEA jrockit 1.5</td>

+     * <td>java full version "1.5.0_11-b03"</td>

      * </tr>

      * </table>

      *

      * @param output for 'javadoc -J-version'

      * @return the version of the javadoc for the output, only digits and dots

      * @throws PatternSyntaxException if the output doesn't match with the output pattern

-     * <tt>(?s).*?[^a-zA-Z]([0-9]+\\.?[0-9]*)(\\.([0-9]+))?.*</tt>.

+     *             <tt>(?s).*?[^a-zA-Z]([0-9]+\\.?[0-9]*)(\\.([0-9]+))?.*</tt>.

      * @throws IllegalArgumentException if the output is null

      */

     protected static String extractJavadocVersion( String output )

@@ -612,32 +588,31 @@
     }

 

     /**

-     * Parse a memory string which be used in the JVM arguments <code>-Xms</code> or <code>-Xmx</code>.

-     * <br/>

+     * Parse a memory string which be used in the JVM arguments <code>-Xms</code> or <code>-Xmx</code>. <br>

      * Here are some supported memory string depending the JDK used:

-     * <table>

+     * <table summary="Memory argument support per JDK">

      * <tr>

-     *   <th>JDK</th>

-     *   <th>Memory argument support for <code>-Xms</code> or <code>-Xmx</code></th>

+     * <th>JDK</th>

+     * <th>Memory argument support for <code>-Xms</code> or <code>-Xmx</code></th>

      * </tr>

      * <tr>

-     *   <td>SUN</td>

-     *   <td>1024k | 128m | 1g | 1t</td>

+     * <td>SUN</td>

+     * <td>1024k | 128m | 1g | 1t</td>

      * </tr>

      * <tr>

-     *   <td>IBM</td>

-     *   <td>1024k | 1024b | 128m | 128mb | 1g | 1gb</td>

+     * <td>IBM</td>

+     * <td>1024k | 1024b | 128m | 128mb | 1g | 1gb</td>

      * </tr>

      * <tr>

-     *   <td>BEA</td>

-     *   <td>1024k | 1024kb | 128m | 128mb | 1g | 1gb</td>

+     * <td>BEA</td>

+     * <td>1024k | 1024kb | 128m | 128mb | 1g | 1gb</td>

      * </tr>

      * </table>

      *

      * @param memory the memory to be parsed, not null.

-     * @return the memory parsed with a supported unit. If no unit specified in the <code>memory</code> parameter,

-     * the default unit is <code>m</code>. The units <code>g | gb</code> or <code>t | tb</code> will be converted

-     * in <code>m</code>.

+     * @return the memory parsed with a supported unit. If no unit specified in the <code>memory</code> parameter, the

+     *         default unit is <code>m</code>. The units <code>g | gb</code> or <code>t | tb</code> will be converted in

+     *         <code>m</code>.

      * @throws IllegalArgumentException if the <code>memory</code> parameter is null or doesn't match any pattern.

      */

     protected static String parseJavadocMemory( String memory )

@@ -699,29 +674,19 @@
             return false;

         }

 

-        OutputStream ost = new ByteArrayOutputStream();

-        OutputStreamWriter osw = null;

         try

         {

-            osw = new OutputStreamWriter( ost, charsetName );

-            osw.close();

-            osw = null;

+            return Charset.isSupported( charsetName );

         }

-        catch ( IOException exc )

+        catch ( IllegalCharsetNameException e )

         {

             return false;

         }

-        finally

-        {

-            IOUtil.close( osw );

-        }

-

-        return true;

     }

 

     /**

-     * For security reasons, if an active proxy is defined and needs an authentication by

-     * username/password, hide the proxy password in the command line.

+     * For security reasons, if an active proxy is defined and needs an authentication by username/password, hide the

+     * proxy password in the command line.

      *

      * @param cmdLine a command line, not null

      * @param settings the user settings

@@ -755,16 +720,15 @@
     }

 

     /**

-     * Auto-detect the class names of the implementation of <code>com.sun.tools.doclets.Taglet</code> class from a

-     * given jar file.

-     * <br/>

+     * Auto-detect the class names of the implementation of <code>com.sun.tools.doclets.Taglet</code> class from a given

+     * jar file. <br>

      * <b>Note</b>: <code>JAVA_HOME/lib/tools.jar</code> is a requirement to find

      * <code>com.sun.tools.doclets.Taglet</code> class.

      *

      * @param jarFile not null

      * @return the list of <code>com.sun.tools.doclets.Taglet</code> class names from a given jarFile.

-     * @throws IOException if jarFile is invalid or not found, or if the <code>JAVA_HOME/lib/tools.jar</code>

-     * is not found.

+     * @throws IOException if jarFile is invalid or not found, or if the <code>JAVA_HOME/lib/tools.jar</code> is not

+     *             found.

      * @throws ClassNotFoundException if any

      * @throws NoClassDefFoundError if any

      */

@@ -788,8 +752,8 @@
         List<String> tagletClasses = new ArrayList<>();

 

         Class<?> tagletClass;

-        

-        try 

+

+        try

         {

             tagletClass = cl.loadClass( "com.sun.tools.doclets.Taglet" );

         }

@@ -797,7 +761,7 @@
         {

             tagletClass = cl.loadClass( "jdk.javadoc.doclet.Taglet" );

         }

-        

+

         for ( String s : classes )

         {

             Class<?> c = cl.loadClass( s );

@@ -831,42 +795,12 @@
             throw new IOException( "The url could not be null." );

         }

 

-        if ( !file.getParentFile().exists() )

-        {

-            file.getParentFile().mkdirs();

-        }

-

-        InputStream in = null;

-        OutputStream out = null;

-        try

-        {

-            in = url.openStream();

-

-            if ( in == null )

-            {

-                throw new IOException( "The resource " + url + " doesn't exists." );

-            }

-

-            out = new FileOutputStream( file );

-

-            IOUtil.copy( in, out );

-

-            out.close();

-            out = null;

-            in.close();

-            in = null;

-        }

-        finally

-        {

-            IOUtil.close( in );

-            IOUtil.close( out );

-        }

+        FileUtils.copyURLToFile( url, file );

     }

 

     /**

-     * Invoke Maven for the given project file with a list of goals and properties, the output will be in the

-     * invokerlog file.

-     * <br/>

+     * Invoke Maven for the given project file with a list of goals and properties, the output will be in the invokerlog

+     * file. <br>

      * <b>Note</b>: the Maven Home should be defined in the <code>maven.home</code> Java system property or defined in

      * <code>M2_HOME</code> system env variables.

      *

@@ -904,9 +838,8 @@
         String mavenHome = getMavenHome( log );

         if ( StringUtils.isEmpty( mavenHome ) )

         {

-            String msg =

-                "Could NOT invoke Maven because no Maven Home is defined. You need to have set the M2_HOME "

-                    + "system env variable or a maven.home Java system properties.";

+            String msg = "Could NOT invoke Maven because no Maven Home is defined. You need to have set the M2_HOME "

+                + "system env variable or a maven.home Java system properties.";

             if ( log != null )

             {

                 log.error( msg );

@@ -925,6 +858,7 @@
         InvocationRequest request = new DefaultInvocationRequest();

         request.setBaseDirectory( projectFile.getParentFile() );

         request.setPomFile( projectFile );

+        request.setBatchMode( true );

         if ( log != null )

         {

             request.setDebug( log.isDebugEnabled() );

@@ -956,9 +890,8 @@
             String invokerLogContent = readFile( invokerLog, "UTF-8" );

 

             // see DefaultMaven

-            if ( invokerLogContent != null

-                && ( !invokerLogContent.contains( "Scanning for projects..." )

-                                || invokerLogContent.contains( OutOfMemoryError.class.getName() ) ) )

+            if ( invokerLogContent != null && ( !invokerLogContent.contains( "Scanning for projects..." )

+                || invokerLogContent.contains( OutOfMemoryError.class.getName() ) ) )

             {

                 if ( log != null )

                 {

@@ -978,9 +911,8 @@
             String invokerLogContent = readFile( invokerLog, "UTF-8" );

 

             // see DefaultMaven

-            if ( invokerLogContent != null

-                && ( !invokerLogContent.contains( "Scanning for projects..." )

-                                || invokerLogContent.contains( OutOfMemoryError.class.getName() ) ) )

+            if ( invokerLogContent != null && ( !invokerLogContent.contains( "Scanning for projects..." )

+                || invokerLogContent.contains( OutOfMemoryError.class.getName() ) ) )

             {

                 throw new MavenInvocationException( ERROR_INIT_VM );

             }

@@ -1012,8 +944,8 @@
     }

 

     /**

-     * Split the given path with colon and semi-colon, to support Solaris and Windows path.

-     * Examples:

+     * Split the given path with colon and semi-colon, to support Solaris and Windows path. Examples:

+     *

      * <pre>

      * splitPath( "/home:/tmp" )     = ["/home", "/tmp"]

      * splitPath( "/home;/tmp" )     = ["/home", "/tmp"]

@@ -1021,8 +953,8 @@
      * splitPath( "C:/home;C:/tmp" ) = ["C:/home", "C:/tmp"]

      * </pre>

      *

-     * @param path which can contain multiple paths separated with a colon (<code>:</code>) or a

-     * semi-colon (<code>;</code>), platform independent. Could be null.

+     * @param path which can contain multiple paths separated with a colon (<code>:</code>) or a semi-colon

+     *            (<code>;</code>), platform independent. Could be null.

      * @return the path splitted by colon or semi-colon or <code>null</code> if path was <code>null</code>.

      * @since 2.6.1

      */

@@ -1044,17 +976,17 @@
     }

 

     /**

-     * Unify the given path with the current System path separator, to be platform independent.

-     * Examples:

+     * Unify the given path with the current System path separator, to be platform independent. Examples:

+     *

      * <pre>

      * unifyPathSeparator( "/home:/tmp" ) = "/home:/tmp" (Solaris box)

      * unifyPathSeparator( "/home:/tmp" ) = "/home;/tmp" (Windows box)

      * </pre>

      *

-     * @param path which can contain multiple paths by separating them with a colon (<code>:</code>) or a

-     * semi-colon (<code>;</code>), platform independent. Could be null.

+     * @param path which can contain multiple paths by separating them with a colon (<code>:</code>) or a semi-colon

+     *            (<code>;</code>), platform independent. Could be null.

      * @return the same path but separated with the current System path separator or <code>null</code> if path was

-     * <code>null</code>.

+     *         <code>null</code>.

      * @since 2.6.1

      * @see #splitPath(String)

      * @see File#pathSeparator

@@ -1087,14 +1019,10 @@
         }

 

         List<String> classes = new ArrayList<>();

-        JarInputStream jarStream = null;

-

-        try

+        try ( JarInputStream jarStream = new JarInputStream( new FileInputStream( jarFile ) ) )

         {

-            jarStream = new JarInputStream( new FileInputStream( jarFile ) );

-

-            for ( JarEntry jarEntry = jarStream.getNextJarEntry(); jarEntry != null;

-                  jarEntry = jarStream.getNextJarEntry() )

+            for ( JarEntry jarEntry = jarStream.getNextJarEntry(); jarEntry != null; jarEntry =

+                jarStream.getNextJarEntry() )

             {

                 if ( jarEntry.getName().toLowerCase( Locale.ENGLISH ).endsWith( ".class" ) )

                 {

@@ -1105,13 +1033,6 @@
 

                 jarStream.closeEntry();

             }

-

-            jarStream.close();

-            jarStream = null;

-        }

-        finally

-        {

-            IOUtil.close( jarStream );

         }

 

         return classes;

@@ -1146,7 +1067,7 @@
             {

                 if ( !invokerLog.exists() )

                 {

-                    //noinspection ResultOfMethodCallIgnored

+                    // noinspection ResultOfMethodCallIgnored

                     invokerLog.getParentFile().mkdirs();

                 }

                 os = new FileOutputStream( invokerLog );

@@ -1209,8 +1130,8 @@
 

     /**

      * @param log a logger could be null

-     * @return the Maven home defined in the <code>maven.home</code> system property or defined

-     * in <code>M2_HOME</code> system env variables or null if never set.

+     * @return the Maven home defined in the <code>maven.home</code> system property or defined in <code>M2_HOME</code>

+     *         system env variables or null if never set.

      * @since 2.6

      */

     private static String getMavenHome( Log log )

@@ -1236,9 +1157,8 @@
         {

             if ( log != null && log.isErrorEnabled() )

             {

-                log

-                   .error( "Cannot find Maven application directory. Either specify \'maven.home\' system property, or "

-                       + "M2_HOME environment variable." );

+                log.error( "Cannot find Maven application directory. Either specify \'maven.home\' system property, or "

+                    + "M2_HOME environment variable." );

             }

         }

 

@@ -1270,15 +1190,15 @@
 

     /**

      * @param log a logger could be null

-     * @return the <code>JAVA_HOME</code> from System.getProperty( "java.home" )

-     * By default, <code>System.getProperty( "java.home" ) = JRE_HOME</code> and <code>JRE_HOME</code>

-     * should be in the <code>JDK_HOME</code>

+     * @return the <code>JAVA_HOME</code> from System.getProperty( "java.home" ) By default,

+     *         <code>System.getProperty( "java.home" ) = JRE_HOME</code> and <code>JRE_HOME</code> should be in the

+     *         <code>JDK_HOME</code>

      * @since 2.6

      */

     private static File getJavaHome( Log log )

     {

         File javaHome = null;

-        

+

         String javaHomeValue = null;

         try

         {

@@ -1296,15 +1216,14 @@
         if ( System.getProperty( "maven.home" ) == null || javaHomeValue == null )

         {

             // JEP220 (Java9) restructured the JRE/JDK runtime image

-            if ( ( SystemUtils.IS_OS_MAC_OSX

-                || JavadocVersion.parse( SystemUtils.JAVA_VERSION ).compareTo( JavadocVersion.parse( "9" ) ) >= 0 ) )

+            if ( SystemUtils.IS_OS_MAC_OSX || JavaVersion.JAVA_VERSION.isAtLeast( "9" ) )

             {

                 javaHome = SystemUtils.getJavaHome();

             }

             else

             {

                 javaHome = new File( SystemUtils.getJavaHome(), ".." );

-            }            

+            }

         }

 

         if ( javaHome == null || !javaHome.exists() )

@@ -1348,14 +1267,11 @@
     }

 

     /**

-     * A Path tokenizer takes a path and returns the components that make up

-     * that path.

+     * A Path tokenizer takes a path and returns the components that make up that path. The path can use path separators

+     * of either ':' or ';' and file separators of either '/' or '\'.

      *

-     * The path can use path separators of either ':' or ';' and file separators

-     * of either '/' or '\'.

-     *

-     * @version revision 439418 taken on 2009-09-12 from Ant Project

-     * (see http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/ant/PathTokenizer.java)

+     * @version revision 439418 taken on 2009-09-12 from Ant Project (see

+     *          http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/ant/PathTokenizer.java)

      */

     private static class PathTokenizer

     {

@@ -1365,21 +1281,18 @@
         private StringTokenizer tokenizer;

 

         /**

-         * A String which stores any path components which have been read ahead

-         * due to DOS filesystem compensation.

+         * A String which stores any path components which have been read ahead due to DOS filesystem compensation.

          */

         private String lookahead = null;

 

         /**

-         * A boolean that determines if we are running on Novell NetWare, which

-         * exhibits slightly different path name characteristics (multi-character

-         * volume / drive names)

+         * A boolean that determines if we are running on Novell NetWare, which exhibits slightly different path name

+         * characteristics (multi-character volume / drive names)

          */

         private boolean onNetWare = Os.isFamily( "netware" );

 

         /**

-         * Flag to indicate whether or not we are running on a platform with a

-         * DOS style filesystem

+         * Flag to indicate whether or not we are running on a platform with a DOS style filesystem

          */

         private boolean dosStyleFilesystem;

 

@@ -1388,7 +1301,7 @@
          *

          * @param path The path to tokenize. Must not be <code>null</code>.

          */

-        public PathTokenizer( String path )

+        PathTokenizer( String path )

         {

             if ( onNetWare )

             {

@@ -1406,12 +1319,11 @@
         }

 

         /**

-         * Tests if there are more path elements available from this tokenizer's

-         * path. If this method returns <code>true</code>, then a subsequent call

-         * to nextToken will successfully return a token.

+         * Tests if there are more path elements available from this tokenizer's path. If this method returns

+         * <code>true</code>, then a subsequent call to nextToken will successfully return a token.

          *

-         * @return <code>true</code> if and only if there is at least one token

-         * in the string after the current position; <code>false</code> otherwise.

+         * @return <code>true</code> if and only if there is at least one token in the string after the current

+         *         position; <code>false</code> otherwise.

          */

         public boolean hasMoreTokens()

         {

@@ -1423,9 +1335,7 @@
          * Returns the next path element from this tokenizer.

          *

          * @return the next path element from this tokenizer.

-         *

-         * @exception NoSuchElementException if there are no more elements in this

-         *            tokenizer's path.

+         * @exception NoSuchElementException if there are no more elements in this tokenizer's path.

          */

         public String nextToken()

             throws NoSuchElementException

@@ -1515,11 +1425,12 @@
 

     /**

      * Ignores line like 'Picked up JAVA_TOOL_OPTIONS: ...' as can happen on CI servers.

-     * 

+     *

      * @author Robert Scholte

      * @since 3.0.1

      */

-    private static class JavadocOutputStreamConsumer extends CommandLineUtils.StringStreamConsumer

+    protected static class JavadocOutputStreamConsumer

+        extends CommandLineUtils.StringStreamConsumer

     {

         @Override

         public void consumeLine( String line )

@@ -1530,19 +1441,19 @@
             }

         }

     }

-    

+

     static List<String> toList( String src )

     {

         return toList( src, null, null );

     }

-    

+

     static List<String> toList( String src, String elementPrefix, String elementSuffix )

     {

         if ( StringUtils.isEmpty( src ) )

         {

             return null;

         }

-        

+

         List<String> result = new ArrayList<>();

 

         StringTokenizer st = new StringTokenizer( src, "[,:;]" );

@@ -1554,46 +1465,46 @@
             {

                 sb.append( elementPrefix );

             }

-            

+

             sb.append( st.nextToken() );

-            

+

             if ( StringUtils.isNotEmpty( elementSuffix ) )

             {

                 sb.append( elementSuffix );

             }

-            

+

             result.add( sb.toString() );

         }

-        

+

         return result;

     }

-    

+

     static <T> List<T> toList( T[] multiple )

     {

         return toList( null, multiple );

     }

-    

+

     static <T> List<T> toList( T single, T[] multiple )

     {

         if ( single == null && ( multiple == null || multiple.length < 1 ) )

         {

             return null;

         }

-        

+

         List<T> result = new ArrayList<>();

         if ( single != null )

         {

             result.add( single );

         }

-        

+

         if ( multiple != null && multiple.length > 0 )

         {

             result.addAll( Arrays.asList( multiple ) );

         }

-        

+

         return result;

     }

-    

+

     // TODO: move to plexus-utils or use something appropriate from there

     public static String toRelative( File basedir, String absolutePath )

     {

@@ -1621,17 +1532,21 @@
 

         return relative;

     }

-    

+

     /**

      * Convenience method to determine that a collection is not empty or null.

+     * @param collection the collection to verify

+     * @return {@code true} if not {@code null} and not empty, otherwise {@code false}

      */

     public static boolean isNotEmpty( final Collection<?> collection )

     {

         return collection != null && !collection.isEmpty();

     }

-    

+

     /**

      * Convenience method to determine that a collection is empty or null.

+     * @param collection the collection to verify

+     * @return {@code true} if {@code null} or empty, otherwise {@code false}

      */

     public static boolean isEmpty( final Collection<?> collection )

     {

@@ -1639,20 +1554,59 @@
     }

 

     /**

+     * Execute an Http request at the given URL, follows redirects, and returns the last redirect locations. For URLs

+     * that aren't http/https, this does nothing and simply returns the given URL unchanged.

+     *

+     * @param url URL.

+     * @param settings Maven settings.

+     * @return Last redirect location.

+     * @throws IOException if there was an error during the Http request.

+     */

+    protected static URL getRedirectUrl( URL url, Settings settings )

+        throws IOException

+    {

+        String protocol = url.getProtocol();

+        if ( !"http".equals( protocol ) && !"https".equals( protocol ) )

+        {

+            return url;

+        }

+        HttpClient httpClient = null;

+        try

+        {

+            httpClient = createHttpClient( settings, url );

+            HttpClientContext httpContext = HttpClientContext.create();

+            HttpGet httpMethod = new HttpGet( url.toString() );

+            HttpResponse response = httpClient.execute( httpMethod, httpContext );

+            int status = response.getStatusLine().getStatusCode();

+            if ( status != HttpStatus.SC_OK )

+            {

+                throw new FileNotFoundException( "Unexpected HTTP status code " + status + " getting resource "

+                    + url.toExternalForm() + "." );

+            }

+

+            List<URI> redirects = httpContext.getRedirectLocations();

+            return isEmpty( redirects ) ? url : redirects.get( redirects.size() - 1 ).toURL();

+        }

+        finally

+        {

+            if ( httpClient != null )

+            {

+                httpClient.getConnectionManager().shutdown();

+            }

+        }

+    }

+

+    /**

      * Validates an <code>URL</code> to point to a valid <code>package-list</code> resource.

      *

      * @param url The URL to validate.

      * @param settings The user settings used to configure the connection to the URL or {@code null}.

      * @param validateContent <code>true</code> to validate the content of the <code>package-list</code> resource;

-     * <code>false</code> to only check the existence of the <code>package-list</code> resource.

-     *

+     *            <code>false</code> to only check the existence of the <code>package-list</code> resource.

      * @return <code>true</code> if <code>url</code> points to a valid <code>package-list</code> resource;

-     * <code>false</code> else.

-     *

+     *         <code>false</code> else.

      * @throws IOException if reading the resource fails.

-     *

      * @see #createHttpClient(org.apache.maven.settings.Settings, java.net.URL)

-     *

      * @since 2.8

      */

     protected static boolean isValidPackageList( URL url, Settings settings, boolean validateContent )

@@ -1663,45 +1617,8 @@
             throw new IllegalArgumentException( "The url is null" );

         }

 

-        BufferedReader reader = null;

-        HttpGet httpMethod = null;

-        HttpClient httpClient = null;

-

-        try

+        try ( BufferedReader reader = getReader( url, settings ) )

         {

-            if ( "file".equals( url.getProtocol() ) )

-            {

-                // Intentionally using the platform default encoding here since this is what Javadoc uses internally.

-                reader = new BufferedReader( new InputStreamReader( url.openStream() ) );

-            }

-            else

-            {

-                // http, https...

-                httpClient = createHttpClient( settings, url );

-

-                httpMethod = new HttpGet( url.toString() );

-                HttpResponse response;

-                try

-                {

-                    response = httpClient.execute( httpMethod );

-                }

-                catch ( SocketTimeoutException e )

-                {

-                    // could be a sporadic failure, one more retry before we give up

-                    response = httpClient.execute( httpMethod );

-                }

-

-                int status = response.getStatusLine().getStatusCode();

-                if ( status != HttpStatus.SC_OK )

-                {

-                    throw new FileNotFoundException(

-                        "Unexpected HTTP status code " + status + " getting resource " + url.toExternalForm() + "." );

-                }

-

-                // Intentionally using the platform default encoding here since this is what Javadoc uses internally.

-                reader = new BufferedReader( new InputStreamReader( response.getEntity().getContent() ) );

-            }

-

             if ( validateContent )

             {

                 for ( String line = reader.readLine(); line != null; line = reader.readLine() )

@@ -1712,25 +1629,112 @@
                     }

                 }

             }

-

-            reader.close();

-            reader = null;

-

             return true;

         }

-        finally

-        {

-            IOUtil.close( reader );

+    }

 

-            if ( httpMethod != null )

-            {

-                httpMethod.releaseConnection();

-            }

-            if ( httpClient != null )

-            {

-                httpClient.getConnectionManager().shutdown();

-            }

+    protected static boolean isValidElementList( URL url, Settings settings, boolean validateContent )

+                    throws IOException

+    {

+        if ( url == null )

+        {

+            throw new IllegalArgumentException( "The url is null" );

         }

+

+        try ( BufferedReader reader = getReader( url, settings ) )

+        {

+            if ( validateContent )

+            {

+                for ( String line = reader.readLine(); line != null; line = reader.readLine() )

+                {

+                    if ( line.startsWith( "module:" ) )

+                    {

+                        continue;

+                    }

+

+                    if ( !isValidPackageName( line ) )

+                    {

+                        return false;

+                    }

+                }

+            }

+            return true;

+        }

+    }

+

+    private static BufferedReader getReader( URL url, Settings settings ) throws IOException

+    {

+        BufferedReader reader = null;

+

+        if ( "file".equals( url.getProtocol() ) )

+        {

+            // Intentionally using the platform default encoding here since this is what Javadoc uses internally.

+            reader = new BufferedReader( new InputStreamReader( url.openStream() ) );

+        }

+        else

+        {

+            // http, https...

+            final HttpClient httpClient = createHttpClient( settings, url );

+

+            final HttpGet httpMethod = new HttpGet( url.toString() );

+

+            HttpResponse response;

+            HttpClientContext httpContext = HttpClientContext.create();

+            try

+            {

+                response = httpClient.execute( httpMethod, httpContext );

+            }

+            catch ( SocketTimeoutException e )

+            {

+                // could be a sporadic failure, one more retry before we give up

+                response = httpClient.execute( httpMethod, httpContext );

+            }

+

+            int status = response.getStatusLine().getStatusCode();

+            if ( status != HttpStatus.SC_OK )

+            {

+                throw new FileNotFoundException( "Unexpected HTTP status code " + status + " getting resource "

+                    + url.toExternalForm() + "." );

+            }

+            else

+            {

+                int pos = url.getPath().lastIndexOf( '/' );

+                List<URI> redirects = httpContext.getRedirectLocations();

+                if ( pos >= 0 && isNotEmpty( redirects ) )

+                {

+                    URI location = redirects.get( redirects.size() - 1 );

+                    String suffix = url.getPath().substring( pos );

+                    // Redirections shall point to the same file, e.g. /package-list

+                    if ( !location.getPath().endsWith( suffix ) )

+                    {

+                        throw new FileNotFoundException( url.toExternalForm() + " redirects to "

+                                + location.toURL().toExternalForm() + "." );

+                    }

+                }

+            }

+

+            // Intentionally using the platform default encoding here since this is what Javadoc uses internally.

+            reader = new BufferedReader( new InputStreamReader( response.getEntity().getContent() ) )

+            {

+                @Override

+                public void close()

+                    throws IOException

+                {

+                    super.close();

+

+                    if ( httpMethod != null )

+                    {

+                        httpMethod.releaseConnection();

+                    }

+                    if ( httpClient != null )

+                    {

+                        httpClient.getConnectionManager().shutdown();

+                    }

+                }

+            };

+        }

+

+        return reader;

     }

 

     private static boolean isValidPackageName( String str )

@@ -1778,9 +1782,7 @@
      *

      * @param settings The settings to use for setting up the client or {@code null}.

      * @param url The {@code URL} to use for setting up the client or {@code null}.

-     *

      * @return A new {@code HttpClient} instance.

-     *

      * @see #DEFAULT_TIMEOUT

      * @since 2.8

      */

@@ -1795,6 +1797,12 @@
         httpClient.getParams().setParameter( CoreProtocolPNames.USER_AGENT,

                                              "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" );

 

+        // Some server reject requests that do not have an Accept header

+        httpClient.getParams().setParameter( ClientPNames.DEFAULT_HEADERS,

+                                             Arrays.asList( new BasicHeader( HttpHeaders.ACCEPT, "*/*" ) ) );

+

+        httpClient.getParams().setParameter( ClientPNames.COOKIE_POLICY, CookiePolicy.BROWSER_COMPATIBILITY );

+

         if ( settings != null && settings.getActiveProxy() != null )

         {

             Proxy activeProxy = settings.getActiveProxy();

@@ -1803,7 +1811,7 @@
             proxyInfo.setNonProxyHosts( activeProxy.getNonProxyHosts() );

 

             if ( StringUtils.isNotEmpty( activeProxy.getHost() )

-                 && ( url == null || !ProxyUtils.validateNonProxyHosts( proxyInfo, url.getHost() ) ) )

+                && ( url == null || !ProxyUtils.validateNonProxyHosts( proxyInfo, url.getHost() ) ) )

             {

                 HttpHost proxy = new HttpHost( activeProxy.getHost(), activeProxy.getPort() );

                 httpClient.getParams().setParameter( ConnRoutePNames.DEFAULT_PROXY, proxy );

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocVersion.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocVersion.java
index 3a6fd16..27661b9 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocVersion.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocVersion.java
@@ -30,7 +30,9 @@
  * 

  * @author Robert Scholte

  * @since 3.0.0

+ * @deprecated Use {@link org.codehaus.plexus.languages.java.version.JavaVersion} instead

  */

+@Deprecated

 public class JavadocVersion implements Comparable<JavadocVersion>

 {

     private String rawVersion;

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/ResourcesBundleMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/ResourcesBundleMojo.java
index 2c13cba..89b9e73 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/ResourcesBundleMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/ResourcesBundleMojo.java
@@ -130,12 +130,7 @@
             archiver.setDestFile( bundleFile );

             archiver.createArchive();

         }

-        catch ( ArchiverException e )

-        {

-            throw new MojoExecutionException( "Failed to assemble javadoc-resources bundle archive. Reason: "

-                + e.getMessage(), e );

-        }

-        catch ( IOException e )

+        catch ( ArchiverException | IOException e )

         {

             throw new MojoExecutionException( "Failed to assemble javadoc-resources bundle archive. Reason: "

                 + e.getMessage(), e );

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/SystemUtils.java b/src/main/java/org/apache/maven/plugins/javadoc/SystemUtils.java
new file mode 100644
index 0000000..84675b3
--- /dev/null
+++ b/src/main/java/org/apache/maven/plugins/javadoc/SystemUtils.java
@@ -0,0 +1,181 @@
+package org.apache.maven.plugins.javadoc;
+
+/*
+ * 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;
+
+/**
+ * Contains several OS-specific methods from Commons-Lang3's SystemUtils. We don't want to use that class because it
+ * uses enums for Java versions, which implies that with every new Java version a new commons-lang3 is required.
+ * 
+ * @author Robert Scholte
+ * @since 3.0.1
+ */
+class SystemUtils
+{
+    /**
+     * <p>
+     * The {@code os.name} System Property. Operating system name.
+     * </p>
+     * <p>
+     * Defaults to {@code null} if the runtime does not have security access to read this property or the property does
+     * not exist.
+     * </p>
+     * <p>
+     * This value is initialized when the class is loaded. If {@link System#setProperty(String,String)} or
+     * {@link System#setProperties(java.util.Properties)} is called after this class is loaded, the value will be out of
+     * sync with that System property.
+     * </p>
+     *
+     * @since Java 1.1
+     */
+    public static final String OS_NAME = getSystemProperty( "os.name" );
+
+    /**
+     * The prefix String for all Windows OS.
+     */
+    private static final String OS_NAME_WINDOWS_PREFIX = "Windows";
+
+    /**
+     * <p>
+     * Is {@code true} if this is AIX.
+     * </p>
+     * <p>
+     * The field will return {@code false} if {@code OS_NAME} is {@code null}.
+     * </p>
+     */
+    public static final boolean IS_OS_AIX = getOSMatchesName( "AIX" );
+
+    /**
+     * <p>
+     * Is {@code true} if this is Mac.
+     * </p>
+     * <p>
+     * The field will return {@code false} if {@code OS_NAME} is {@code null}.
+     * </p>
+     */
+    public static final boolean IS_OS_MAC_OSX = getOSMatchesName( "Mac OS X" );
+
+    /**
+     * <p>
+     * Is {@code true} if this is Windows.
+     * </p>
+     * <p>
+     * The field will return {@code false} if {@code OS_NAME} is {@code null}.
+     * </p>
+     */
+    public static final boolean IS_OS_WINDOWS = getOSMatchesName( OS_NAME_WINDOWS_PREFIX );
+
+    /**
+     * The System property key for the Java home directory.
+     */
+    private static final String JAVA_HOME_KEY = "java.home";
+
+    /**
+     * <p>
+     * The {@code line.separator} System Property. Line separator (<code>&quot;\n&quot;</code> on UNIX).
+     * </p>
+     * <p>
+     * Defaults to {@code null} if the runtime does not have security access to read this property or the property does
+     * not exist.
+     * </p>
+     * <p>
+     * This value is initialized when the class is loaded. If {@link System#setProperty(String,String)} or
+     * {@link System#setProperties(java.util.Properties)} is called after this class is loaded, the value will be out of
+     * sync with that System property.
+     * </p>
+     *
+     * @since Java 1.1
+     */
+    public static final String LINE_SEPARATOR = getSystemProperty( "line.separator" );
+
+    /**
+     * Decides if the operating system matches.
+     *
+     * @param osNamePrefix the prefix for the os name
+     * @return true if matches, or false if not or can't determine
+     */
+    private static boolean getOSMatchesName( final String osNamePrefix )
+    {
+        return isOSNameMatch( OS_NAME, osNamePrefix );
+    }
+
+    /**
+     * Decides if the operating system matches.
+     * <p>
+     * This method is package private instead of private to support unit test invocation.
+     * </p>
+     *
+     * @param osName the actual OS name
+     * @param osNamePrefix the prefix for the expected OS name
+     * @return true if matches, or false if not or can't determine
+     */
+    static boolean isOSNameMatch( final String osName, final String osNamePrefix )
+    {
+        if ( osName == null )
+        {
+            return false;
+        }
+        return osName.startsWith( osNamePrefix );
+    }
+
+    /**
+     * <p>
+     * Gets the Java home directory as a {@code File}.
+     * </p>
+     *
+     * @return a directory
+     * @throws SecurityException if a security manager exists and its {@code checkPropertyAccess} method doesn't allow
+     *             access to the specified system property.
+     * @see System#getProperty(String)
+     * @since 2.1
+     */
+    public static File getJavaHome()
+    {
+        return new File( System.getProperty( JAVA_HOME_KEY ) );
+    }
+
+    /**
+     * <p>
+     * Gets a System property, defaulting to {@code null} if the property cannot be read.
+     * </p>
+     * <p>
+     * If a {@code SecurityException} is caught, the return value is {@code null} and a message is written to
+     * {@code System.err}.
+     * </p>
+     *
+     * @param property the system property name
+     * @return the system property value or {@code null} if a security problem occurs
+     */
+    private static String getSystemProperty( final String property )
+    {
+        try
+        {
+            return System.getProperty( property );
+        }
+        catch ( final SecurityException ex )
+        {
+            // we are not allowed to look at this property
+            System.err.println( "Caught a SecurityException reading the system property '" + property
+                + "'; the SystemUtils property value will default to null." );
+            return null;
+        }
+    }
+}
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/TestFixJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/TestFixJavadocMojo.java
index da02540..f20ac44 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/TestFixJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/TestFixJavadocMojo.java
@@ -38,7 +38,6 @@
  * Be Used</a>.

  *

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: TestFixJavadocMojo.java 1642248 2014-11-28 00:10:50Z hboutemy $

  * @since 2.6

  */

 @Mojo( name = "test-fix", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true )

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocJar.java b/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocJar.java
index 22ca6c0..e78b886 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocJar.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocJar.java
@@ -39,7 +39,6 @@
  * a jar using the standard <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.

  *

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: TestJavadocJar.java 1747985 2016-06-12 12:04:55Z rfscholte $

  * @since 2.5

  */

 @Mojo( name = "test-jar", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.TEST,

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocNoForkReport.java b/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocNoForkReport.java
index 67acca0..8b94f06 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocNoForkReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocNoForkReport.java
@@ -31,7 +31,6 @@
  * <tt>mvn clean deploy site</tt>.
  *
  * @author <a href="mailto:mfriedenhagen@apache.org">Mirko Friedenhagen</a>
- * @version $Id$
  * @since 2.10
  * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>
  * @see <a href="http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/javadoc.html#options">Javadoc Options </a>
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocReport.java b/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocReport.java
index be1261e..07e941d 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocReport.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocReport.java
@@ -44,7 +44,6 @@
  * <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>.

  *

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: TestJavadocReport.java 1747985 2016-06-12 12:04:55Z rfscholte $

  * @since 2.3

  * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/">Javadoc Tool</a>

  * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#options">Javadoc Options </a>

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 b4d331f..99034b2 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
@@ -24,6 +24,7 @@
 import java.io.File;

 import java.io.FileInputStream;

 import java.io.IOException;

+import java.nio.file.Path;

 import java.util.AbstractMap;

 import java.util.ArrayList;

 import java.util.Arrays;

@@ -51,9 +52,9 @@
 import org.apache.maven.plugins.javadoc.options.io.xpp3.JavadocOptionsXpp3Reader;

 import org.apache.maven.project.MavenProject;

 import org.apache.maven.shared.artifact.filter.resolve.transform.ArtifactIncludeFilterTransformer;

-import org.apache.maven.shared.artifact.resolve.ArtifactResolver;

-import org.apache.maven.shared.artifact.resolve.ArtifactResolverException;

-import org.apache.maven.shared.dependencies.resolve.DependencyResolver;

+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver;

+import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException;

+import org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolver;

 import org.codehaus.plexus.archiver.ArchiverException;

 import org.codehaus.plexus.archiver.UnArchiver;

 import org.codehaus.plexus.archiver.manager.ArchiverManager;

@@ -148,10 +149,10 @@
      * @throws ArtifactResolutionException {@link ArtifactResolutionException}

      * @throws ArtifactNotFoundException {@link ArtifactNotFoundException}

      */

-    public Map<String, Collection<String>> resolveDependencySourcePaths( final SourceResolverConfig config )

+    public Map<String, Collection<Path>> resolveDependencySourcePaths( final SourceResolverConfig config )

         throws ArtifactResolutionException, ArtifactNotFoundException

     {

-        final Map<String, Collection<String>> mappedDirs = new LinkedHashMap<>();

+        final Map<String, Collection<Path>> mappedDirs = new LinkedHashMap<>();

         

         final Map<String, MavenProject> projectMap = new HashMap<>();

         if ( config.reactorProjects() != null )

@@ -179,7 +180,7 @@
             }

         }

 

-        for ( Map.Entry<String, String> entry : resolveFromArtifacts( config, forResourceResolution ) )

+        for ( Map.Entry<String, Path> entry : resolveFromArtifacts( config, forResourceResolution ) )

         {

             mappedDirs.put( entry.getKey(), Collections.singletonList( entry.getValue() ) );

         }

@@ -227,9 +228,7 @@
             {

                 IOException error =

                     new IOException( "Failed to read javadoc options from: " + optionsFile + "\nReason: "

-                        + e.getMessage() );

-                error.initCause( e );

-                

+                        + e.getMessage(), e );

                 throw error;

             }

             finally

@@ -273,27 +272,20 @@
         List<String> dirs = new ArrayList<>( toResolve.size() );

         try

         {

-            for ( Map.Entry<String, String> entry : resolveAndUnpack( toResolve, config, RESOURCE_VALID_CLASSIFIERS,

+            for ( Map.Entry<String, Path> entry : resolveAndUnpack( toResolve, config, RESOURCE_VALID_CLASSIFIERS,

                                                                       false ) )

             {

-                dirs.add( entry.getValue() );

+                dirs.add( entry.getValue().toString() );

             }

         }

-        catch ( ArtifactResolutionException e )

+        catch ( ArtifactResolutionException | ArtifactNotFoundException e )

         {

             if ( getLogger().isDebugEnabled() )

             {

                 getLogger().debug( e.getMessage(), e );

             }

         }

-        catch ( ArtifactNotFoundException e )

-        {

-            if ( getLogger().isDebugEnabled() )

-            {

-                getLogger().debug( e.getMessage(), e );

-            }

-        }

-        

+

         List<JavadocBundle> result = new ArrayList<>();

 

         for ( String d : dirs )

@@ -311,9 +303,7 @@
                 }

                 catch ( XmlPullParserException e )

                 {

-                    IOException error = new IOException( "Failed to parse javadoc options: " + e.getMessage() );

-                    error.initCause( e );

-                    

+                    IOException error = new IOException( "Failed to parse javadoc options: " + e.getMessage(), e );

                     throw error;

                 }

             }

@@ -324,7 +314,7 @@
         return result;

     }

 

-    private Collection<Entry<String, String>> resolveFromArtifacts( final SourceResolverConfig config,

+    private Collection<Entry<String, Path>> resolveFromArtifacts( final SourceResolverConfig config,

                                                       final List<Artifact> artifacts )

         throws ArtifactResolutionException, ArtifactNotFoundException

     {

@@ -376,7 +366,7 @@
      * @throws ArtifactResolutionException if an exception occurs

      * @throws ArtifactNotFoundException if an exception occurs

      */

-    private Collection<Map.Entry<String, String>> resolveAndUnpack( final List<Artifact> artifacts,

+    private Collection<Map.Entry<String, Path>> resolveAndUnpack( final List<Artifact> artifacts,

                                                                     final SourceResolverConfig config,

                                                                     final List<String> validClassifiers,

                                                                     final boolean propagateErrors )

@@ -397,7 +387,7 @@
             filter = null;

         }

         

-        final List<Map.Entry<String, String>> result = new ArrayList<>( artifacts.size() );

+        final List<Map.Entry<String, Path>> result = new ArrayList<>( artifacts.size() );

         for ( final Artifact a : artifactSet )

         {

             if ( !validClassifiers.contains( a.getClassifier() ) || ( filter != null && !filter.include( a ) ) )

@@ -432,8 +422,7 @@
 

                 unArchiver.extract();

 

-                result.add( new AbstractMap.SimpleEntry<String, String>( a.getDependencyConflictId(),

-                                                                         d.getAbsolutePath() ) );

+                result.add( new AbstractMap.SimpleEntry<>( a.getDependencyConflictId(), d.toPath().toAbsolutePath() ) );

             }

             catch ( final NoSuchArchiverException e )

             {

@@ -455,7 +444,7 @@
         return result;

     }

 

-    private static Collection<String> resolveFromProject( final SourceResolverConfig config,

+    private static Collection<Path> resolveFromProject( final SourceResolverConfig config,

                                                     final MavenProject reactorProject, final Artifact artifact )

     {

         final List<String> dirs = new ArrayList<>();

@@ -466,19 +455,13 @@
             if ( config.includeCompileSources() )

             {

                 final List<String> srcRoots = reactorProject.getCompileSourceRoots();

-                for ( final String root : srcRoots )

-                {

-                    dirs.add( root );

-                }

+                dirs.addAll( srcRoots );

             }

 

             if ( config.includeTestSources() )

             {

                 final List<String> srcRoots = reactorProject.getTestCompileSourceRoots();

-                for ( final String root : srcRoots )

-                {

-                    dirs.add( root );

-                }

+                dirs.addAll( srcRoots );

             }

         }

 

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/resolver/SourceResolverConfig.java b/src/main/java/org/apache/maven/plugins/javadoc/resolver/SourceResolverConfig.java
index 1b6e28e..1dd2af4 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/resolver/SourceResolverConfig.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/resolver/SourceResolverConfig.java
@@ -47,7 +47,7 @@
 

     /**

      * @param project {@link MavenProject}

-     * @param buoildingRequest {@link ProjectBuildingRequest}

+     * @param buildingRequest {@link ProjectBuildingRequest}

      * @param outputBasedir The output base directory.

      */

     public SourceResolverConfig( final MavenProject project, final ProjectBuildingRequest buildingRequest,

@@ -59,7 +59,7 @@
     }

 

     /**

-     * @param filter {@link ArtifactFilter}

+     * @param filter {@link AndFilter}

      * @return {@link SourceResolverConfig}

      */

     public SourceResolverConfig withFilter( final AndFilter filter )

@@ -131,7 +131,7 @@
     }

 

     /**

-     * @return {@link TransformableFilter}

+     * @return {@link AndFilter}

      */

     public AndFilter filter()

     {

diff --git a/src/main/mdo/javadocOptions.mdo b/src/main/mdo/javadocOptions.mdo
index 8f944b9..3c50092 100644
--- a/src/main/mdo/javadocOptions.mdo
+++ b/src/main/mdo/javadocOptions.mdo
@@ -19,9 +19,9 @@
 under the License.
 -->
 
-<model xmlns="http://modello.codehaus.org/MODELLO/1.1.0" 
+<model xmlns="https://codehaus-plexus.github.io/MODELLO/1.1.0" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-       xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.1.0 http://modello.codehaus.org/xsd/modello-1.1.0.xsd"
+       xsi:schemaLocation="https://codehaus-plexus.github.io/MODELLO/1.1.0 https://codehaus-plexus.github.io/modello/xsd/modello-1.1.0.xsd"
        xsd.namespace="http://http://maven.apache.org/plugins/maven-javadoc-plugin/maven-javadoc-options/${version}" 
        xsd.targetNamespace="http://maven.apache.org/plugins/maven-javadoc-plugin/xsd/maven-javadoc-options-${version}.xsd">
   <id>javadocoptions</id>
@@ -207,25 +207,19 @@
           <type>String</type>
           <identifier>true</identifier>
         </field>
+        <field java.setter='false'>
+          <name>placement</name>
+          <description>Placement of the tag.</description>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <identifier>true</identifier>
+        </field>
       </fields>
       <codeSegments>
         <codeSegment>
           <version>1.0.0+</version>
             <code><![CDATA[
     /**
-     * Field placement
-     */
-    private String placement;
-
-    /**
-     * Get the placement.
-     */
-    public String getPlacement()
-    {
-        return this.placement;
-    }
-
-    /**
      * Set a Placement. Should be a combinaison of the letters:
      * <ul>
      * <li> X (disable tag)</li>
@@ -259,7 +253,7 @@
                 case 'f':
                     break;
                 default:
-                    throw new IllegalArgumentException( "Placement should be a combinaison of the letters 'Xaoptcmf'." );
+                    throw new IllegalArgumentException( "Placement should be a combination of the letters 'Xaoptcmf'." );
             }
         }
         this.placement = placement;
diff --git a/src/main/resources/javadoc-report_es.properties b/src/main/resources/javadoc-report_es.properties
new file mode 100644
index 0000000..75b402f
--- /dev/null
+++ b/src/main/resources/javadoc-report_es.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.
+
+report.javadoc.name=Javadoc
+report.javadoc.description=Documentaci\u00F3n de API Javadoc.
diff --git a/src/main/resources/org/apache/maven/plugins/javadoc/java-api-element-list-10 b/src/main/resources/org/apache/maven/plugins/javadoc/java-api-element-list-10
new file mode 100644
index 0000000..8c46f3d
--- /dev/null
+++ b/src/main/resources/org/apache/maven/plugins/javadoc/java-api-element-list-10
@@ -0,0 +1,391 @@
+module:java.activation
+javax.activation
+module:java.base
+java.io
+java.lang
+java.lang.annotation
+java.lang.invoke
+java.lang.module
+java.lang.ref
+java.lang.reflect
+java.math
+java.net
+java.net.spi
+java.nio
+java.nio.channels
+java.nio.channels.spi
+java.nio.charset
+java.nio.charset.spi
+java.nio.file
+java.nio.file.attribute
+java.nio.file.spi
+java.security
+java.security.acl
+java.security.cert
+java.security.interfaces
+java.security.spec
+java.text
+java.text.spi
+java.time
+java.time.chrono
+java.time.format
+java.time.temporal
+java.time.zone
+java.util
+java.util.concurrent
+java.util.concurrent.atomic
+java.util.concurrent.locks
+java.util.function
+java.util.jar
+java.util.regex
+java.util.spi
+java.util.stream
+java.util.zip
+javax.crypto
+javax.crypto.interfaces
+javax.crypto.spec
+javax.net
+javax.net.ssl
+javax.security.auth
+javax.security.auth.callback
+javax.security.auth.login
+javax.security.auth.spi
+javax.security.auth.x500
+javax.security.cert
+module:java.compiler
+javax.annotation.processing
+javax.lang.model
+javax.lang.model.element
+javax.lang.model.type
+javax.lang.model.util
+javax.tools
+module:java.corba
+javax.activity
+javax.rmi
+javax.rmi.CORBA
+org.omg.CORBA
+org.omg.CORBA_2_3
+org.omg.CORBA_2_3.portable
+org.omg.CORBA.DynAnyPackage
+org.omg.CORBA.ORBPackage
+org.omg.CORBA.portable
+org.omg.CORBA.TypeCodePackage
+org.omg.CosNaming
+org.omg.CosNaming.NamingContextExtPackage
+org.omg.CosNaming.NamingContextPackage
+org.omg.Dynamic
+org.omg.DynamicAny
+org.omg.DynamicAny.DynAnyFactoryPackage
+org.omg.DynamicAny.DynAnyPackage
+org.omg.IOP
+org.omg.IOP.CodecFactoryPackage
+org.omg.IOP.CodecPackage
+org.omg.Messaging
+org.omg.PortableInterceptor
+org.omg.PortableInterceptor.ORBInitInfoPackage
+org.omg.PortableServer
+org.omg.PortableServer.CurrentPackage
+org.omg.PortableServer.POAManagerPackage
+org.omg.PortableServer.POAPackage
+org.omg.PortableServer.portable
+org.omg.PortableServer.ServantLocatorPackage
+org.omg.SendingContext
+org.omg.stub.java.rmi
+module:java.datatransfer
+java.awt.datatransfer
+module:java.desktop
+java.applet
+java.awt
+java.awt.color
+java.awt.desktop
+java.awt.dnd
+java.awt.event
+java.awt.font
+java.awt.geom
+java.awt.im
+java.awt.im.spi
+java.awt.image
+java.awt.image.renderable
+java.awt.print
+java.beans
+java.beans.beancontext
+javax.accessibility
+javax.imageio
+javax.imageio.event
+javax.imageio.metadata
+javax.imageio.plugins.bmp
+javax.imageio.plugins.jpeg
+javax.imageio.plugins.tiff
+javax.imageio.spi
+javax.imageio.stream
+javax.print
+javax.print.attribute
+javax.print.attribute.standard
+javax.print.event
+javax.sound.midi
+javax.sound.midi.spi
+javax.sound.sampled
+javax.sound.sampled.spi
+javax.swing
+javax.swing.border
+javax.swing.colorchooser
+javax.swing.event
+javax.swing.filechooser
+javax.swing.plaf
+javax.swing.plaf.basic
+javax.swing.plaf.metal
+javax.swing.plaf.multi
+javax.swing.plaf.nimbus
+javax.swing.plaf.synth
+javax.swing.table
+javax.swing.text
+javax.swing.text.html
+javax.swing.text.html.parser
+javax.swing.text.rtf
+javax.swing.tree
+javax.swing.undo
+module:java.instrument
+java.lang.instrument
+module:java.jnlp
+javax.jnlp
+module:java.logging
+java.util.logging
+module:java.management
+java.lang.management
+javax.management
+javax.management.loading
+javax.management.modelmbean
+javax.management.monitor
+javax.management.openmbean
+javax.management.relation
+javax.management.remote
+javax.management.timer
+module:java.management.rmi
+javax.management.remote.rmi
+module:java.naming
+javax.naming
+javax.naming.directory
+javax.naming.event
+javax.naming.ldap
+javax.naming.spi
+module:java.prefs
+java.util.prefs
+module:java.rmi
+java.rmi
+java.rmi.activation
+java.rmi.dgc
+java.rmi.registry
+java.rmi.server
+javax.rmi.ssl
+module:java.scripting
+javax.script
+module:java.se
+module:java.se.ee
+module:java.security.jgss
+javax.security.auth.kerberos
+org.ietf.jgss
+module:java.security.sasl
+javax.security.sasl
+module:java.smartcardio
+javax.smartcardio
+module:java.sql
+java.sql
+javax.sql
+javax.transaction.xa
+module:java.sql.rowset
+javax.sql.rowset
+javax.sql.rowset.serial
+javax.sql.rowset.spi
+module:java.transaction
+javax.transaction
+module:java.xml
+javax.xml
+javax.xml.catalog
+javax.xml.datatype
+javax.xml.namespace
+javax.xml.parsers
+javax.xml.stream
+javax.xml.stream.events
+javax.xml.stream.util
+javax.xml.transform
+javax.xml.transform.dom
+javax.xml.transform.sax
+javax.xml.transform.stax
+javax.xml.transform.stream
+javax.xml.validation
+javax.xml.xpath
+org.w3c.dom
+org.w3c.dom.bootstrap
+org.w3c.dom.events
+org.w3c.dom.ls
+org.w3c.dom.ranges
+org.w3c.dom.traversal
+org.w3c.dom.views
+org.xml.sax
+org.xml.sax.ext
+org.xml.sax.helpers
+module:java.xml.bind
+javax.xml.bind
+javax.xml.bind.annotation
+javax.xml.bind.annotation.adapters
+javax.xml.bind.attachment
+javax.xml.bind.helpers
+javax.xml.bind.util
+module:java.xml.crypto
+javax.xml.crypto
+javax.xml.crypto.dom
+javax.xml.crypto.dsig
+javax.xml.crypto.dsig.dom
+javax.xml.crypto.dsig.keyinfo
+javax.xml.crypto.dsig.spec
+module:java.xml.ws
+javax.jws
+javax.jws.soap
+javax.xml.soap
+javax.xml.ws
+javax.xml.ws.handler
+javax.xml.ws.handler.soap
+javax.xml.ws.http
+javax.xml.ws.soap
+javax.xml.ws.spi
+javax.xml.ws.spi.http
+javax.xml.ws.wsaddressing
+module:java.xml.ws.annotation
+javax.annotation
+module:javafx.base
+javafx.beans
+javafx.beans.binding
+javafx.beans.property
+javafx.beans.property.adapter
+javafx.beans.value
+javafx.collections
+javafx.collections.transformation
+javafx.event
+javafx.util
+javafx.util.converter
+module:javafx.controls
+javafx.scene.chart
+javafx.scene.control
+javafx.scene.control.cell
+javafx.scene.control.skin
+module:javafx.fxml
+javafx.fxml
+module:javafx.graphics
+javafx.animation
+javafx.application
+javafx.concurrent
+javafx.css
+javafx.css.converter
+javafx.geometry
+javafx.print
+javafx.scene
+javafx.scene.canvas
+javafx.scene.effect
+javafx.scene.image
+javafx.scene.input
+javafx.scene.layout
+javafx.scene.paint
+javafx.scene.shape
+javafx.scene.text
+javafx.scene.transform
+javafx.stage
+module:javafx.media
+javafx.scene.media
+module:javafx.swing
+javafx.embed.swing
+module:javafx.web
+javafx.scene.web
+module:jdk.accessibility
+com.sun.java.accessibility.util
+module:jdk.attach
+com.sun.tools.attach
+com.sun.tools.attach.spi
+module:jdk.charsets
+module:jdk.compiler
+com.sun.source.doctree
+com.sun.source.tree
+com.sun.source.util
+com.sun.tools.javac
+module:jdk.crypto.cryptoki
+module:jdk.crypto.ec
+module:jdk.dynalink
+jdk.dynalink
+jdk.dynalink.beans
+jdk.dynalink.linker
+jdk.dynalink.linker.support
+jdk.dynalink.support
+module:jdk.editpad
+module:jdk.hotspot.agent
+module:jdk.httpserver
+com.sun.net.httpserver
+com.sun.net.httpserver.spi
+module:jdk.incubator.httpclient
+jdk.incubator.http
+module:jdk.jartool
+com.sun.jarsigner
+jdk.security.jarsigner
+module:jdk.javadoc
+com.sun.javadoc
+com.sun.tools.javadoc
+jdk.javadoc.doclet
+module:jdk.jcmd
+module:jdk.jconsole
+com.sun.tools.jconsole
+module:jdk.jdeps
+module:jdk.jdi
+com.sun.jdi
+com.sun.jdi.connect
+com.sun.jdi.connect.spi
+com.sun.jdi.event
+com.sun.jdi.request
+module:jdk.jdwp.agent
+module:jdk.jfr
+jdk.jfr
+jdk.jfr.consumer
+module:jdk.jlink
+module:jdk.jshell
+jdk.jshell
+jdk.jshell.execution
+jdk.jshell.spi
+jdk.jshell.tool
+module:jdk.jsobject
+netscape.javascript
+module:jdk.jstatd
+module:jdk.localedata
+module:jdk.management
+com.sun.management
+module:jdk.management.agent
+module:jdk.management.cmm
+jdk.management.cmm
+module:jdk.management.jfr
+jdk.management.jfr
+module:jdk.management.resource
+jdk.management.resource
+module:jdk.naming.dns
+module:jdk.naming.rmi
+module:jdk.net
+jdk.net
+module:jdk.pack
+module:jdk.packager.services
+jdk.packager.services
+jdk.packager.services.singleton
+module:jdk.rmic
+module:jdk.scripting.nashorn
+jdk.nashorn.api.scripting
+jdk.nashorn.api.tree
+module:jdk.sctp
+com.sun.nio.sctp
+module:jdk.security.auth
+com.sun.security.auth
+com.sun.security.auth.callback
+com.sun.security.auth.login
+com.sun.security.auth.module
+module:jdk.security.jgss
+com.sun.security.jgss
+module:jdk.snmp
+module:jdk.xml.dom
+org.w3c.dom.css
+org.w3c.dom.html
+org.w3c.dom.stylesheets
+org.w3c.dom.xpath
+module:jdk.zipfs
\ No newline at end of file
diff --git a/src/main/resources/org/apache/maven/plugins/javadoc/java-api-element-list-11 b/src/main/resources/org/apache/maven/plugins/javadoc/java-api-element-list-11
new file mode 100644
index 0000000..bfb4f01
--- /dev/null
+++ b/src/main/resources/org/apache/maven/plugins/javadoc/java-api-element-list-11
@@ -0,0 +1,282 @@
+module:java.base
+java.io
+java.lang
+java.lang.annotation
+java.lang.invoke
+java.lang.module
+java.lang.ref
+java.lang.reflect
+java.math
+java.net
+java.net.spi
+java.nio
+java.nio.channels
+java.nio.channels.spi
+java.nio.charset
+java.nio.charset.spi
+java.nio.file
+java.nio.file.attribute
+java.nio.file.spi
+java.security
+java.security.acl
+java.security.cert
+java.security.interfaces
+java.security.spec
+java.text
+java.text.spi
+java.time
+java.time.chrono
+java.time.format
+java.time.temporal
+java.time.zone
+java.util
+java.util.concurrent
+java.util.concurrent.atomic
+java.util.concurrent.locks
+java.util.function
+java.util.jar
+java.util.regex
+java.util.spi
+java.util.stream
+java.util.zip
+javax.crypto
+javax.crypto.interfaces
+javax.crypto.spec
+javax.net
+javax.net.ssl
+javax.security.auth
+javax.security.auth.callback
+javax.security.auth.login
+javax.security.auth.spi
+javax.security.auth.x500
+javax.security.cert
+module:java.compiler
+javax.annotation.processing
+javax.lang.model
+javax.lang.model.element
+javax.lang.model.type
+javax.lang.model.util
+javax.tools
+module:java.datatransfer
+java.awt.datatransfer
+module:java.desktop
+java.applet
+java.awt
+java.awt.color
+java.awt.desktop
+java.awt.dnd
+java.awt.event
+java.awt.font
+java.awt.geom
+java.awt.im
+java.awt.im.spi
+java.awt.image
+java.awt.image.renderable
+java.awt.print
+java.beans
+java.beans.beancontext
+javax.accessibility
+javax.imageio
+javax.imageio.event
+javax.imageio.metadata
+javax.imageio.plugins.bmp
+javax.imageio.plugins.jpeg
+javax.imageio.plugins.tiff
+javax.imageio.spi
+javax.imageio.stream
+javax.print
+javax.print.attribute
+javax.print.attribute.standard
+javax.print.event
+javax.sound.midi
+javax.sound.midi.spi
+javax.sound.sampled
+javax.sound.sampled.spi
+javax.swing
+javax.swing.border
+javax.swing.colorchooser
+javax.swing.event
+javax.swing.filechooser
+javax.swing.plaf
+javax.swing.plaf.basic
+javax.swing.plaf.metal
+javax.swing.plaf.multi
+javax.swing.plaf.nimbus
+javax.swing.plaf.synth
+javax.swing.table
+javax.swing.text
+javax.swing.text.html
+javax.swing.text.html.parser
+javax.swing.text.rtf
+javax.swing.tree
+javax.swing.undo
+module:java.instrument
+java.lang.instrument
+module:java.logging
+java.util.logging
+module:java.management
+java.lang.management
+javax.management
+javax.management.loading
+javax.management.modelmbean
+javax.management.monitor
+javax.management.openmbean
+javax.management.relation
+javax.management.remote
+javax.management.timer
+module:java.management.rmi
+javax.management.remote.rmi
+module:java.naming
+javax.naming
+javax.naming.directory
+javax.naming.event
+javax.naming.ldap
+javax.naming.spi
+module:java.net.http
+java.net.http
+module:java.prefs
+java.util.prefs
+module:java.rmi
+java.rmi
+java.rmi.activation
+java.rmi.dgc
+java.rmi.registry
+java.rmi.server
+javax.rmi.ssl
+module:java.scripting
+javax.script
+module:java.se
+module:java.security.jgss
+javax.security.auth.kerberos
+org.ietf.jgss
+module:java.security.sasl
+javax.security.sasl
+module:java.smartcardio
+javax.smartcardio
+module:java.sql
+java.sql
+javax.sql
+module:java.sql.rowset
+javax.sql.rowset
+javax.sql.rowset.serial
+javax.sql.rowset.spi
+module:java.transaction.xa
+javax.transaction.xa
+module:java.xml
+javax.xml
+javax.xml.catalog
+javax.xml.datatype
+javax.xml.namespace
+javax.xml.parsers
+javax.xml.stream
+javax.xml.stream.events
+javax.xml.stream.util
+javax.xml.transform
+javax.xml.transform.dom
+javax.xml.transform.sax
+javax.xml.transform.stax
+javax.xml.transform.stream
+javax.xml.validation
+javax.xml.xpath
+org.w3c.dom
+org.w3c.dom.bootstrap
+org.w3c.dom.events
+org.w3c.dom.ls
+org.w3c.dom.ranges
+org.w3c.dom.traversal
+org.w3c.dom.views
+org.xml.sax
+org.xml.sax.ext
+org.xml.sax.helpers
+module:java.xml.crypto
+javax.xml.crypto
+javax.xml.crypto.dom
+javax.xml.crypto.dsig
+javax.xml.crypto.dsig.dom
+javax.xml.crypto.dsig.keyinfo
+javax.xml.crypto.dsig.spec
+module:jdk.accessibility
+com.sun.java.accessibility.util
+module:jdk.attach
+com.sun.tools.attach
+com.sun.tools.attach.spi
+module:jdk.charsets
+module:jdk.compiler
+com.sun.source.doctree
+com.sun.source.tree
+com.sun.source.util
+com.sun.tools.javac
+module:jdk.crypto.cryptoki
+module:jdk.crypto.ec
+module:jdk.dynalink
+jdk.dynalink
+jdk.dynalink.beans
+jdk.dynalink.linker
+jdk.dynalink.linker.support
+jdk.dynalink.support
+module:jdk.editpad
+module:jdk.hotspot.agent
+module:jdk.httpserver
+com.sun.net.httpserver
+com.sun.net.httpserver.spi
+module:jdk.jartool
+com.sun.jarsigner
+jdk.security.jarsigner
+module:jdk.javadoc
+com.sun.javadoc
+com.sun.tools.javadoc
+jdk.javadoc.doclet
+module:jdk.jcmd
+module:jdk.jconsole
+com.sun.tools.jconsole
+module:jdk.jdeps
+module:jdk.jdi
+com.sun.jdi
+com.sun.jdi.connect
+com.sun.jdi.connect.spi
+com.sun.jdi.event
+com.sun.jdi.request
+module:jdk.jdwp.agent
+module:jdk.jfr
+jdk.jfr
+jdk.jfr.consumer
+module:jdk.jlink
+module:jdk.jshell
+jdk.jshell
+jdk.jshell.execution
+jdk.jshell.spi
+jdk.jshell.tool
+module:jdk.jsobject
+netscape.javascript
+module:jdk.jstatd
+module:jdk.localedata
+module:jdk.management
+com.sun.management
+module:jdk.management.agent
+module:jdk.management.jfr
+jdk.management.jfr
+module:jdk.naming.dns
+module:jdk.naming.rmi
+module:jdk.net
+jdk.net
+jdk.nio
+module:jdk.pack
+module:jdk.rmic
+module:jdk.scripting.nashorn
+jdk.nashorn.api.scripting
+jdk.nashorn.api.tree
+module:jdk.sctp
+com.sun.nio.sctp
+module:jdk.security.auth
+com.sun.security.auth
+com.sun.security.auth.callback
+com.sun.security.auth.login
+com.sun.security.auth.module
+module:jdk.security.jgss
+com.sun.security.jgss
+module:jdk.xml.dom
+org.w3c.dom.css
+org.w3c.dom.html
+org.w3c.dom.stylesheets
+org.w3c.dom.xpath
+module:jdk.zipfs
\ No newline at end of file
diff --git a/src/main/resources/test-javadoc-report_es.properties b/src/main/resources/test-javadoc-report_es.properties
new file mode 100644
index 0000000..a726495
--- /dev/null
+++ b/src/main/resources/test-javadoc-report_es.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.
+
+report.test-javadoc.name=Javadoc de Pruebas
+report.test-javadoc.description=Documentaci\u00F3n de API Javadoc para Pruebas.
diff --git a/src/site/apt/examples/aggregate.apt.vm b/src/site/apt/examples/aggregate.apt.vm
index 53d541b..c10e094 100644
--- a/src/site/apt/examples/aggregate.apt.vm
+++ b/src/site/apt/examples/aggregate.apt.vm
@@ -37,9 +37,13 @@
   |-- pom.xml
   |-- Module1
   |   `-- pom.xml
-  |-- Module2
+  |   `-- Module 2
+  |       `-- pom.xml
+  |   `-- Module 3
+  |       `-- pom.xml
+  |-- Module4
   |   `-- pom.xml
-  `-- Module3
+  `-- Module5
     `-- pom.xml
 
 +-----+
@@ -50,8 +54,42 @@
  <<<aggregate>>> goal instead of.
 
  The {{{../javadoc-mojo.html#aggregate}\<aggregate/\>}} parameter can be used to generate javadocs for multi-module
- projects. It gives the option to
- generate one javadoc report for the entire project (all modules) or generate one javadoc report for each module.
+ projects. It gives the option to generate one javadoc report for the entire project (all modules) or generate one 
+ javadoc report for each module. Since 3.1.0 the <<<aggregate>>> has changed a little bit. It'll generate aggregated 
+ reports at every level.
+ To get only an aggregated project at root level, you need to configure the pom like:
+ 
+ +-----+
+<project>
+  ...
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <version>${project.version}</version>
+        <reportSets>
+          <reportSet>
+            <id>aggregate</id>
+            <inherited>false</inherited>        
+            <reports>
+              <report>aggregate</report>
+            </reports>
+          </reportSet>
+          <reportSet>
+            <id>default</id>
+            <reports>
+              <report>javadoc</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+    ...
+  </reporting>
+  ...
+</project>
++-----+
 
  When you execute javadoc:javadoc from Project directory with aggregate set to <<true>>, a javadoc report will be created
  in the target directory of Project with all the javadocs of Project's modules included. If aggregate is
diff --git a/src/site/apt/examples/alternate-doclet.apt.vm b/src/site/apt/examples/alternate-doclet.apt.vm
index 5b02dce..04cbbbc 100644
--- a/src/site/apt/examples/alternate-doclet.apt.vm
+++ b/src/site/apt/examples/alternate-doclet.apt.vm
@@ -55,8 +55,9 @@
             <artifactId>doclet</artifactId>
             <version>5.1</version>
           </docletArtifact>
-          <additionalparam>-views</additionalparam>
-          <useStandardDocletOptions>true</useStandardDocletOptions>
+          <additionalOptions>
+            <additionalOption>-views</additionalOption>
+          </additionalOptions>
         </configuration>
       </plugin>
     ...
@@ -68,7 +69,7 @@
 
  <<Note>>:
 
-   * {{{../javadoc-mojo.html#additionalparam}\<additionalparam/\>}} parameter could be used to set additional
+   * {{{../javadoc-mojo.html#additionalOptions}\<additionalOptions/\>}} parameter could be used to set additional
    parameters on the command line, specifically for doclet options.
 
    * {{{../javadoc-mojo.html#useStandardDocletOptions}\<useStandardDocletOptions/\>}} parameter could be used to specify
@@ -119,9 +120,10 @@
                 <artifactId>doccheck</artifactId>
                 <version>1.2b2</version>
               </docletArtifact>
-              <additionalparam>
-                    -d \${project.build.directory}/site/doccheck
-              </additionalparam>
+              <additionalOptions>
+                <additionalOption>-d</additionalOption>
+                <additionalOption>\${project.build.directory}/site/doccheck</additionalOption>
+              </additionalOptions>
 
               <!-- Other dir than apidocs -->
               <destDir>doccheck</destDir>
diff --git a/src/site/fml/faq.fml b/src/site/fml/faq.fml
index 5e876bd..290f157 100644
--- a/src/site/fml/faq.fml
+++ b/src/site/fml/faq.fml
@@ -97,7 +97,7 @@
           You could need to add more Javadoc parameters to be process by the Javadoc Tool (i.e. for doclet).
         </p>
         <p>
-          For this, you should use the <i>&lt;additionalparam/&gt;</i> parameter in your Javadoc Plugin configuration.
+          For this, you should use the <i>&lt;additionalOptions/&gt;</i> parameter in your Javadoc Plugin configuration.
         </p>
       </answer>
     </faq>
@@ -454,4 +454,4 @@
       </answer>
     </faq>
   </part>
-</faqs>
\ No newline at end of file
+</faqs>
diff --git a/src/site/xdoc/download.xml.vm b/src/site/xdoc/download.xml.vm
index 09d4f42..3f71035 100644
--- a/src/site/xdoc/download.xml.vm
+++ b/src/site/xdoc/download.xml.vm
@@ -34,7 +34,7 @@
 
       <p>In order to guard against corrupted downloads/installations, it is highly recommended to
       <a href="http://www.apache.org/dev/release-signing#verifying-signature">verify the signature</a>
-      of the release bundles against the public <a href="http://www.apache.org/dist/maven/KEYS">KEYS</a> used by the Apache Maven
+      of the release bundles against the public <a href="https://www.apache.org/dist/maven/KEYS">KEYS</a> used by the Apache Maven
       developers.</p>
 
       <p>${project.name} is distributed under the <a href="http://www.apache.org/licenses/">Apache License, version 2.0</a>.</p>
@@ -108,8 +108,8 @@
           <tr>
             <td>${project.name} ${project.version} (Source zip)</td>
             <td><a href="[preferred]maven/plugins/${project.artifactId}-${project.version}-source-release.zip">maven/plugins/${project.artifactId}-${project.version}-source-release.zip</a></td>
-            <td><a href="http://www.apache.org/dist/maven/plugins/${project.artifactId}-${project.version}-source-release.zip.md5">maven/plugins/${project.artifactId}-${project.version}-source-release.zip.md5</a></td>
-            <td><a href="http://www.apache.org/dist/maven/plugins/${project.artifactId}-${project.version}-source-release.zip.asc">maven/plugins/${project.artifactId}-${project.version}-source-release.zip.asc</a></td>
+            <td><a href="https://www.apache.org/dist/maven/plugins/${project.artifactId}-${project.version}-source-release.zip.sha512">maven/plugins/${project.artifactId}-${project.version}-source-release.zip.sha512</a></td>
+            <td><a href="https://www.apache.org/dist/maven/plugins/${project.artifactId}-${project.version}-source-release.zip.asc">maven/plugins/${project.artifactId}-${project.version}-source-release.zip.asc</a></td>
           </tr>
         </tbody>
       </table>
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojoTest.java b/src/test/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojoTest.java
index 56988f7..1432492 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojoTest.java
@@ -39,7 +39,7 @@
     extends TestCase

 {

     AbstractJavadocMojo mojo;

-    

+

     @Override

     protected void setUp()

         throws Exception

@@ -54,7 +54,7 @@
             }

         };

     }

-    

+

     public void testMJAVADOC432_DetectLinksMessages()

     {

         Log log = mock( Log.class );

@@ -76,4 +76,15 @@
         verify( log, times( 4 ) ).error( anyString() );

         verify( log, times( 4 ) ).warn( anyString() ); // no extra warnings

     }

+

+    public void testMJAVADOC527_DetectLinksRecursion()

+    {

+        Log log = mock( Log.class );

+        when( log.isErrorEnabled() ).thenReturn( true );

+        mojo.setLog( log );

+        mojo.outputDirectory = new File( "target/test-classes" );

+

+        assertFalse( mojo.isValidJavadocLink( "http://javamail.java.net/mailapi/apidocs", false ) );

+        assertTrue( mojo.isValidJavadocLink( "http://commons.apache.org/proper/commons-lang/apidocs", false ) );

+    }

 }

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReportTest.java b/src/test/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReportTest.java
index 706b26e..1bfad67 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReportTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/AggregatorJavadocReportTest.java
@@ -31,6 +31,7 @@
 import org.apache.maven.plugin.testing.AbstractMojoTestCase;

 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;

 import org.apache.maven.project.MavenProject;

+import org.codehaus.plexus.languages.java.version.JavaVersion;

 import org.codehaus.plexus.util.FileUtils;

 import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;

 import org.sonatype.aether.util.DefaultRepositorySystemSession;

@@ -231,7 +232,16 @@
         File apidocs = new File( getBasedir(), "target/test/unit/aggregate-resources-test/target/site/apidocs" );

 

         // Test overview

-        File overviewSummary = new File( apidocs, "overview-summary.html" );

+        File overviewSummary;

+        if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore( "11" ) )

+        {

+            overviewSummary = new File( apidocs, "overview-summary.html" );

+        }

+        else

+        {

+            overviewSummary = new File( apidocs, "index.html" );

+        }

+        

         assertTrue( overviewSummary.exists() );

         String overview = readFile( overviewSummary ).toLowerCase();

         assertTrue( overview.contains( "<a href=\"resources/test/package-summary.html\">resources.test</a>" ) );

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java b/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java
index 9578f58..7fbb13f 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java
@@ -21,22 +21,19 @@
 

 import java.io.File;

 import java.io.IOException;

-import java.io.Reader;

 import java.io.StringReader;

 import java.util.ArrayList;

 import java.util.Arrays;

 import java.util.List;

 import java.util.Properties;

 

-import org.apache.commons.lang3.SystemUtils;

 import org.apache.maven.plugin.logging.Log;

 import org.apache.maven.plugin.testing.AbstractMojoTestCase;

 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;

 import org.apache.maven.plugins.javadoc.AbstractFixJavadocMojo.JavaEntityTags;

 import org.apache.maven.shared.invoker.MavenInvocationException;

+import org.codehaus.plexus.languages.java.version.JavaVersion;

 import org.codehaus.plexus.util.FileUtils;

-import org.codehaus.plexus.util.IOUtil;

-import org.codehaus.plexus.util.ReaderFactory;

 import org.codehaus.plexus.util.StringUtils;

 

 import com.thoughtworks.qdox.JavaProjectBuilder;

@@ -48,7 +45,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: FixJavadocMojoTest.java 1752069 2016-07-10 09:58:59Z rfscholte $

  */

 public class FixJavadocMojoTest

     extends AbstractMojoTestCase

@@ -150,7 +146,7 @@
     {

         // Should be an assumption, but not supported by TestCase

         // Java 5 not supported by Java9 anymore

-        if ( JavadocVersion.parse( SystemUtils.JAVA_SPECIFICATION_VERSION ).compareTo( JavadocVersion.parse( "9" ) ) >= 0 )

+        if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast( "9" ) )

         {

             return;

         }

@@ -464,9 +460,6 @@
         assertTrue( withoutEmptyJavadocLines.endsWith( "any" ) );

     }

 

-    /**

-     * @throws Throwable if any

-     */

     public void testJavadocCommentJdk5()

         throws Exception

     {

@@ -649,16 +642,21 @@
         invokerDir.mkdirs();

         File invokerLogFile = FileUtils.createTempFile( "FixJavadocMojoTest", ".txt", invokerDir );

         

-        JavadocVersion JAVA_9 = JavadocVersion.parse( SystemUtils.JAVA_SPECIFICATION_VERSION );

-        

         Properties properties = new Properties();

         

-        if( JavadocVersion.parse( SystemUtils.JAVA_SPECIFICATION_VERSION ).compareTo( JAVA_9 ) >= 0 )

+        if( JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast( "9" ) )

         {

             properties.put( "maven.compiler.source", "1.6" );

             properties.put( "maven.compiler.target", "1.6" );

         }

         

+        // @todo unittests shouldn't need to go remote

+        if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore( "8" ) )

+        {

+            // ensure that Java7 picks up TLSv1.2 when connecting with Central

+            properties.put( "https.protocols", "TLSv1.2" );

+        }

+        

         JavadocUtil.invokeMaven( log, new File( getBasedir(), "target/local-repo" ), testPom, goals, properties,

                                  invokerLogFile );

     }

@@ -719,18 +717,7 @@
     private static String readFile( File file )

         throws Exception

     {

-        Reader fileReader = null;

-        try

-        {

-            fileReader = ReaderFactory.newReader( file, "UTF-8" );

-            final String content = IOUtil.toString( fileReader );

-            fileReader.close();

-            fileReader = null;

-            return content;

-        }

-        finally

-        {

-            IOUtil.close( fileReader );

-        }

+        String content = FileUtils.fileRead( file, "UTF-8" );

+        return content;

     }

 }

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/JavadocJarTest.java b/src/test/java/org/apache/maven/plugins/javadoc/JavadocJarTest.java
index e066e47..16d7a4e 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/JavadocJarTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/JavadocJarTest.java
@@ -33,10 +33,8 @@
 import org.apache.maven.plugin.MojoExecution;

 import org.apache.maven.plugin.testing.AbstractMojoTestCase;

 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;

-import org.apache.maven.plugins.javadoc.AbstractJavadocMojo;

-import org.apache.maven.plugins.javadoc.JavadocJar;

-import org.apache.maven.plugins.javadoc.JavadocVersion;

 import org.apache.maven.project.MavenProject;

+import org.codehaus.plexus.languages.java.version.JavaVersion;

 import org.codehaus.plexus.util.FileUtils;

 

 /**

@@ -96,12 +94,12 @@
         }

 

         assertTrue( set.contains( "stylesheet.css" ) );

-        JavadocVersion javadocVersion = (JavadocVersion) getVariableValueFromObject( mojo, "javadocRuntimeVersion" );

-        if ( javadocVersion.compareTo( JavadocVersion.parse( "1.7" ) ) < 0 )

+        JavaVersion javadocVersion = (JavaVersion) getVariableValueFromObject( mojo, "javadocRuntimeVersion" );

+        if ( javadocVersion.isBefore( "1.7" ) )

         {

             assertTrue( set.contains( "resources/inherit.gif" ) );

         }

-        else if ( javadocVersion.compareTo( JavadocVersion.parse( "1.8" ) ) < 0 )

+        else if ( javadocVersion.isBefore( "1.8" ) )

         {

             assertTrue( set.contains( "resources/background.gif" ) /* JDK7 */);

         }

@@ -114,7 +112,11 @@
         assertTrue( set.contains( "javadocjar/def/package-use.html" ) );

         assertTrue( set.contains( "javadocjar/def/package-tree.html" ) );

         assertTrue( set.contains( "javadocjar/def/package-summary.html" ) );

-        assertTrue( set.contains( "javadocjar/def/package-frame.html" ) );

+        // package frame not generated anymore since Java 11

+        if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore( "11" ) )

+        {

+            assertTrue( set.contains( "javadocjar/def/package-frame.html" ) );

+        }

         assertTrue( set.contains( "javadocjar/def/class-use/AppSample.html" ) );

         assertTrue( set.contains( "index.html" ) );

         assertTrue( set.contains( "javadocjar/def/App.html" ) );

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java b/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java
index a521839..0f2cec2 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/JavadocReportTest.java
@@ -22,18 +22,17 @@
 import static org.mockito.Mockito.spy;

 import static org.mockito.Mockito.when;

 

-import java.io.BufferedReader;

 import java.io.File;

-import java.io.FileReader;

 import java.io.IOException;

-import java.io.Reader;

 import java.net.HttpURLConnection;

 import java.net.URL;

+import java.nio.charset.Charset;

+import java.nio.charset.StandardCharsets;

+import java.nio.file.Files;

 import java.util.HashMap;

 import java.util.List;

 import java.util.Map;

 

-import org.apache.commons.lang3.SystemUtils;

 import org.apache.maven.execution.MavenSession;

 import org.apache.maven.model.Plugin;

 import org.apache.maven.plugin.LegacySupport;

@@ -47,9 +46,8 @@
 import org.apache.maven.repository.internal.MavenRepositorySystemSession;

 import org.apache.maven.settings.Proxy;

 import org.apache.maven.settings.Settings;

+import org.codehaus.plexus.languages.java.version.JavaVersion;

 import org.codehaus.plexus.util.FileUtils;

-import org.codehaus.plexus.util.IOUtil;

-import org.codehaus.plexus.util.ReaderFactory;

 import org.codehaus.plexus.util.StringUtils;

 import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;

 

@@ -193,21 +191,28 @@
     private static String readFile( File file )

         throws IOException

     {

-        String strTmp;

-        StringBuilder str = new StringBuilder( (int) file.length() );

-        BufferedReader in = new BufferedReader( new FileReader( file ) );

+        return readFile( file, StandardCharsets.UTF_8 );

+    }

 

-        try

+    /**

+     * Convenience method that reads the contents of the specified file object into a string with a

+     * <code>space</code> as line separator.

+     *

+     * @see #LINE_SEPARATOR

+     * @param file the file to be read

+     * @param cs charset to use

+     * @return a String object that contains the contents of the file

+     * @throws IOException if any

+     */

+    private static String readFile( File file, Charset cs )

+            throws IOException

+    {

+        StringBuilder str = new StringBuilder( (int) file.length() );

+

+        for ( String strTmp : Files.readAllLines( file.toPath(), cs ) )

         {

-            while ( ( strTmp = in.readLine() ) != null )

-            {

-                str.append( LINE_SEPARATOR );

-                str.append( strTmp );

-            }

-        }

-        finally

-        {

-            in.close();

+            str.append( LINE_SEPARATOR);

+            str.append( strTmp );

         }

 

         return str.toString();

@@ -232,7 +237,8 @@
         assertTrue( generatedFile.exists() );

 

         // only test when URL can be reached

-        String url = JavadocReport.DEFAULT_JAVA_API_LINKS.getProperty( "api_9" );

+        

+        String url = mojo.getDefaultJavadocApiLink().getUrl();

         HttpURLConnection connection = (HttpURLConnection) new URL( url ).openConnection();

         connection.setRequestMethod( "HEAD" );

         if ( connection.getResponseCode() == 200 )

@@ -241,26 +247,39 @@
         }

 

         assertTrue( new File( apidocs, "def/configuration/AppSample.html" ).exists() );

-        assertTrue( new File( apidocs, "def/configuration/package-frame.html" ).exists() );

         assertTrue( new File( apidocs, "def/configuration/package-summary.html" ).exists() );

         assertTrue( new File( apidocs, "def/configuration/package-tree.html" ).exists() );

         assertTrue( new File( apidocs, "def/configuration/package-use.html" ).exists() );

 

+        // package-frame and allclasses-(no)frame not generated anymore since Java 11

+        if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore( "11" ) )

+        {

+            assertTrue( new File( apidocs, "def/configuration/package-frame.html" ).exists() );

+            assertTrue( new File( apidocs, "allclasses-frame.html" ).exists() );

+            assertTrue( new File( apidocs, "allclasses-noframe.html" ).exists() );

+        }

+        

         // class level generated javadoc files

         assertTrue( new File( apidocs, "def/configuration/class-use/App.html" ).exists() );

         assertTrue( new File( apidocs, "def/configuration/class-use/AppSample.html" ).exists() );

 

         // project level generated javadoc files

-        assertTrue( new File( apidocs, "allclasses-frame.html" ).exists() );

-        assertTrue( new File( apidocs, "allclasses-noframe.html" ).exists() );

         assertTrue( new File( apidocs, "constant-values.html" ).exists() );

         assertTrue( new File( apidocs, "deprecated-list.html" ).exists() );

         assertTrue( new File( apidocs, "help-doc.html" ).exists() );

         assertTrue( new File( apidocs, "index-all.html" ).exists() );

         assertTrue( new File( apidocs, "index.html" ).exists() );

         assertTrue( new File( apidocs, "overview-tree.html" ).exists() );

-        assertTrue( new File( apidocs, "package-list" ).exists() );

         assertTrue( new File( apidocs, "stylesheet.css" ).exists() );

+

+        if ( JavaVersion.JAVA_VERSION.isAtLeast( "10" ) )

+        {

+            assertTrue( new File( apidocs, "element-list" ).exists() );

+        }

+        else 

+        {

+            assertTrue( new File( apidocs, "package-list" ).exists() );

+        }

     }

 

     /**

@@ -314,8 +333,8 @@
         throws Exception

     {

         // Should be an assumption, but not supported by TestCase

-        // Seems like a bug in Javadoc 9

-        if ( JavadocVersion.parse( SystemUtils.JAVA_SPECIFICATION_VERSION ).compareTo( JavadocVersion.parse( "9" ) ) == 0 )

+        // Seems like a bug in Javadoc 9 and above

+        if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast( "9" ) )

         {

             return;

         }

@@ -327,11 +346,11 @@
         File apidocs = new File( getBasedir(), "target/test/unit/docfiles-test/target/site/apidocs/" );

 

         // check if the doc-files subdirectories were copied

-        assertTrue( new File( apidocs, "doc-files" ).exists() );

-        assertTrue( new File( apidocs, "doc-files/included-dir1/sample-included1.gif" ).exists() );

-        assertTrue( new File( apidocs, "doc-files/included-dir2/sample-included2.gif" ).exists() );

-        assertFalse( new File( apidocs, "doc-files/excluded-dir1" ).exists() );

-        assertFalse( new File( apidocs, "doc-files/excluded-dir2" ).exists() );

+        assertTrue( new File( apidocs, "docfiles/test/doc-files" ).exists() );

+        assertTrue( new File( apidocs, "docfiles/test/doc-files/included-dir1/sample-included1.gif" ).exists() );

+        assertTrue( new File( apidocs, "docfiles/test/doc-files/included-dir2/sample-included2.gif" ).exists() );

+        assertFalse( new File( apidocs, "docfiles/test/doc-files/excluded-dir1" ).exists() );

+        assertFalse( new File( apidocs, "docfiles/test/doc-files/excluded-dir2" ).exists() );

 

         testPom = new File( unit, "docfiles-with-java-test/docfiles-with-java-test-plugin-config.xml" );

         mojo = lookupMojo( testPom );

@@ -393,21 +412,10 @@
 

         File options = new File( apidocs, "options" );

         assertTrue( options.isFile() );

-        String contentOptions = null;

-        Reader reader = null;

-        try

-        {

-            reader = ReaderFactory.newPlatformReader( options );

-            contentOptions = IOUtil.toString( reader );

-            reader.close();

-            reader = null;

-        }

-        finally

-        {

-            IOUtil.close( reader );

-        }

 

-        assertTrue( contentOptions != null );

+        String contentOptions = FileUtils.fileRead( options );

+

+        assertNotNull( contentOptions );

         assertTrue( contentOptions.contains( "-link" ) );

         assertTrue( contentOptions.contains( "http://java.sun.com/j2se/" ) );

     }

@@ -495,8 +503,65 @@
         assertTrue( new File( apidocs, "index-all.html" ).exists() );

         assertTrue( new File( apidocs, "index.html" ).exists() );

         assertTrue( new File( apidocs, "overview-tree.html" ).exists() );

-        assertTrue( new File( apidocs, "package-list" ).exists() );

         assertTrue( new File( apidocs, "stylesheet.css" ).exists() );

+

+        if ( JavaVersion.JAVA_VERSION.isBefore( "10" ) )

+        {

+            assertTrue( new File( apidocs, "package-list" ).exists() );

+        }

+        else

+        {

+            assertTrue( new File( apidocs, "element-list" ).exists() );

+        }

+    }

+

+    /**

+     * Method to test when the options file has umlauts.

+     *

+     * @throws Exception if any

+     */

+    public void testOptionsUmlautEncoding()

+            throws Exception

+    {

+        File testPom = new File(unit, "optionsumlautencoding-test/optionsumlautencoding-test-plugin-config.xml" );

+        JavadocReport mojo = lookupMojo( testPom );

+        mojo.execute();

+

+        File optionsFile = new File( mojo.getOutputDirectory(), "options" );

+        assertTrue( optionsFile.exists() );

+

+        // check for a part of the window title

+        String content;

+        if ( JavaVersion.JAVA_VERSION.isAtLeast( "9" ) )

+        {

+            content = readFile( optionsFile, StandardCharsets.UTF_8 );

+        }

+        else

+        {

+            content = readFile( optionsFile, Charset.defaultCharset() );

+        }

+        assertTrue( content.contains( "Options Umlaut Encoding ö ä ü ß" ) );

+

+        File apidocs = new File( getBasedir(), "target/test/unit/optionsumlautencoding-test/target/site/apidocs" );

+

+        // package level generated javadoc files

+        assertTrue( new File( apidocs, "optionsumlautencoding/test/App.html" ).exists() );

+        assertTrue( new File( apidocs, "optionsumlautencoding/test/AppSample.html" ).exists() );

+

+        // project level generated javadoc files

+        assertTrue( new File( apidocs, "index-all.html" ).exists() );

+        assertTrue( new File( apidocs, "index.html" ).exists() );

+        assertTrue( new File( apidocs, "overview-tree.html" ).exists() );

+        assertTrue( new File( apidocs, "stylesheet.css" ).exists() );

+

+        if ( JavaVersion.JAVA_VERSION.isBefore( "10" ) )

+        {

+            assertTrue( new File( apidocs, "package-list" ).exists() );

+        }

+        else

+        {

+            assertTrue( new File( apidocs, "element-list" ).exists() );

+        }

     }

 

     /**

@@ -539,7 +604,15 @@
         // ----------------------------------------------------------------------

         // taglet-test: check if a taglet is used

         // ----------------------------------------------------------------------

-

+        

+        // Should be an assumption, but not supported by TestCase

+        // com.sun.tools.doclets.Taglet not supported by Java9 anymore

+        // Should be refactored with jdk.javadoc.doclet.Taglet

+        if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast( "10" ) )

+        {

+            return;

+        }

+        

         File testPom = new File( unit, "taglet-test/taglet-test-plugin-config.xml" );

         JavadocReport mojo = lookupMojo( testPom );

         

@@ -578,7 +651,7 @@
     {

         // Should be an assumption, but not supported by TestCase

         // Java 5 not supported by Java9 anymore

-        if ( JavadocVersion.parse( SystemUtils.JAVA_SPECIFICATION_VERSION ).compareTo( JavadocVersion.parse( "9" ) ) >= 0 )

+        if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast( "9" ) )

         {

             return;

         }

@@ -660,8 +733,8 @@
         content = readFile( app );

         assertTrue( content.contains( "<img src=\"doc-files/maven-feather.png\" alt=\"Maven\">" ) );

 

-        JavadocVersion javadocVersion = (JavadocVersion) getVariableValueFromObject( mojo, "javadocRuntimeVersion" );

-        if( javadocVersion.compareTo( JavadocVersion.parse( "1.8" ) ) >= 0  && javadocVersion.compareTo( JavadocVersion.parse( "10" ) ) < 0)

+        JavaVersion javadocVersion = (JavaVersion) getVariableValueFromObject( mojo, "javadocRuntimeVersion" );

+        if( javadocVersion.isAtLeast( "1.8" ) && javadocVersion.isBefore( "12" ) )

         {

             // https://bugs.openjdk.java.net/browse/JDK-8032205

             assertTrue( "Javadoc runtime version: " + javadocVersion

@@ -713,9 +786,15 @@
         String readed = readFile( app );

         assertTrue( readed.contains( ">To do something:</" ) );

         assertTrue( readed.contains( ">Generator Class:</" ) );

-        assertTrue( readed.contains( ">Version:</" ) );

-        assertTrue( readed.toLowerCase().contains( "</dt>" + LINE_SEPARATOR + "  <dd>1.0</dd>" )

-            || readed.toLowerCase().contains( "</dt>" + LINE_SEPARATOR + "<dd>1.0</dd>" /* JDK 8 */) );

+        

+        // In javadoc-options-javadoc-resources.xml tag 'version' has only a name, 

+        // which is not enough for Java 11 anymore

+        if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore( "11" ) )

+        {

+            assertTrue( readed.contains( ">Version:</" ) );

+            assertTrue( readed.toLowerCase().contains( "</dt>" + LINE_SEPARATOR + "  <dd>1.0</dd>" )

+                || readed.toLowerCase().contains( "</dt>" + LINE_SEPARATOR + "<dd>1.0</dd>" /* JDK 8 */) );

+        }

     }

 

     /**

@@ -734,7 +813,7 @@
         }

         catch ( MojoExecutionException e )

         {

-            assertTrue( "Doesnt handle correctly newline for header or footer parameter", false );

+            fail( "Doesnt handle correctly newline for header or footer parameter" );

         }

 

         assertTrue( true );

@@ -775,12 +854,20 @@
         mojo.execute();

 

         File apidocs = new File( getBasedir(), "target/test/unit/jdk6-test/target/site/apidocs" );

-

         assertTrue( new File( apidocs, "index.html" ).exists() );

 

-        File overviewSummary = new File( apidocs, "overview-summary.html" );

-        assertTrue( overviewSummary.exists() );

-        String content = readFile( overviewSummary );

+        File overview;

+        if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore( "11" ) )

+        {

+            overview = new File( apidocs, "overview-summary.html" );    

+        }

+        else

+        {

+            overview = new File( apidocs, "index.html" );

+        }

+        

+        assertTrue( overview.exists() );

+        String content = readFile( overview );

         assertTrue( content.contains( "Top - Copyright &#169; All rights reserved." ) );

         assertTrue( content.contains( "Header - Copyright &#169; All rights reserved." ) );

         assertTrue( content.contains( "Footer - Copyright &#169; All rights reserved." ) );

@@ -952,7 +1039,7 @@
         try

         {

             mojo.execute();

-            assertTrue( "No wrong encoding catch", false );

+            fail( "No wrong encoding catch" );

         }

         catch ( MojoExecutionException e )

         {

@@ -963,7 +1050,7 @@
         try

         {

             mojo.execute();

-            assertTrue( "No wrong docencoding catch", false );

+            fail( "No wrong docencoding catch" );

         }

         catch ( MojoExecutionException e )

         {

@@ -974,7 +1061,7 @@
         try

         {

             mojo.execute();

-            assertTrue( "No wrong charset catch", false );

+            fail( "No wrong charset catch" );

         }

         catch ( MojoExecutionException e )

         {

@@ -987,7 +1074,7 @@
         try

         {

             mojo.execute();

-            assertTrue( "No wrong locale catch", false );

+            fail( "No wrong locale catch" );

         }

         catch ( MojoExecutionException e )

         {

@@ -1004,7 +1091,7 @@
         try

         {

             mojo.execute();

-            assertTrue( "No conflict catch", false );

+            fail( "No conflict catch" );

         }

         catch ( MojoExecutionException e )

         {

@@ -1020,6 +1107,13 @@
     public void testTagletArtifacts()

         throws Exception

     {

+        // Should be an assumption, but not supported by TestCase

+        // com.sun.tools.doclets.Taglet not supported by Java 10 anymore

+        if ( JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast( "10" ) )

+        {

+            return;

+        }

+        

         File testPom = new File( unit, "tagletArtifacts-test/tagletArtifacts-test-plugin-config.xml" );

         JavadocReport mojo = lookupMojo( testPom );

 

@@ -1100,7 +1194,7 @@
         try

         {

             mojo.execute();

-            assertTrue( false );

+            fail();

         }

         catch ( Exception e )

         {

@@ -1112,7 +1206,16 @@
         mojo.execute();

 

         String content = readFile( stylesheetfile );

-        assertTrue( content.contains( "/* Javadoc style sheet */" ) );

+        if ( JavaVersion.JAVA_VERSION.isAtLeast( "10" ) )

+        {

+            assertTrue( content.contains( "/* " + LINE_SEPARATOR

+                                        + " * Javadoc style sheet" + LINE_SEPARATOR

+                                        + " */" ) );

+        }

+        else

+        {

+            assertTrue( content.contains( "/* Javadoc style sheet */" ) );

+        }

 

         String optionsContent = readFile( options );

         assertFalse( optionsContent.contains( "-stylesheetfile" ) );

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/JavadocUtilTest.java b/src/test/java/org/apache/maven/plugins/javadoc/JavadocUtilTest.java
index e13f176..75f4454 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/JavadocUtilTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/JavadocUtilTest.java
@@ -1,5 +1,7 @@
 package org.apache.maven.plugins.javadoc;

 

+import static org.junit.Assert.assertArrayEquals;

+

 /*

  * Licensed to the Apache Software Foundation (ASF) under one

  * or more contributor license agreements.  See the NOTICE file

@@ -22,9 +24,14 @@
 import java.io.File;

 import java.io.FileNotFoundException;

 import java.io.IOException;

+import java.io.OutputStream;

 import java.net.SocketTimeoutException;

+import java.net.URI;

 import java.net.URL;

+import java.nio.file.Path;

+import java.nio.file.Paths;

 import java.util.ArrayList;

+import java.util.Collection;

 import java.util.Collections;

 import java.util.HashMap;

 import java.util.List;

@@ -32,17 +39,24 @@
 import java.util.Set;

 import java.util.regex.PatternSyntaxException;

 

+import javax.servlet.ServletException;

+import javax.servlet.http.HttpServletRequest;

+import javax.servlet.http.HttpServletResponse;

+

 import org.apache.commons.lang3.builder.EqualsBuilder;

-import org.apache.maven.plugins.javadoc.JavadocUtil;

+import org.apache.maven.plugin.testing.stubs.MavenProjectStub;

 import org.apache.maven.plugins.javadoc.ProxyServer.AuthAsyncProxyServlet;

 import org.apache.maven.settings.Proxy;

 import org.apache.maven.settings.Settings;

 import org.codehaus.plexus.PlexusTestCase;

 import org.codehaus.plexus.util.FileUtils;

+import org.mortbay.jetty.Server;

+import org.mortbay.jetty.handler.AbstractHandler;

+import org.mortbay.jetty.handler.MovedContextHandler;

+import org.mortbay.util.ByteArrayISO8859Writer;

 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: JavadocUtilTest.java 1801354 2017-07-09 08:49:46Z rfscholte $

  */

 public class JavadocUtilTest

     extends PlexusTestCase

@@ -59,7 +73,7 @@
         try

         {

             JavadocUtil.extractJavadocVersion( version );

-            assertTrue( "Not catch null", false );

+            fail( "Not catch null" );

         }

         catch ( IllegalArgumentException e )

         {

@@ -169,7 +183,7 @@
         try

         {

             JavadocUtil.parseJavadocMemory( memory );

-            assertTrue( "Not catch null", false );

+            fail( "Not catch null" );

         }

         catch ( IllegalArgumentException e )

         {

@@ -213,7 +227,7 @@
         try

         {

             JavadocUtil.parseJavadocMemory( memory );

-            assertTrue( "Not catch wrong pattern", false );

+            fail( "Not catch wrong pattern" );

         }

         catch ( IllegalArgumentException e )

         {

@@ -223,7 +237,7 @@
         try

         {

             JavadocUtil.parseJavadocMemory( memory );

-            assertTrue( "Not catch wrong pattern", false );

+            fail( "Not catch wrong pattern" );

         }

         catch ( IllegalArgumentException e )

         {

@@ -507,6 +521,146 @@
         }

     }

 

+    public void testGetRedirectUrlNotHttp()

+        throws Exception

+    {

+        URL url = new URI( "ftp://some.where" ).toURL();

+        assertEquals( url.toString(), JavadocUtil.getRedirectUrl( url, new Settings() ).toString() );

+

+        url = new URI( "file://some/where" ).toURL();

+        assertEquals( url.toString(), JavadocUtil.getRedirectUrl( url, new Settings() ).toString() );

+    }

+

+    /**

+     * Tests a redirect from localhost:port1 to localhost:port2

+     */

+    public void testGetRedirectUrl()

+        throws Exception

+    {

+        Server server = null, redirectServer = null;

+        try

+        {

+            redirectServer = new Server( 0 );

+            redirectServer.addHandler( new AbstractHandler()

+            {

+                @Override

+                public void handle( String target, HttpServletRequest request, HttpServletResponse response,

+                                    int dispatch )

+                    throws IOException, ServletException

+                {

+                    response.setStatus( HttpServletResponse.SC_OK );

+                    ByteArrayISO8859Writer writer = new ByteArrayISO8859Writer( 100 );

+                    writer.write( "<html>Hello world</html>" );

+                    writer.flush();

+                    response.setContentLength( writer.size() );

+                    OutputStream out = response.getOutputStream();

+                    writer.writeTo( out );

+                    out.close();

+                    writer.close();

+                }

+            } );

+            redirectServer.start();

+

+            server = new Server( 0 );

+            MovedContextHandler handler = new MovedContextHandler();

+            int redirectPort = redirectServer.getConnectors()[0].getLocalPort();

+            handler.setNewContextURL( "http://localhost:" + redirectPort );

+            server.addHandler( handler );

+            server.start();

+

+            URL url = new URI( "http://localhost:" + server.getConnectors()[0].getLocalPort() ).toURL();

+            URL redirectUrl = JavadocUtil.getRedirectUrl( url, new Settings() );

+

+            assertTrue( redirectUrl.toString().startsWith( "http://localhost:" + redirectPort ) );

+        }

+        finally

+        {

+            stopSilently( server );

+            stopSilently( redirectServer );

+        }

+    }

+

+    /**

+     * Tests that getRedirectUrl returns the same URL when there are no redirects.

+     */

+    public void testGetRedirectUrlWithNoRedirects()

+        throws Exception

+    {

+        Server server = null;

+        try

+        {

+            server = new Server( 0 );

+            server.addHandler( new AbstractHandler()

+            {

+                @Override

+                public void handle( String target, HttpServletRequest request, HttpServletResponse response,

+                                    int dispatch )

+                    throws IOException, ServletException

+                {

+                    response.setStatus( HttpServletResponse.SC_OK );

+                    ByteArrayISO8859Writer writer = new ByteArrayISO8859Writer( 100 );

+                    writer.write( "<html>Hello world</html>" );

+                    writer.flush();

+                    response.setContentLength( writer.size() );

+                    OutputStream out = response.getOutputStream();

+                    writer.writeTo( out );

+                    out.close();

+                    writer.close();

+                }

+            } );

+            server.start();

+

+            URL url = new URI( "http://localhost:" + server.getConnectors()[0].getLocalPort() ).toURL();

+            URL redirectUrl = JavadocUtil.getRedirectUrl( url, new Settings() );

+

+            assertEquals( url.toURI(), redirectUrl.toURI() );

+        }

+        finally

+        {

+            stopSilently( server );

+        }

+    }

+

+    /**

+     * Tests that getRedirectUrl adds an Accept header in HTTP requests. Necessary because some sites like Cloudflare

+     * reject requests without an Accept header.

+     */

+    public void testGetRedirectUrlVerifyHeaders()

+        throws Exception

+    {

+        Server server = null;

+        try

+        {

+            server = new Server( 0 );

+            server.addHandler( new AbstractHandler()

+            {

+                @Override

+                public void handle( String target, HttpServletRequest request, HttpServletResponse response,

+                                    int dispatch )

+                    throws IOException, ServletException

+                {

+                    if ( request.getHeader( "Accept" ) == null )

+                    {

+                        response.setStatus( HttpServletResponse.SC_FORBIDDEN );

+                    }

+                    else

+                    {

+                        response.setStatus( HttpServletResponse.SC_OK );

+                    }

+                    response.getOutputStream().close();

+                }

+            } );

+            server.start();

+

+            URL url = new URI( "http://localhost:" + server.getConnectors()[0].getLocalPort() ).toURL();

+            JavadocUtil.getRedirectUrl( url, new Settings() );

+        }

+        finally

+        {

+            stopSilently( server );

+        }

+    }

+

     /**

      * Method to test copyJavadocResources()

      *

@@ -587,10 +741,12 @@
         list.add( getBasedir() + "/target/classes" );

         list.add( getBasedir() + "/target/classes" );

 

-        String FS = System.getProperty( "file.separator" );

-        Set<String> expected = Collections.singleton( getBasedir() + FS +"target" + FS + "classes" );

+        Set<Path> expected = Collections.singleton( Paths.get( getBasedir(), "target/classes" ) );

+        

+        MavenProjectStub project = new MavenProjectStub();

+        project.setFile( new File( getBasedir(), "pom.xml" ) );

 

-        assertEquals( expected, JavadocUtil.pruneDirs( null, list ) );

+        assertEquals( expected, JavadocUtil.pruneDirs( project, list ) );

     }

 

     /**

@@ -601,7 +757,7 @@
     public void testUnifyPathSeparator()

         throws Exception

     {

-        assertEquals( null, JavadocUtil.unifyPathSeparator( null ) );

+        assertNull( JavadocUtil.unifyPathSeparator( null ) );

 

         final String ps = File.pathSeparator;

 

@@ -626,4 +782,31 @@
         assertEquals( path1 + ps + path2 + ps + path1 + ps + path2, JavadocUtil.unifyPathSeparator( path1 + ";"

             + path2 + ":" + path1 + ":" + path2 ) );

     }

+    

+    

+    public void testGetIncludedFiles() throws Exception

+    {

+        File sourceDirectory = new File("target/it").getAbsoluteFile();

+        String[] fileList = new String[] { "Main.java" };

+        Collection<String> excludePackages = Collections.singleton( "*.it" );

+        

+        List<String> includedFiles = JavadocUtil.getIncludedFiles( sourceDirectory, fileList, excludePackages );

+        

+        assertArrayEquals( fileList, includedFiles.toArray( new String[0] ) );

+    }

+

+    private void stopSilently( Server server )

+    {

+        try

+        {

+            if ( server != null )

+            {

+                server.stop();

+            }

+        }

+        catch ( Exception e )

+        {

+            // ignored

+        }

+    }

 }

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/JavadocVersionTest.java b/src/test/java/org/apache/maven/plugins/javadoc/JavadocVersionTest.java
index 0a4f1eb..0f0bc23 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/JavadocVersionTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/JavadocVersionTest.java
@@ -19,13 +19,12 @@
  * under the License.

  */

 

-import static org.junit.Assert.assertTrue;

 import static org.junit.Assert.assertEquals;

+import static org.junit.Assert.assertTrue;

 

 import java.util.regex.Matcher;

 import java.util.regex.Pattern;

 

-import org.apache.maven.plugins.javadoc.JavadocVersion;

 import org.junit.Test;

 

 public class JavadocVersionTest

@@ -42,9 +41,9 @@
         assertTrue( JavadocVersion.parse( "1.4" ).compareTo( JavadocVersion.parse( "1.5" ) ) < 0 );

         assertTrue( JavadocVersion.parse( "1.8" ).compareTo( JavadocVersion.parse( "9" ) ) < 0 );

 

-        assertTrue( JavadocVersion.parse( "1.4" ).compareTo( JavadocVersion.parse( "1.4" ) ) == 0 );

-        assertTrue( JavadocVersion.parse( "1.4.2" ).compareTo( JavadocVersion.parse( "1.4.2" ) ) == 0 );

-        assertTrue( JavadocVersion.parse( "9" ).compareTo( JavadocVersion.parse( "9" ) ) == 0 );

+        assertEquals( 0, JavadocVersion.parse( "1.4" ).compareTo( JavadocVersion.parse( "1.4" ) ) );

+        assertEquals( 0, JavadocVersion.parse( "1.4.2" ).compareTo( JavadocVersion.parse( "1.4.2" ) ) );

+        assertEquals( 0, JavadocVersion.parse( "9" ).compareTo( JavadocVersion.parse( "9" ) ) );

 

         assertTrue( JavadocVersion.parse( "1.4.2" ).compareTo( JavadocVersion.parse( "1.4" ) ) > 0 );

         assertTrue( JavadocVersion.parse( "1.5" ).compareTo( JavadocVersion.parse( "1.4" ) ) > 0 );

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/ProxyServer.java b/src/test/java/org/apache/maven/plugins/javadoc/ProxyServer.java
index 8c1e3b8..e97356e 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/ProxyServer.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/ProxyServer.java
@@ -42,7 +42,6 @@
  * A Proxy server.

  *

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: ProxyServer.java 1517906 2013-08-27 18:25:03Z krosenvold $

  * @since 2.6

  */

 class ProxyServer

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/options/io/xpp3/JavadocOptionsXpp3ReaderTest.java b/src/test/java/org/apache/maven/plugins/javadoc/options/io/xpp3/JavadocOptionsXpp3ReaderTest.java
new file mode 100644
index 0000000..1966492
--- /dev/null
+++ b/src/test/java/org/apache/maven/plugins/javadoc/options/io/xpp3/JavadocOptionsXpp3ReaderTest.java
@@ -0,0 +1,59 @@
+package org.apache.maven.plugins.javadoc.options.io.xpp3;
+
+/*
+ * 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 static org.junit.Assert.assertEquals;
+
+import java.io.StringReader;
+
+import org.apache.maven.plugins.javadoc.options.JavadocOptions;
+import org.apache.maven.plugins.javadoc.options.Tag;
+import org.junit.Test;
+
+public class JavadocOptionsXpp3ReaderTest
+{
+
+    @Test
+    public void testNameAndHead() throws Exception {
+        JavadocOptionsXpp3Reader parser = new JavadocOptionsXpp3Reader();
+        String testString = "<javadocOptions><tags><tag><name>foo</name><head>bar</head></tag></tags></javadocOptions>";
+        StringReader reader = new StringReader(testString);
+
+        JavadocOptions options = parser.read(reader);
+        assertEquals(1, options.getTags().size());
+        Tag tag = options.getTags().get(0);
+        assertEquals("foo", tag.getName());
+        assertEquals("bar", tag.getHead());
+    }
+    
+    @Test
+    public void testPlacement() throws Exception {
+        JavadocOptionsXpp3Reader parser = new JavadocOptionsXpp3Reader();
+        String testString = "<javadocOptions><tags><tag><name>foo</name><placement>Xaoptcmf</placement><head>bar</head></tag></tags></javadocOptions>";
+        StringReader reader = new StringReader(testString);
+
+        JavadocOptions options = parser.read(reader);
+        assertEquals(1, options.getTags().size());
+        Tag tag = options.getTags().get(0);
+        assertEquals("foo", tag.getName());
+        assertEquals("Xaoptcmf", tag.getPlacement());
+    }
+
+}
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateProject1TestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateProject1TestMavenProjectStub.java
index 9ac1241..f2c11ca 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateProject1TestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateProject1TestMavenProjectStub.java
@@ -30,7 +30,6 @@
 

 /**

  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>

- * @version $Id: AggregateProject1TestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class AggregateProject1TestMavenProjectStub

     extends MavenProjectStub

@@ -54,7 +53,7 @@
 

         String basedir = getBasedir().getAbsolutePath();

         List<String> compileSourceRoots = new ArrayList<>();

-        compileSourceRoots.add( basedir + "/aggregate/test/project1" );

+        compileSourceRoots.add( basedir );

         setCompileSourceRoots( compileSourceRoots );

     }

 

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateProject2TestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateProject2TestMavenProjectStub.java
index 045bf3d..8b0e04e 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateProject2TestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateProject2TestMavenProjectStub.java
@@ -30,7 +30,6 @@
 

 /**

  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>

- * @version $Id: AggregateProject2TestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class AggregateProject2TestMavenProjectStub

     extends MavenProjectStub

@@ -54,7 +53,7 @@
 

         String basedir = getBasedir().getAbsolutePath();

         List<String> compileSourceRoots = new ArrayList<>();

-        compileSourceRoots.add( basedir + "/aggregate/test/project2" );

+        compileSourceRoots.add( basedir );

         setCompileSourceRoots( compileSourceRoots );

     }

 

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesProject1TestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesProject1TestMavenProjectStub.java
index 68667ef..71657c1 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesProject1TestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesProject1TestMavenProjectStub.java
@@ -31,7 +31,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: AggregateResourcesProject1TestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class AggregateResourcesProject1TestMavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesProject2TestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesProject2TestMavenProjectStub.java
index bbc5647..58a164c 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesProject2TestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesProject2TestMavenProjectStub.java
@@ -31,7 +31,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: AggregateResourcesProject2TestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class AggregateResourcesProject2TestMavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesTestMavenProjectStub.java
index e418a20..39ffa57 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateResourcesTestMavenProjectStub.java
@@ -21,6 +21,7 @@
 

 import java.io.File;

 import java.util.ArrayList;

+import java.util.Arrays;

 import java.util.List;

 

 import org.apache.maven.model.Build;

@@ -29,7 +30,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: AggregateResourcesTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class AggregateResourcesTestMavenProjectStub

     extends MavenProjectStub

@@ -57,17 +57,22 @@
         setCompileSourceRoots( compileSourceRoots );

     }

 

-    /** {@inheritDoc} */

     @Override

     public File getBasedir()

     {

         return new File( super.getBasedir() + "/src/test/resources/unit/aggregate-resources-test" );

     }

 

-    /** {@inheritDoc} */

     @Override

     public MavenProject getExecutionProject()

     {

         return this;

     }

+    

+    @Override

+    public List<String> getModules()

+    {

+        return Arrays.asList( "project1", "project2" );

+    }

+

 }

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateTestMavenProjectStub.java
index 9737634..5d0e1eb 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/AggregateTestMavenProjectStub.java
@@ -21,6 +21,7 @@
 

 import java.io.File;

 import java.util.ArrayList;

+import java.util.Arrays;

 import java.util.List;

 

 import org.apache.maven.model.Build;

@@ -29,7 +30,6 @@
 

 /**

  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>

- * @version $Id: AggregateTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class AggregateTestMavenProjectStub

     extends MavenProjectStub

@@ -57,31 +57,33 @@
         setCompileSourceRoots( compileSourceRoots );

     }

 

-    /** {@inheritDoc} */

     @Override

     public Build getBuild()

     {

         return build;

     }

 

-    /** {@inheritDoc} */

     @Override

     public void setBuild( Build build )

     {

         this.build = build;

     }

 

-    /** {@inheritDoc} */

     @Override

     public File getBasedir()

     {

         return new File( super.getBasedir() + "/src/test/resources/unit/aggregate-test" );

     }

 

-    /** {@inheritDoc} */

     @Override

     public MavenProject getExecutionProject()

     {

         return this;

     }

+    

+    @Override

+    public List<String> getModules()

+    {

+        return Arrays.asList( "project1", "project2" );

+    }

 }

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/CustomConfigurationMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/CustomConfigurationMavenProjectStub.java
index 6e9334c..c8d5ffe 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/CustomConfigurationMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/CustomConfigurationMavenProjectStub.java
@@ -29,7 +29,6 @@
 

 /**

  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>

- * @version $Id: CustomConfigurationMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class CustomConfigurationMavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/DefaultArtifactHandlerStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/DefaultArtifactHandlerStub.java
index 7014ce9..62a62a8 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/DefaultArtifactHandlerStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/DefaultArtifactHandlerStub.java
@@ -23,7 +23,6 @@
 

 /**

  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>

- * @version $Id: DefaultArtifactHandlerStub.java 791101 2009-07-04 10:58:24Z vsiveton $

  */

 public class DefaultArtifactHandlerStub

     extends DefaultArtifactHandler

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/DefaultConfigurationMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/DefaultConfigurationMavenProjectStub.java
index bbe7ad0..4560611 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/DefaultConfigurationMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/DefaultConfigurationMavenProjectStub.java
@@ -29,7 +29,6 @@
 

 /**

  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>

- * @version $Id: DefaultConfigurationMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class DefaultConfigurationMavenProjectStub

     extends MavenProjectStub

@@ -57,7 +56,7 @@
         setBuild( build );

 

         List<String> compileSourceRoots = new ArrayList<>();

-        compileSourceRoots.add( getBasedir() + "/def/configuration" );

+        compileSourceRoots.add( getBasedir().getAbsolutePath() );

         setCompileSourceRoots( compileSourceRoots );

     }

 

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocfilesTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocfilesTestMavenProjectStub.java
index 86c15ac..56fff0c 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocfilesTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocfilesTestMavenProjectStub.java
@@ -29,7 +29,6 @@
 

 /**

  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>

- * @version $Id: DocfilesTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class DocfilesTestMavenProjectStub

     extends MavenProjectStub

@@ -58,7 +57,7 @@
         setBuild( build );

 

         List<String> compileSourceRoots = new ArrayList<>();

-        compileSourceRoots.add( getBasedir() + "/docfiles/test" );

+        compileSourceRoots.add( getBasedir().getAbsolutePath() );

         setCompileSourceRoots( compileSourceRoots );

     }

 

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocfilesWithJavaTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocfilesWithJavaTestMavenProjectStub.java
index 2f1502d..866758f 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocfilesWithJavaTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocfilesWithJavaTestMavenProjectStub.java
@@ -28,7 +28,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: DocfilesWithJavaTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class DocfilesWithJavaTestMavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocletPathTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocletPathTestMavenProjectStub.java
index 066d966..39cbcab 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocletPathTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocletPathTestMavenProjectStub.java
@@ -29,7 +29,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: DocletPathTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class DocletPathTestMavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocletTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocletTestMavenProjectStub.java
index de5b491..1a4ef31 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocletTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/DocletTestMavenProjectStub.java
@@ -29,7 +29,6 @@
 

 /**

  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>

- * @version $Id: DocletTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class DocletTestMavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/FixJdk5MavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/FixJdk5MavenProjectStub.java
index 0627b45..04d6a4b 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/FixJdk5MavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/FixJdk5MavenProjectStub.java
@@ -26,7 +26,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: FixJdk5MavenProjectStub.java 797039 2009-07-23 12:30:42Z vsiveton $

  */

 public class FixJdk5MavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/FixJdk6MavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/FixJdk6MavenProjectStub.java
index 597fb74..79c11c3 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/FixJdk6MavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/FixJdk6MavenProjectStub.java
@@ -26,7 +26,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: FixJdk6MavenProjectStub.java 797039 2009-07-23 12:30:42Z vsiveton $

  */

 public class FixJdk6MavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/FixMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/FixMavenProjectStub.java
index 9dbff69..3d6abb7 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/FixMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/FixMavenProjectStub.java
@@ -26,7 +26,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: FixMavenProjectStub.java 797039 2009-07-23 12:30:42Z vsiveton $

  */

 public class FixMavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/HeaderFooterTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/HeaderFooterTestMavenProjectStub.java
index ae2d066..a9eedc1 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/HeaderFooterTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/HeaderFooterTestMavenProjectStub.java
@@ -28,7 +28,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: HeaderFooterTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class HeaderFooterTestMavenProjectStub extends MavenProjectStub

 {

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/HelpFileMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/HelpFileMavenProjectStub.java
index dacc53e..5fcebd7 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/HelpFileMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/HelpFileMavenProjectStub.java
@@ -33,7 +33,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: HelpFileMavenProjectStub.java 1385163 2012-09-15 20:29:11Z hboutemy $

  */

 public class HelpFileMavenProjectStub extends MavenProjectStub

 {

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarArchiveConfigProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarArchiveConfigProjectStub.java
index 398c25a..95f1928 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarArchiveConfigProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarArchiveConfigProjectStub.java
@@ -66,7 +66,7 @@
         setBuild( build );
 
         List<String> compileSourceRoots = new ArrayList<>();
-        compileSourceRoots.add( getBasedir() + "/javadocjar/def" );
+        compileSourceRoots.add( getBasedir().getAbsolutePath() );
         setCompileSourceRoots( compileSourceRoots );
     }
 
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarDefaultMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarDefaultMavenProjectStub.java
index d60ba81..92ccc50 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarDefaultMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarDefaultMavenProjectStub.java
@@ -29,7 +29,6 @@
 

 /**

  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>

- * @version $Id: JavadocJarDefaultMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class JavadocJarDefaultMavenProjectStub

     extends MavenProjectStub

@@ -64,7 +63,7 @@
         setBuild( build );

 

         List<String> compileSourceRoots = new ArrayList<>();

-        compileSourceRoots.add( getBasedir() + "/javadocjar/def" );

+        compileSourceRoots.add( getBasedir().getAbsolutePath() );

         setCompileSourceRoots( compileSourceRoots );

     }

 

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarFailOnErrorMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarFailOnErrorMavenProjectStub.java
index ff0f6cd..1cd717c 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarFailOnErrorMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarFailOnErrorMavenProjectStub.java
@@ -29,7 +29,6 @@
 
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
- * @version $Id$
  */
 public class JavadocJarFailOnErrorMavenProjectStub
     extends MavenProjectStub
@@ -64,7 +63,7 @@
         setBuild( build );
 
         List<String> compileSourceRoots = new ArrayList<>();
-        compileSourceRoots.add( getBasedir() + "/javadocjar/def" );
+        compileSourceRoots.add( getBasedir().getAbsolutePath() );
         setCompileSourceRoots( compileSourceRoots );
     }
 
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarInvalidDestdirMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarInvalidDestdirMavenProjectStub.java
index 59e9bd9..71c0bc5 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarInvalidDestdirMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocJarInvalidDestdirMavenProjectStub.java
@@ -30,7 +30,6 @@
 

 /**

  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>

- * @version $Id: JavadocJarInvalidDestdirMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class JavadocJarInvalidDestdirMavenProjectStub

     extends MavenProjectStub

@@ -63,8 +62,7 @@
         setBuild( build );

 

         List<String> compileSourceRoots = new ArrayList<>();

-        compileSourceRoots.add(

-            getBasedir() + "/javadocjar/invalid/destdir" );

+        compileSourceRoots.add( getBasedir().getAbsolutePath() );

         setCompileSourceRoots( compileSourceRoots );

     }

 

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocPluginArtifactStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocPluginArtifactStub.java
index 6f86239..3402382 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocPluginArtifactStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/JavadocPluginArtifactStub.java
@@ -25,7 +25,6 @@
 

 /**

  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>

- * @version $Id: JavadocPluginArtifactStub.java 791101 2009-07-04 10:58:24Z vsiveton $

  */

 public class JavadocPluginArtifactStub

     extends ArtifactStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/Jdk5TestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/Jdk5TestMavenProjectStub.java
index 8cc22fc..e7198e9 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/Jdk5TestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/Jdk5TestMavenProjectStub.java
@@ -29,7 +29,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: Jdk5TestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class Jdk5TestMavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/Jdk6TestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/Jdk6TestMavenProjectStub.java
index 8ae8c1f..b6ec7f9 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/Jdk6TestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/Jdk6TestMavenProjectStub.java
@@ -29,7 +29,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: Jdk6TestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class Jdk6TestMavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/NewlineTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/NewlineTestMavenProjectStub.java
index cbafdd6..6104607 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/NewlineTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/NewlineTestMavenProjectStub.java
@@ -28,7 +28,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: NewlineTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class NewlineTestMavenProjectStub extends MavenProjectStub

 {

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/OptionsUmlautEncodingMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/OptionsUmlautEncodingMavenProjectStub.java
new file mode 100644
index 0000000..f1db35c
--- /dev/null
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/OptionsUmlautEncodingMavenProjectStub.java
@@ -0,0 +1,80 @@
+package org.apache.maven.plugins.javadoc.stubs;
+
+/*
+ * 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.plugin.testing.stubs.MavenProjectStub;
+import org.apache.maven.model.Scm;
+import org.apache.maven.model.Build;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.io.File;
+
+public class OptionsUmlautEncodingMavenProjectStub
+    extends MavenProjectStub
+{
+   private Scm scm;
+
+    public OptionsUmlautEncodingMavenProjectStub()
+    {
+        readModel( new File( getBasedir(), "optionsumlautencoding-test-plugin-config.xml" ) );
+
+        setGroupId( "org.apache.maven.plugins.maven-javadoc-plugin.unit" );
+        setArtifactId( "optionsumlautencoding-test" );
+        setVersion( "1.0-SNAPSHOT" );
+        setName( "Maven Javadoc Plugin Options Umlaut Encoding Test" );
+        setUrl( "http://maven.apache.org" );
+        setPackaging( "jar" );
+
+        Scm scm = new Scm();
+        scm.setConnection( "scm:svn:http://svn.apache.org/maven/sample/trunk" );
+        setScm( scm );
+
+        Build build = new Build();
+        build.setFinalName( "optionsumlautencoding-test" );
+        build.setDirectory( super.getBasedir() + "/target/test/unit/optionsumlautencoding-test/target" );
+        setBuild( build );
+
+        List<String> compileSourceRoots = new ArrayList<>();
+        compileSourceRoots.add( getBasedir().getAbsolutePath() );
+        setCompileSourceRoots( compileSourceRoots );
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public Scm getScm()
+    {
+        return scm;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void setScm( Scm scm )
+    {
+        this.scm = scm;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public File getBasedir()
+    {
+        return new File( super.getBasedir() + "/src/test/resources/unit/optionsumlautencoding-test" );
+    }
+}
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/PomMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/PomMavenProjectStub.java
index 279671e..c72cd7a 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/PomMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/PomMavenProjectStub.java
@@ -28,7 +28,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: PomMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class PomMavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/ProxyTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/ProxyTestMavenProjectStub.java
index 312cfb5..2f9a9c0 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/ProxyTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/ProxyTestMavenProjectStub.java
@@ -34,7 +34,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: ProxyTestMavenProjectStub.java 1747937 2016-06-11 21:26:59Z rfscholte $

  */

 public class ProxyTestMavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/QuotedPathMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/QuotedPathMavenProjectStub.java
index a3c0b6e..56e4603 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/QuotedPathMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/QuotedPathMavenProjectStub.java
@@ -29,7 +29,6 @@
 

 /**

  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>

- * @version $Id: QuotedPathMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class QuotedPathMavenProjectStub

     extends MavenProjectStub

@@ -57,7 +56,7 @@
         setBuild( build );

 

         List<String> compileSourceRoots = new ArrayList<>();

-        compileSourceRoots.add( getBasedir() + "/quotedpath/test" );

+        compileSourceRoots.add( getBasedir().getAbsolutePath() );

         setCompileSourceRoots( compileSourceRoots );

     }

 

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/ResourcesTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/ResourcesTestMavenProjectStub.java
index b82701c..e814125 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/ResourcesTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/ResourcesTestMavenProjectStub.java
@@ -28,7 +28,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: ResourcesTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class ResourcesTestMavenProjectStub extends MavenProjectStub

 {

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/ResourcesWithExcludesTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/ResourcesWithExcludesTestMavenProjectStub.java
index f019fff..b1f4dfb 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/ResourcesWithExcludesTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/ResourcesWithExcludesTestMavenProjectStub.java
@@ -28,7 +28,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: ResourcesWithExcludesTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class ResourcesWithExcludesTestMavenProjectStub extends MavenProjectStub

 {

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/SettingsStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/SettingsStub.java
index a69bcdc..be9f079 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/SettingsStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/SettingsStub.java
@@ -27,7 +27,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: SettingsStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class SettingsStub

     extends Settings

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/StandardDocletConflictOptionsTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/StandardDocletConflictOptionsTestMavenProjectStub.java
index 6e4644f..558e815 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/StandardDocletConflictOptionsTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/StandardDocletConflictOptionsTestMavenProjectStub.java
@@ -28,7 +28,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: StandardDocletConflictOptionsTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class StandardDocletConflictOptionsTestMavenProjectStub extends MavenProjectStub

 {

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/StylesheetFileMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/StylesheetFileMavenProjectStub.java
index 11970f0..227e65c 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/StylesheetFileMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/StylesheetFileMavenProjectStub.java
@@ -33,7 +33,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: StylesheetFileMavenProjectStub.java 1385163 2012-09-15 20:29:11Z hboutemy $

  */

 public class StylesheetFileMavenProjectStub extends MavenProjectStub

 {

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/SubpackagesTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/SubpackagesTestMavenProjectStub.java
index 5213f93..a6b645e 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/SubpackagesTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/SubpackagesTestMavenProjectStub.java
@@ -29,7 +29,6 @@
 

 /**

  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>

- * @version $Id: SubpackagesTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class SubpackagesTestMavenProjectStub

     extends MavenProjectStub

@@ -57,7 +56,7 @@
         setBuild( build );

 

         List<String> compileSourceRoots = new ArrayList<>();

-        compileSourceRoots.add( getBasedir() + "/subpackages/test" );

+        compileSourceRoots.add( getBasedir().getAbsolutePath() );

         setCompileSourceRoots( compileSourceRoots );

     }

 

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/TagTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/TagTestMavenProjectStub.java
index 236c44d..db9d67c 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/TagTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/TagTestMavenProjectStub.java
@@ -28,7 +28,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: TagTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class TagTestMavenProjectStub extends MavenProjectStub

 {

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/TagletArtifactsMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/TagletArtifactsMavenProjectStub.java
index 59f3dbc..67afe30 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/TagletArtifactsMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/TagletArtifactsMavenProjectStub.java
@@ -32,7 +32,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: TagletArtifactsMavenProjectStub.java 1385163 2012-09-15 20:29:11Z hboutemy $

  */

 public class TagletArtifactsMavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/TagletTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/TagletTestMavenProjectStub.java
index d1c4c35..3ec222e 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/TagletTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/TagletTestMavenProjectStub.java
@@ -29,7 +29,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: TagletTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class TagletTestMavenProjectStub

     extends MavenProjectStub

@@ -57,7 +56,7 @@
         setBuild( build );

 

         List<String> compileSourceRoots = new ArrayList<>();

-        compileSourceRoots.add( getBasedir() + "/taglet/test" );

+        compileSourceRoots.add( getBasedir().getAbsolutePath() );

         setCompileSourceRoots( compileSourceRoots );

     }

 

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/TestJavadocMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/TestJavadocMavenProjectStub.java
index c0f246c..23586c1 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/TestJavadocMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/TestJavadocMavenProjectStub.java
@@ -35,7 +35,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: TestJavadocMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class TestJavadocMavenProjectStub

     extends MavenProjectStub

diff --git a/src/test/java/org/apache/maven/plugins/javadoc/stubs/WrongEncodingOptionsTestMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/javadoc/stubs/WrongEncodingOptionsTestMavenProjectStub.java
index 01996c7..742ae58 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/stubs/WrongEncodingOptionsTestMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/stubs/WrongEncodingOptionsTestMavenProjectStub.java
@@ -28,7 +28,6 @@
 

 /**

  * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>

- * @version $Id: WrongEncodingOptionsTestMavenProjectStub.java 985765 2010-08-15 21:37:47Z hboutemy $

  */

 public class WrongEncodingOptionsTestMavenProjectStub extends MavenProjectStub

 {

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
new file mode 100644
index 0000000..eed07c7
--- /dev/null
+++ b/src/test/resources/unit/optionsumlautencoding-test/optionsumlautencoding-test-plugin-config.xml
@@ -0,0 +1,73 @@
+<!--
+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>org.apache.maven.plugins.maven-javadoc-plugin.unit</groupId>
+  <artifactId>optionsumlautencoding-test</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <inceptionYear>2006</inceptionYear>
+  <name>Maven Javadoc Plugin Options Umlaut Encoding Test</name>
+  <url>http://maven.apache.org</url>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <configuration>
+          <project implementation="org.apache.maven.plugins.javadoc.stubs.OptionsUmlautEncodingMavenProjectStub"/>
+          <localRepository>${localRepository}</localRepository>
+          <outputDirectory>${basedir}/target/test/unit/optionsumlautencoding-test/target/site/apidocs</outputDirectory>
+          <javadocOptionsDir>${basedir}/target/test/unit/optionsumlautencoding-test/target/javadoc-bundle-options</javadocOptionsDir>
+          <breakiterator>false</breakiterator>
+          <old>false</old>
+          <show>protected</show>
+          <quiet>true</quiet>
+          <verbose>false</verbose>
+          <author>true</author>
+          <encoding>ISO-8859-1</encoding>
+          <docfilessubdirs>false</docfilessubdirs>
+          <linksource>false</linksource>
+          <nocomment>false</nocomment>
+          <nodeprecated>false</nodeprecated>
+          <nodeprecatedlist>false</nodeprecatedlist>
+          <nohelp>false</nohelp>
+          <noindex>false</noindex>
+          <nonavbar>false</nonavbar>
+          <nosince>false</nosince>
+          <notree>false</notree>
+          <serialwarn>false</serialwarn>
+          <splitindex>false</splitindex>
+          <stylesheet>java</stylesheet>
+          <groups/>
+          <tags/>
+          <use>true</use>
+          <version>true</version>
+          <!-- include umlauts in windowtitle which are written to options-file -->
+          <windowtitle>Maven Javadoc Plugin Options Umlaut Encoding ö ä ü ß Test 1.0-SNAPSHOT API</windowtitle>
+          <debug>true</debug>
+          <failOnError>true</failOnError>
+          <detectJavaApiLink>true</detectJavaApiLink>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/test/resources/unit/optionsumlautencoding-test/optionsumlautencoding/test/App.java
similarity index 70%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/test/resources/unit/optionsumlautencoding-test/optionsumlautencoding/test/App.java
index 53480de..ad8447b 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/test/resources/unit/optionsumlautencoding-test/optionsumlautencoding/test/App.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package optionsumlautencoding.test;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
- * 
+ *
+ *  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
@@ -19,7 +19,18 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+public class App
+{
 
-}
+    public static void main( String[] args )
+    {
+        System.out.println( "Sample Application." );
+    }
+
+
+    protected void sampleMethod( String str )
+    {
+        System.out.println( str );
+    }
+
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java b/src/test/resources/unit/optionsumlautencoding-test/optionsumlautencoding/test/AppSample.java
similarity index 64%
copy from src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
copy to src/test/resources/unit/optionsumlautencoding-test/optionsumlautencoding/test/AppSample.java
index 53480de..dcae2e3 100644
--- a/src/it/projects/MJAVADOC-384/src/main/java/com/foo/bar/internal/NotApi.java
+++ b/src/test/resources/unit/optionsumlautencoding-test/optionsumlautencoding/test/AppSample.java
@@ -1,4 +1,4 @@
-package com.foo.bar.internal;
+package optionsumlautencoding.test;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8,9 +8,9 @@
  * 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
- * 
+ *
+ *  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
@@ -19,7 +19,21 @@
  * under the License.
  */
 
-/** Not API */
-public class NotApi {
+/**
+ * @author Maria Odea Ching
+ * @since 1.4
+ * @version %I%, %G%
+ */
+public class AppSample
+{
 
-}
+    /**
+     * The main method
+     *
+     * @param args  an array of strings that contains the arguments
+     */
+    public static void main( String[] args )
+    {
+        System.out.println( "Another Sample Application" );
+    }
+}
\ No newline at end of file