Details
Description
When you checkout my open source TemplateEnginel and simply run
mvn javadoc:javadoc
you will get the following error message:
[INFO] <<< maven-javadoc-plugin:3.2.0:javadoc (default-cli) < generate-sources @ templateengine <<< [INFO] [INFO] [INFO] --- maven-javadoc-plugin:3.2.0:javadoc (default-cli) @ templateengine --- [INFO] No previous run data found, generating javadoc. [INFO] Loading source file D:\work\eclipse\java\github\TemplateEngine\src\main\java\module-info.java... 1 error [ERROR] Error while creating javadoc report: Exit code: 1 - error: module not found: de.powerstat.phplib.templateengine Command line was: cmd.exe /X /C "D:\Programme\Java\jdk-11.0.10\bin\javadoc.exe @options @packages @argfile" Refer to the generated Javadoc files in 'D:\work\eclipse\java\github\TemplateEngine\target\site\apidocs' dir. org.apache.maven.reporting.MavenReportException: Exit code: 1 - error: module not found: de.powerstat.phplib.templateengine Commandline was: cmd.exe /X /C "D:\Programme\Java\jdk-11.0.10\bin\javadoc.exe @options @packages @argfile"Refer to the generated Javadoc files in 'D:\work\eclipse\java\github\TemplateEngine\target\site\apidocs' dir. [...]
Now go to target/site/apidocs
There you could run the generated script by javadoc.bat|sh
Which results in the same error!
Please note that the subdirectory src/de.powerstat.phplib.templateengine is empty.
Now open the options file
and remove the following lines:
--module-source-path
'D:/work/eclipse/java/github/TemplateEngine/target/site/apidocs/src'
Run the javadoc.bat|sh again.
Now the error
error: module not found: de.powerstat.phplib.templateengine
is gone. And the javadocs are generated as expected!
So for me it looks like the generated --module-source-path option for the javadoc command is wrong in this (and maybe other) context(s)!
The generation happens in org.apache.maven.plugins.javadoc.AbstractJavadocMojo around line 5316.
Because of the complexity of this code and it's context (maven Reactor) I am not able to provide a patch for this.
But hopefully you could fix this fast, because it is a real blocker that makes maven javadoc generation for java 9+ modules imposible.
Attachments
Issue Links
- duplicates
-
MJAVADOC-576 javadoc:javadoc fails if module contains module-info.java
- Closed