You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (Jira)" <ji...@apache.org> on 2021/08/22 08:19:00 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17402743#comment-17402743 ] 

Robert Scholte commented on MJAVADOC-677:
-----------------------------------------

Will be solved with the next version of plexus-java.
However, keep in mind that the combination of static + transitive is  valid (javac and javadoc understand it), but also very awkward. By saying static you say it is only required at compile time and not at runtime.
By saying transitive you say that project requiring this module will automatically get the requirement as well.
So with static transitive the module is optional, but the project using is will get it anyway during compilation, that's kind of weird, right?

> 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)