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

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 13.1
    • Fix Version/s: 13.2-rc-1
    • Labels:
    • Environment:
      Java 14
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      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

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

              Dates

              Created:
              Updated:
              Resolved: