Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-2150

Don't generate extra Javadoc errors when building on Java 9+

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      Example error:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.1.1:javadoc (default-cli) on project application-antispam-api: An error has occurred in Javadoc report generation: 
      [ERROR] Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module.
      [ERROR] 
      [ERROR] Command line was: /Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home/bin/javadoc -J-Xmx1024m @options @packages
      [ERROR] 
      [ERROR] Refer to the generated Javadoc files in '/Users/vmassol/dev/xwiki/application-antispam/application-antispam-api/target/site/apidocs' dir.
      [ERROR] 
      

      Solution: Set the java version in the maven javadoc plugin, as in:

              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                  <source>8</source>
                </configuration>
              </plugin>
      

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: