Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8208269

Javadoc does not support module-info in a multi-release jar

    Details

    • Subcomponent:
    • Resolved In Build:
      b08
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        ADDITIONAL SYSTEM INFORMATION :
        java version "11-ea" 2018-09-25
        Java(TM) SE Runtime Environment 18.9 (build 11-ea+23)
        Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11-ea+23, mixed mode)

        macOS 10.13.6

        A DESCRIPTION OF THE PROBLEM :
        See https://issues.apache.org/jira/browse/LOG4J2-2393. With log4j-api-2.10.0.jar entering
        javadoc -verbose --module-path ~/.m2/repository/org/apache/logging/log4j/log4j-api/2.10.0/log4j-api-2.10.0.jar -d temp ./module-info.java results in Javadoc finding the log4j-api module. However, javadoc -verbose --module-path ~/Downloads/log4j-api-2.11.0.jar -d temp ./module-info.java results in
        Loading source file ./module-info.java...
        ./module-info.java:2: error: module not found: org.apache.logging.log4j
            requires org.apache.logging.log4j;

        The difference here is that in log4j 2.10.0 module-info.class is at the root of the log4j-api jar. In log4j 2.11.0 module-info.class is located at META-INF/versions/9. This change was made at the advise of the Jigsaw dev list.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Download log4j-api-2.11.0.jar.
        2. Create a module info such as
        module my.test {
            requires org.apache.logging.log4j;
        }
        3. Run the command javadoc -verbose --module-path ./log4j-api-2.11.0.jar -d temp ./module-info.java

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Loading source file ./module-info.java...
        [parsing started SimpleFileObject[/Users/rgoers/module-info.java]]
        [parsing completed 13ms]
        [loading /Users/rgoers/.m2/repository/org/apache/logging/log4j/log4j-api/2.10.0/log4j-api-2.10.0.jar(/module-info.class)]
        [loading /modules/java.base/module-info.class]
        Constructing Javadoc information...
        javadoc: error - No public or protected classes found to document.
        [search path for source files: .]
        [search path for class files: /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/lib/modules,.]
        [done in 510 ms]
        1 error
        ACTUAL -
        Loading source file ./module-info.java...
        ./module-info.java:2: error: module not found: org.apache.logging.log4j
            requires org.apache.logging.log4j;
                                       ^
        [parsing started SimpleFileObject[/Users/rgoers/module-info.java]]
        [parsing completed 10ms]
        [loading /modules/java.base/module-info.class]
        [done in 326 ms]
        1 error

        FREQUENCY : always


          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jlahoda Jan Lahoda
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: