Description
I upgraded maven-javadoc-plugin from version 3.2.0 to 3.3.1. At the same time, I upgraded from JDK 11 to 17. All of a sudden I am getting the following build failure I was not getting before:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.3.1:jar (attach-javadocs) on project maven_plugin: MavenReportException: Error while generating Javadoc: [ERROR] Exit code: 1 - Loading source file C:\Users\Gili\Documents\requirements.java\maven_plugin\src\main\java\com\github\cowwoc\requirements\maven\AbstractGeneratorMojo.java... [ERROR] Loading source file C:\Users\Gili\Documents\requirements.java\maven_plugin\src\main\java\com\github\cowwoc\requirements\maven\GenerateApiMojo.java... [ERROR] Loading source file C:\Users\Gili\Documents\requirements.java\maven_plugin\src\main\java\com\github\cowwoc\requirements\maven\OptimizeExceptionsMojo.java... [ERROR] Loading source file C:\Users\Gili\Documents\requirements.java\maven_plugin\src\main\java\com\github\cowwoc\requirements\maven\package-info.java... [ERROR] Loading source file C:\Users\Gili\Documents\requirements.java\maven_plugin\src\main\java\com\github\cowwoc\requirements\maven\UnpackMojo.java... [ERROR] Loading source file C:\Users\Gili\Documents\requirements.java\maven_plugin\target\generated-sources\plugin\com\github\cowwoc\requirements\maven\HelpMojo.java... [ERROR] Loading source files for package com.github.cowwoc.requirements.maven... [ERROR] Constructing Javadoc information... [ERROR] C:\Users\Gili\Documents\requirements.java\maven_plugin\target\generated-sources\plugin\com\github\cowwoc\requirements\maven\HelpMojo.java:8: error: package org.w3c.dom is not visible [ERROR] import org.w3c.dom.Document; [ERROR] ^ [ERROR] (package org.w3c.dom is declared in module java.xml, but module com.github.cowwoc.requirements.maven_plugin does not read it) [ERROR] C:\Users\Gili\Documents\requirements.java\maven_plugin\target\generated-sources\plugin\com\github\cowwoc\requirements\maven\HelpMojo.java:9: error: package org.w3c.dom is not visible [ERROR] import org.w3c.dom.Element; [ERROR] ^ [ERROR] (package org.w3c.dom is declared in module java.xml, but module com.github.cowwoc.requirements.maven_plugin does not read it) [ERROR] C:\Users\Gili\Documents\requirements.java\maven_plugin\target\generated-sources\plugin\com\github\cowwoc\requirements\maven\HelpMojo.java:10: error: package org.w3c.dom is not visible [ERROR] import org.w3c.dom.Node; [ERROR] ^ [ERROR] (package org.w3c.dom is declared in module java.xml, but module com.github.cowwoc.requirements.maven_plugin does not read it) [ERROR] C:\Users\Gili\Documents\requirements.java\maven_plugin\target\generated-sources\plugin\com\github\cowwoc\requirements\maven\HelpMojo.java:11: error: package org.w3c.dom is not visible [ERROR] import org.w3c.dom.NodeList; [ERROR] ^ [ERROR] (package org.w3c.dom is declared in module java.xml, but module com.github.cowwoc.requirements.maven_plugin does not read it) [ERROR] C:\Users\Gili\Documents\requirements.java\maven_plugin\target\generated-sources\plugin\com\github\cowwoc\requirements\maven\HelpMojo.java:12: error: package org.xml.sax is not visible [ERROR] import org.xml.sax.SAXException; [ERROR] ^ [ERROR] (package org.xml.sax is declared in module java.xml, but module com.github.cowwoc.requirements.maven_plugin does not read it) [ERROR] C:\Users\Gili\Documents\requirements.java\maven_plugin\target\generated-sources\plugin\com\github\cowwoc\requirements\maven\HelpMojo.java:14: error: package javax.xml.parsers is not visible [ERROR] import javax.xml.parsers.DocumentBuilder; [ERROR] ^ [ERROR] (package javax.xml.parsers is declared in module java.xml, but module com.github.cowwoc.requirements.maven_plugin does not read it) [ERROR] C:\Users\Gili\Documents\requirements.java\maven_plugin\target\generated-sources\plugin\com\github\cowwoc\requirements\maven\HelpMojo.java:15: error: package javax.xml.parsers is not visible [ERROR] import javax.xml.parsers.DocumentBuilderFactory; [ERROR] ^ [ERROR] (package javax.xml.parsers is declared in module java.xml, but module com.github.cowwoc.requirements.maven_plugin does not read it) [ERROR] C:\Users\Gili\Documents\requirements.java\maven_plugin\target\generated-sources\plugin\com\github\cowwoc\requirements\maven\HelpMojo.java:16: error: package javax.xml.parsers is not visible [ERROR] import javax.xml.parsers.ParserConfigurationException; [ERROR] ^ [ERROR] (package javax.xml.parsers is declared in module java.xml, but module com.github.cowwoc.requirements.maven_plugin does not read it) [ERROR] 8 errors [ERROR] [ERROR] Command line was: cmd.exe /X /C "C:\Users\Gili\.jdks\openjdk-17.0.1\bin\javadoc.exe @options @packages @argfile" [ERROR] [ERROR] Refer to the generated Javadoc files in 'C:\Users\Gili\Documents\requirements.java\maven_plugin\target\apidocs' dir. [ERROR] [ERROR] -> [Help 1]
The Mojo in question did not change at all. It is not a Java Module so I don't understand why the Javadoc engine is treating it as such. I would be more than happy to upgrade the Mojo to a Java Module but at last check this isn't technically possible (I get Error: the unnamed module reads package org.apache.maven.plugin from both maven.core and maven.plugin.api).
Any ideas?