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

mvn javadoc:javadoc fails when module-info.java is present

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.1.1
    • None
    • javadoc
    • None

    Description

      I have a simple project that exports a single module.

      When I execute the command mvn javadoc:javadoc I get a "Exit code: 1 - error: module not found:" error for the module that is being exported.

      If I remove the module-info.java file and run the command again then everything works as expected.

       

      When the mvn javadoc:javadoc command fails it dumps configuration options into some text files in target/site/apidocs. If I delete the --module-source-path flag from the options file and re-run the command it works without problem.

       


       

      Here is how to reproduce this problem. I've attached a tarball containing a simple project that invokes the error. dummy.tar

       

      I have a directory structure as described below, a simple hello-world that exports a single module.

       

       

      dummy
      | - pom.xml
      | - src
          | - main
          | - java
              | - module-info.java
              | - dummy
                  | - foobar
                      | - HelloWorld.java
      

       

      My module-info.java looks like this:

       

      module dummy { 
          exports dummy.foobar;
      }
      

      My maven-javadoc-plugin configuration looks like this:

       

      <plugin>
          <groupId>org.apache.maven.plugins</groupId> 
          <artifactId>maven-javadoc-plugin</artifactId> 
          <version>3.1.1</version> 
          <configuration
              <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable
              <show>public</show> 
              <windowtitle>This is a test</windowtitle> 
              <doctitle>Just testing here</doctitle> 
          </configuration> 
      </plugin>
      

      In the root directory of the project, run mvn javadoc:javadoc. You should see an error that looks something like this:

       

      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  1.196 s
      [INFO] Finished at: 2019-11-18T15:43:35-06:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.1.1:javadoc (default-cli) on project dummy: An error has occurred in Javadoc report generation:
      [ERROR] Exit code: 1 - error: module not found: dummy
      [ERROR]
      [ERROR] Command line was: /Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home/bin/javadoc @options @packages @argfile
      [ERROR]
      [ERROR] Refer to the generated Javadoc files in '/Users/codylittley/ws/dummy/target/site/apidocs' dir.
      

      If src/main/java/module-info.java is deleted then the docs are built as expected.

       

       

      Attachments

        1. dummy.tar
          9 kB
          Cody Littley

        Activity

          People

            rfscholte Robert Scholte
            littley Cody Littley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: