Commons parent configures links [1] in the maven javadoc plugin:

            <links>

              <link>${commons.javadoc.java.link}</link>

              <link>${commons.javadoc.javaee.link}</link>

            </links>

These default to standard locations for the JDK API docs and can be
configured using available properties in CP. However I do not think they
are required. The current maven javadoc plugin has a property
<detectJavaApiLink> which adds the links based on the current source.

Typically this does not affect a build as the links are added and
duplicated links would be ignored. However when building on JDK 17 the link
for Java 8 is looking for an element list for the module-based Javadoc API:

https://docs.oracle.com/javase/8/docs/api/element-list

not the classic package based Javadoc API:

https://docs.oracle.com/javase/8/docs/api/package-list

The element-list URL does not exist (modules did not exist for JDK 8) and
is redirected to the latest JDK:

https://docs.oracle.com/en/java/javase/19/

This creates a Javadoc plugin warning that the configured link is
redirected. When building the RNG project this fails the build (as any
javadoc warnings are configured to fail the build).

I could not set any configuration in the maven javadoc plugin to get around
this warning. I am building using MacOS:

Maven home: /usr/local/apache-maven-3.6.3

Java version: 17, vendor: Oracle Corporation, runtime:
/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home

I have removed the links using:

          <links combine.self="override">

          </links>

The error then disappears and the build completes. The rendered Javadoc
still has links to all JDK objects as the <detectJavaApiLink> defaults to
true.

I believe the <links> property is to be used for any non-standard links.
There is even a <detectLinks> property to do some auto detection of
dependencies based on artifact names; this defaults to false. The JDK links
should not be required in the configuration for these standard links.

Alex


[1]
https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#links
[2]
https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#detectJavaApiLink

Reply via email to