Details
Description
Depending on a module using "requires static transitive", and then depending on that module, breaks javadoc execution.
Summary
Module org.checkerframework.checker.qual exists.
Module A "requires static transitive org.checkerframework.checker.qual"
- Running the javadoc plugin on module A always succeeds.
Module B requires module A.
- Running the javadoc plugin on module B fails with "module not found: org.checkerframework.checker.qual"
This happens only when Module A uses "requires static transitive" on an automatic module. If Module A "requires" or "requires transitive" or "requires static" checker-qual, the javadoc succeeds on Module B.
It does not matter whether checker-qual is an automatic module or a full module. The reproducer includes hsqldb 2.6.0 which is a full module, and the same error occurs.
Reproducer
Attached. Also posted at https://github.com/A248/MJAVADOC-677
Cause
In target/apidocs/options, the javadoc plugin places checker-qual on the classpath with "--class-path".
If checker-qual is placed on the module-path, javadoc execution succeeds. This is demonstrated by editing the options file to place checker-qual on the module path, and running "javadoc @options @argfile".
The issue looks like it stems from plexus-java's LocationManager which returns a module-path consisting of required modules but ignoring statically-required modules: https://github.com/codehaus-plexus/plexus-languages/blob/c1c07b59179bfafd3e80ce82ddd53dae1b2867a7/plexus-java/src/main/java/org/codehaus/plexus/languages/java/jpms/LocationManager.java#L405
General Solution
Modules specified by "requires static transitive" need to be replaced on the module-path rather than class-path.
Attachments
Attachments
Issue Links
- causes
-
MCOMPILER-481 JPMS Regression: cannot access <class> (requires static module not include anymore)
- Closed
- links to