10

Generating a JavaDoc with Maven I get an error message 'Error fetching link:' referring to a file javadoc-bundle-options. In it it contains javadocResourcesDirectory with a directory. Even if I create that directory I still get the same error. How can I correct the error?

    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>3.2.0</version>
    <configuration>
        <show>public</show>
        <quiet>true</quiet>
        <doctitle>${project.name}</doctitle>
        <sourceFileExcludes>**/tests/**/*.java</sourceFileExcludes>
        <links>
            <link>https://docs.oracle.com/en/java/javase/14/docs/api/</link>
        </links>
        <javadocDirectory>javadoc/resources</javadocDirectory>
   </configuration>
    <executions>
        <execution>
            <id>javadocs-jar</id>
            <phase>package</phase>
            <goals>
                <goal>jar</goal>
            </goals>
        </execution>
    </executions>
</plugin>

    <?xml version="1.0" encoding="UTF-8"?>
<javadocOptions>
  <docletArtifacts>
    <docletArtifact />
  </docletArtifacts>
  <tagletArtifacts>
    <tagletArtifact />
  </tagletArtifacts>
  <links>
    <link>https://docs.oracle.com/en/java/javase/14/docs/api/</link>
  </links>
  <javadocResourcesDirectory>javadoc/resources</javadocResourcesDirectory>
</javadocOptions>

1 Answer 1

4

According to the Apache Maven Issue: https://issues.apache.org/jira/browse/MJAVADOC-623 this is a bug in the Maven JavaDoc Plugin version 3.1.1.

You can "correct" the error by trying to use version 3.1.0, or use the fixed version of the plugin when it is released (at time of writing this, it still hasn't been released).

EDIT (1):

A workaround is to add the maven.compiler.release property to the Maven project file:

<project>
  <properties>
    <maven.compiler.release>11</maven.compiler.release>
  </properties>
</project>

EDIT (2):

A workaround is to specify the Java release in the Maven JavaDoc Plugin:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-javadoc-plugin</artifactId>
  <version>3.2.0</version>
  <executions>
    <execution>
      <id>main-javadoc</id>
      <phase>package</phase>
      <goals>
        <goal>jar</goal>
      </goals>
      <configuration>
        <release>11</release>
      </configuration>
    </execution>
  </executions>
</plugin>
Sign up to request clarification or add additional context in comments.

1 Comment

Maven JavaDoc plugin 3.2.0 is also affected by this bug.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.