[ 
https://issues.apache.org/jira/browse/MCOMPILER-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17248616#comment-17248616
 ] 

Benjamin Marwell commented on MCOMPILER-445:
--------------------------------------------

It is not just you… 

The compiler (javac) will check javadoc. BUT they moved the logic for this into 
a(nother) module, which is not loaded due to not using forks for compilation.

See list thread here: 
[https://lists.apache.org/thread.html/r026b0d9dc8a678b530e36217993920febd72eb4593d312fa2e7465ec%40%3Cdev.maven.apache.org%3E]

See the actual failing IT here: 
[https://github.com/bmarwell/maven-compiler-plugin/actions/runs/419095393]

> Javac error on jdk16 build 18: invalid flag: -Xdoclint:-missing
> ---------------------------------------------------------------
>
>                 Key: MCOMPILER-445
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-445
>             Project: Maven Compiler Plugin
>          Issue Type: Bug
>    Affects Versions: 3.8.0, 3.8.1
>         Environment: Maven 3.6.3
> Compiler-Plugin 3.8.1
> JDK16 since JDK 16 ea b 18
>            Reporter: Benjamin Marwell
>            Assignee: Benjamin Marwell
>            Priority: Major
>              Labels: jdk, jdk-javac, jdk16
>
> h2. Issue description
> When compiling with options {{noFork}} and {{-Xdoclint}}, the compiler plugin 
> will fail:
>  
> {quote}{{[INFO] 
> ------------------------------------------------------------------------}}
> {{[ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile 
> (pre-compile-jute) on project zookeeper-jute: Fatal error compiling: error: 
> invalid flag: -Xdoclint:-missing -> [Help 1]}}
> {{This is Maven debug:}}
> {{[DEBUG] Classpath:}}
> {{[DEBUG] /home/eolivelli/dev/zookeeper/zookeeper-jute/target/classes}}
> {{[DEBUG] 
> /home/eolivelli/.m2/repository/org/apache/yetus/audience-annotations/0.5.0/audience-annotations-0.5.0.jar}}
> {{[DEBUG] Source roots:}}
> {{[DEBUG] /home/eolivelli/dev/zookeeper/zookeeper-jute/src/main/java}}
> {{[DEBUG] 
> /home/eolivelli/dev/zookeeper/zookeeper-jute/target/generated-sources/java}}
> {{[DEBUG] 
> /home/eolivelli/dev/zookeeper/zookeeper-jute/target/generated-sources/annotations}}
> {{[DEBUG] Command line options:}}
> {{[DEBUG] -d /home/eolivelli/dev/zookeeper/zookeeper-jute/target/classes 
> -classpath 
> /home/eolivelli/dev/zookeeper/zookeeper-jute/target/classes:/home/eolivelli/.m2/repository/org/apache/yetus/audience-annotations/0.5.0/audience-annotations-0.5.0.jar:
>  -sourcepath 
> /home/eolivelli/dev/zookeeper/zookeeper-jute/src/main/java:/home/eolivelli/dev/zookeeper/zookeeper-jute/target/generated-sources/java:/home/eolivelli/dev/zookeeper/zookeeper-jute/target/generated-sources/annotations:
>  -s 
> /home/eolivelli/dev/zookeeper/zookeeper-jute/target/generated-sources/annotations
>  -g --release 8 -encoding UTF-8 -Werror -Xlint:deprecation -Xlint:unchecked 
> -Xlint:-options -Xdoclint:-missing -Xpkginfo:always}}
> {{[DEBUG] incrementalBuildHelper#beforeRebuildExecution}}
> {{[INFO] Compiling 36 source files to 
> /home/eolivelli/dev/zookeeper/zookeeper-jute/target/classes}}{quote}
> But -Xdoclint is a valid option.
> h2. Cause
> Without forking, maven runs {{javac}} using 
> {{com.sun.tools.javac.api.JavacTool}}. The module is not loaded.
> h2. Proposed solution
> From the mailing list:
> When running the compiler in noFork mode, use the ToolProvider to run Javac 
> in the same VM on Java9+. This can be implemented using multi-release-jars. 
> See the {{maven-jlink-plugin}} as a reference.
> h2. Related
> [Move Doclint to jdk.javadoc 
> module|https://bugs.openjdk.java.net/browse/JDK-8252712]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to