You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Anand Beh (Jira)" <ji...@apache.org> on 2021/05/18 16:14:00 UTC

[jira] [Updated] (MJAVADOC-677) Using "requires static transitive" makes javadoc goal fail

     [ https://issues.apache.org/jira/browse/MJAVADOC-677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anand Beh updated MJAVADOC-677:
-------------------------------
    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.

  was:
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.

*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.


> Using "requires static transitive" makes javadoc goal fail
> ----------------------------------------------------------
>
>                 Key: MJAVADOC-677
>                 URL: https://issues.apache.org/jira/browse/MJAVADOC-677
>             Project: Maven Javadoc Plugin
>          Issue Type: Bug
>          Components: javadoc
>    Affects Versions: 3.2.0
>         Environment: Zulu JDK 16.28+11-CA (build 16+36)
> Mac OS 10.14.6
>            Reporter: Anand Beh
>            Priority: Major
>         Attachments: Javadoc-Modulepath.zip
>
>
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)