Kai Hofmann created MJAVADOC-673:
------------------------------------
Summary: Generating wrong commandline option for javadoc tool when
using Java9+ modules
Key: MJAVADOC-673
URL: https://issues.apache.org/jira/browse/MJAVADOC-673
Project: Maven Javadoc Plugin
Issue Type: Bug
Components: javadoc
Affects Versions: 3.2.0
Environment: MacOS, Window, Linux, Java 11.0.10 +
With older java versions like 11.0.3 you will got more errors!
Reporter: Kai Hofmann
When you checkout my open source
[TemplateEnginel|https://github.com/PowerStat/TemplateEngine] and simply run
{code:java}
mvn javadoc:javadoc
{code}
you will get the following error message:
{noformat}
[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.
[...]{noformat}
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:
{code:java}
--module-source-path
'D:/work/eclipse/java/github/TemplateEngine/target/site/apidocs/src'
{code}
Run the *javadoc.bat*|*sh* again.
Now the error
{noformat}
error: module not found: de.powerstat.phplib.templateengine{noformat}
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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)