Robert,
I see the problem with 12; I don't see a problem with 11.
More completely, for versions of JDK ranging from 8 to 12, for values of
-source ranging from 8 to the JDK version, the only case that is broken
is using JDK 12 javadoc, with -source 9 and linking to the JDK 9 API docs.
There's no easy/immediate fix here. As a general rule, Oracle does not
update docs for older releases, and simply adding an element-list file
(your third option) would almost certainly not work ... while it would
cause the error message to go away, the URLs that would be generated to
point into the API would be incorrect.
And, JDK 12 is GA next week, and this is not a showstopper to stop the
release.
I agree the messages coming from the tool are confusing, and it is less
than optimal that you are getting an error message and generated docs.
That being said, the docs are "mostly correct"; the only deficiency is
that references to the JDK API are not linked (because of the
package-list/element-list problem.)
-- Jon
On 03/12/2019 02:03 PM, Robert Scholte wrote:
When generating with Javadoc with Java 11 or 12 for sources that are
Java 9 compatible I get the following output:
Loading source files for package com.foo...
Constructing Javadoc information...
javadoc: error - The code being documented uses modules but the
packages defined in https://docs.oracle.com/javase/9/docs/api/ are in
the unnamed module.
Standard Doclet version 12
Building tree for all the packages and classes...
Generating ....
:
:
:
1 error
This seems inconsistent: either don't create an error or don't
generate the javadoc.
In this case there's probably a third option worth considering: create
an element-list for the online Java 9 docs.
How should this be solved?
Based on the answer I can fix this for the next release of the
maven-javadoc-plugin.
thanks,
Robert