Uploaded image for project: 'Maven Javadoc Plugin'
  1. Maven Javadoc Plugin
  2. MJAVADOC-677

Using "requires static transitive" makes javadoc goal fail

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.3.1
    • javadoc
    • None
    • Zulu JDK 16.28+11-CA (build 16+36)
      Mac OS 10.14.6

    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

        1. Javadoc-Modulepath.zip
          10 kB
          Anand Beh

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              A248 Anand Beh
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: