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

Generating wrong commandline option for javadoc tool when using Java9+ modules

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Duplicate
    • 3.2.0
    • None
    • javadoc
    • MacOS, Window, Linux, Java 11.0.10 +

      With older java versions like 11.0.3 you will got more errors!


      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] --- maven-javadoc-plugin:3.2.0:javadoc (default-cli) @ templateengine ---
      [INFO] No previous run data found, generating javadoc.
      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.
      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:


      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.



        Issue Links


          This comment will be Viewable by All Users Viewable by All Users


            rfscholte Robert Scholte
            powerstat Kai Hofmann
            3 Vote for this issue
            4 Start watching this issue



              Issue deployment