[MJAVADOC-568] javadoc:jar fails when project has Automatic-Module-Name and (implicit) uses offlinelinks with element-list
diff --git a/pom.xml b/pom.xml
index 4a21374..87275ed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -240,7 +240,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-java</artifactId>
-      <version>1.0.1</version>
+      <version>1.0.2</version>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
diff --git a/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy b/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
index 2627dc1..d1e34c5 100644
--- a/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
+++ b/src/it/projects/MJAVADOC-567_aggr-mixed/verify.groovy
@@ -25,7 +25,7 @@
                      ' - testcase:module2']
 
 def errorLines = buildLog.readLines() 
-                         .dropWhile{ !it.startsWith('[ERROR]') }
+                         .dropWhile{ !it.startsWith('[ERROR] Creating') }
                          .takeWhile{ it.startsWith('[ERROR]') }
                          .collect  { it - '[ERROR] '}
                          
diff --git a/src/it/projects/MJAVADOC-568_jar-mixed/invoker.properties b/src/it/projects/MJAVADOC-568_jar-mixed/invoker.properties
new file mode 100644
index 0000000..538618d
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_jar-mixed/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+
+invoker.goals = package
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-568_jar-mixed/module1/pom.xml b/src/it/projects/MJAVADOC-568_jar-mixed/module1/pom.xml
new file mode 100644
index 0000000..985d205
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_jar-mixed/module1/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>
+  <parent>
+    <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+    <artifactId>mjavadoc568</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>mjavadoc568-module1</artifactId>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-javadocs</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-568_jar-mixed/module1/src/main/java/module-info.java b/src/it/projects/MJAVADOC-568_jar-mixed/module1/src/main/java/module-info.java
new file mode 100644
index 0000000..1fb7d2b
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_jar-mixed/module1/src/main/java/module-info.java
@@ -0,0 +1,24 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+module module1
+{
+	exports module1;
+}
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-568_jar-mixed/module1/src/main/java/module1/Module1.java b/src/it/projects/MJAVADOC-568_jar-mixed/module1/src/main/java/module1/Module1.java
new file mode 100644
index 0000000..b71b7f9
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_jar-mixed/module1/src/main/java/module1/Module1.java
@@ -0,0 +1,24 @@
+package module1;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public final class Module1
+{
+}
diff --git a/src/it/projects/MJAVADOC-568_jar-mixed/module2/pom.xml b/src/it/projects/MJAVADOC-568_jar-mixed/module2/pom.xml
new file mode 100644
index 0000000..f3f619f
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_jar-mixed/module2/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>
+  <parent>
+    <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+    <artifactId>mjavadoc568</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>mjavadoc568-module2</artifactId>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.3.2</version>
+        <configuration>
+          <archive>
+            <manifestEntries>
+              <Automatic-Module-Name>mjavadoc568.module2</Automatic-Module-Name>
+            </manifestEntries>
+          </archive>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-javadocs</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.plugins.javadoc.it</groupId>
+      <artifactId>mjavadoc568-module1</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file
diff --git a/src/it/projects/MJAVADOC-568_jar-mixed/module2/src/main/java/module2/Module2.java b/src/it/projects/MJAVADOC-568_jar-mixed/module2/src/main/java/module2/Module2.java
new file mode 100644
index 0000000..a34c5d7
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_jar-mixed/module2/src/main/java/module2/Module2.java
@@ -0,0 +1,30 @@
+package module2;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import module1.Module1;
+
+public final class Module2
+{
+    public Module1 getModule1()
+    {
+        return new Module1();
+    }
+}
diff --git a/src/it/projects/MJAVADOC-568_jar-mixed/pom.xml b/src/it/projects/MJAVADOC-568_jar-mixed/pom.xml
new file mode 100644
index 0000000..a50c54f
--- /dev/null
+++ b/src/it/projects/MJAVADOC-568_jar-mixed/pom.xml
@@ -0,0 +1,65 @@
+<?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.it</groupId>
+  <artifactId>mjavadoc568</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <url>https://com.foo.bar</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.8.0</version>
+          <configuration>
+            <release>9</release>
+          </configuration>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-jar-plugin</artifactId>
+          <version>3.0.0</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-javadoc-plugin</artifactId>
+          <version>3.1.0-SNAPSHOT</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+  <modules>
+    <module>module1</module>
+    <module>module2</module>
+  </modules>
+</project>
\ No newline at end of file
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
index b7f7308..4ddab70 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -84,7 +84,9 @@
 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.ModuleNameSource;

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

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

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

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

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

@@ -304,6 +306,8 @@
     @Component

     private ToolchainManager toolchainManager;

 

+    final LocationManager locationManager = new LocationManager();

+

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

     // Mojo parameters

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

@@ -2046,27 +2050,37 @@
             }

         }

 

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

+        // ----------------------------------------------------------------------

+        // Wrap Standard doclet Options

+        // ----------------------------------------------------------------------

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

+

+        Set<OfflineLink> offlineLinks;

+        if ( StringUtils.isEmpty( doclet ) || useStandardDocletOptions )

+        {

+            offlineLinks = getLinkofflines();

+            addStandardDocletOptions( javadocOutputDirectory, standardDocletArguments, offlineLinks );

+        }

+        else

+        {

+            offlineLinks = Collections.emptySet();

+        }

 

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

         // Wrap Javadoc options

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

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

 

-        addJavadocOptions( javadocOutputDirectory, arguments, sourcePaths );

-

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

-        // Wrap Standard doclet Options

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

-

-        if ( StringUtils.isEmpty( doclet ) || useStandardDocletOptions )

-        {

-            addStandardDocletOptions( javadocOutputDirectory, arguments );

-        }

+        addJavadocOptions( javadocOutputDirectory, javadocArguments, sourcePaths, offlineLinks );

 

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

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

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

 

+        List<String> arguments = new ArrayList<>( javadocArguments.size() + standardDocletArguments.size() );

+        arguments.addAll( javadocArguments );

+        arguments.addAll( standardDocletArguments );

+

         if ( arguments.size() > 0 )

         {

             addCommandLineOptions( cmd, arguments, javadocOutputDirectory );

@@ -4045,13 +4059,9 @@
      * @see #getModulesLinks()

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

      */

-    private void addLinkofflineArguments( List<String> arguments )

+    private void addLinkofflineArguments( List<String> arguments, Set<OfflineLink> offlineLinksList )

         throws MavenReportException

     {

-        Set<OfflineLink> offlineLinksList = collectOfflineLinks();

-

-        offlineLinksList.addAll( getModulesLinks() );

-

         for ( OfflineLink offlineLink : offlineLinksList )

         {

             String url = offlineLink.getUrl();

@@ -4075,6 +4085,15 @@
         }

     }

 

+    private Set<OfflineLink> getLinkofflines() throws MavenReportException

+    {

+        Set<OfflineLink> offlineLinksList = collectOfflineLinks();

+

+        offlineLinksList.addAll( getModulesLinks() );

+

+        return offlineLinksList;

+    }

+

     /**

      * Convenience method to process {@link #links} values as individual <code>-link</code> javadoc options.

      * If {@link #detectLinks}, try to add javadoc apidocs according Maven conventions for all dependencies given

@@ -4390,7 +4409,6 @@
         {

             return returnList;

         }

-        LocationManager locationManager = new LocationManager();

 

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

         {

@@ -4830,7 +4848,8 @@
      */

     private void addJavadocOptions( File javadocOutputDirectory,

                                     List<String> arguments,

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

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

+                                    Set<OfflineLink> offlineLinks )

         throws MavenReportException

     {

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

@@ -4868,8 +4887,6 @@
                                                            reactorProject.getArtifactId() ), reactorProject );

         }

         

-        final LocationManager locationManager = new LocationManager();

-        

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

         

         boolean containsModuleDescriptor = false;

@@ -4888,13 +4905,13 @@
             Collection<String> unnamedProjects = new ArrayList<>();

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

             {

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

-                if ( aggregatorProject != null )

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

+                if ( aggregatedProject != null )

                 {

                     String moduleName = null;

                     

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

-                    File artifactFile = getArtifactFile( aggregatorProject );

+                    File artifactFile = getArtifactFile( aggregatedProject );

                     if ( artifactFile != null ) 

                     {

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

@@ -4986,23 +5003,83 @@
             }

         }

 

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

+        ResolvePathResult resolvePathResult = getResolvePathResult( getArtifactFile( getProject() ) );

+

+        // MJAVADOC-506 

+        File moduleDescriptorSource = null;

+        if ( resolvePathResult == null || resolvePathResult.getModuleNameSource() == ModuleNameSource.FILENAME )

+        {

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

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

+            {

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

+            }

+

+            moduleDescriptorSource = findMainDescriptor( roots );

+        }

+

+        boolean isExplicitModuleName =

+            resolvePathResult != null && ( resolvePathResult.getModuleNameSource() == ModuleNameSource.MODULEDESCRIPTOR

+                || resolvePathResult.getModuleNameSource() == ModuleNameSource.MANIFEST );

+

+        if ( javadocRuntimeVersion.isAtLeast( "9" )

+            && ( isAggregator() || isExplicitModuleName || moduleDescriptorSource != null ) 

+            && !isTest() )

         {

             ResolvePathsRequest<File> request =

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

-            

-            if ( mainDescriptor != null )

+                ResolvePathsRequest.ofFiles( getPathElements() );

+

+            if ( moduleDescriptorSource != null )

             {

-                request.setMainModuleDescriptor( mainDescriptor );

+                request.setMainModuleDescriptor( moduleDescriptorSource );

             }

+            else if ( resolvePathResult != null )

+            {

+                request.setModuleDescriptor( resolvePathResult.getModuleDescriptor() );

+            }

+

+            if ( resolvePathResult != null && resolvePathResult.getModuleNameSource() == ModuleNameSource.MANIFEST )

+            {

+                // represent --add-modules

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

+

+                // scan for element-list in offline links

+                for ( OfflineLink link : offlineLinks )

+                {

+                    if ( link.equals( getDefaultJavadocApiLink() ) )

+                    {

+                        continue;

+                    }

+

+                    Path elementList = Paths.get( link.getLocation(), "element-list" ); 

+                    if ( Files.isRegularFile( elementList ) )

+                    {

+                        try

+                        {

+                            List<String> lines = Files.readAllLines( elementList, StandardCharsets.UTF_8 );

+                            

+                            for ( String line : lines )

+                            {

+                                if ( line.startsWith( "module:" ) )

+                                {

+                                    addModules.add( line.substring( "module:".length() ) );

+                                }

+                            }

+                        }

+                        catch ( IOException e )

+                        {

+                            // noop

+                        }

+                    }

+                }

+                additionalModules.addAll( addModules );

+

+                String addModulesLine = StringUtils.join( addModules.iterator(), "," );

+                addArgIfNotEmpty( arguments, "--add-modules", JavadocUtil.quotedPathArgument( addModulesLine ) );

+            }

+

+            request.setAdditionalModules( additionalModules );

             

             try

             {

@@ -5119,6 +5196,31 @@
         }

     }

 

+    private ResolvePathResult getResolvePathResult( File artifactFile )

+    {

+        if ( artifactFile == null )

+        {

+            return null;

+        }

+

+        ResolvePathResult resolvePathResult = null;

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

+        try

+        {

+            resolvePathResult = locationManager.resolvePath( resolvePathRequest );

+        }

+        catch ( IOException | RuntimeException /* e.g java.lang.module.FindException */ e )

+        {

+            Throwable cause = e;

+            while ( cause.getCause() != null )

+            {

+                cause = cause.getCause();

+            }

+            getLog().warn( e.getMessage() );

+        }

+        return resolvePathResult;

+    }

+

     private File findMainDescriptor( Collection<Path> roots )

     {

         for ( Path root : roots )

@@ -5144,7 +5246,9 @@
      * @see <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#standard">

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

      */

-    private void addStandardDocletOptions( File javadocOutputDirectory, List<String> arguments )

+    private void addStandardDocletOptions( File javadocOutputDirectory, 

+                                           List<String> arguments,

+                                           Set<OfflineLink> offlineLinks )

         throws MavenReportException

     {

         validateStandardDocletOptions();

@@ -5191,7 +5295,7 @@
 

         addLinkArguments( arguments );

 

-        addLinkofflineArguments( arguments );

+        addLinkofflineArguments( arguments, offlineLinks );

 

         addArgIf( arguments, linksource, "-linksource", SINCE_JAVADOC_1_4 );