[MJAVADOC-704] Javadoc plugin does not respect jdkToolchain (original) (raw)
If I run the following using JDK 8:
org.apache.maven.plugins maven-javadoc-plugin 3.3.1 attach-javadocs jar 11I get:
[INFO] Toolchain in maven-javadoc-plugin: JDK[C:\Program Files\Java\jdk-11.0.2] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.3.1:jar (attach-javadocs) on project core: Execution attach-javadocs of goal org.apache.maven.plugins:maven-javadoc-plugin:3.3.1:jar failed. [...] Caused by: java.lang.UnsupportedOperationException at org.codehaus.plexus.languages.java.jpms.CmdModuleNameExtractor.getModuleName (CmdModuleNameExtractor.java:46)
If I run the same code using JDK 11 I get past this point (I get an error relating to the contents of module-info):
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.3.1:jar (attach-javadocs) on project core: MavenReportException: Error while generating Javadoc: [ERROR] Exit code: 1 - C:\Users\Gili\Documents\pouch\core\src\main\java\module-info.java:3: error: module not found: org.slf4j [ERROR] requires org.slf4j; [ERROR] ^ [ERROR] [ERROR] Command line was: cmd.exe /X /C ""C:\Program Files\Java\jdk-11.0.2\bin\javadoc.exe" @options @argfile" [ERROR] [ERROR] Refer to the generated Javadoc files in 'C:\Users\Gili\Documents\pouch\core\target\apidocs' dir. [ERROR] [ERROR] -> [Help 1]
This seems to imply that jdkToolchain is being ignored.
On the other hand, if I use jdkToolchain with the maven-compiler-plugin it seems to work just fine. My toolchains.xml file contains:
jdk 11 oracle C:\Program Files\Java\jdk-11.0.2Am I doing anything wrong? Or is this a possible bug in the plugin?