I'm trying to javadoc code that contains a module-info.java
that requires org.apache.logging.log4j;
.
I've included the jar from Maven Central that matches the coordinates "org.apache.logging.log4j:log4j-api:2.11.0
(which is a multi-release jar) on the module path.
javac
compiles the code fine, but the following simplified javadoc
command outputs an error:
javadoc --module-path ./log4j-api-2.11.0.jar -d ~/Desktop ./src/main/java/module-info.java
Error:
error: module not found: org.apache.logging.log4j requires org.apache.logging.log4j;
When I manually repackaged log4j-api-2.11.0.jar
as a non-multi-release jar, the javadoc
worked (the simplified command above outputs an error about No public or protected classes found to document
, but my real command works, and that error shows that the simplified command has progressed past the module not found
error).
Does javadoc (from Oracle JDK 10.0.2+13) not support multi-release jars on the module-path?
Or is there something wrong with log4j-api-2.11.0.jar
that can be fixed while still maintaining it as a multi-release jar?
This is a a bug in the Javadoc tool and has been reported to Oracle. See https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8208269.