-J-Xbootclasspath/p: is not passed by maven compiler plugin,how can I workaround it?
System enviroment: jdk 1.8.0_265,windows 10.
maven file: I copied it from CheckerFramework example pom.xml.
<compilerArgs>
<!-- using github.com/google/error-prone-javac is required when running on JDK 8 -->
<arg>-J-Xbootclasspath/p:${errorProneJavac}</arg>
<!-- -Awarns treats Checker Framework errors as warnings -->
<!-- <arg>-Awarns</arg> -->
<!--
For the Subtyping Checker, annotations defined in module 'your-qual-artifact':
<arg>-Aquals=myPackage.qual.MyFenum,myPackage.qual.MyCustomType</arg>
-->
<arg>-Alint</arg>
<!-- If using JDK 11 remove the two arguments above and uncomment the one below. -->
<!-- <arg>-J- -add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> -->
<!-- -Awarns turns type-checking errors into warnings. -->
<!-- <arg>-Awarns</arg> -->
</compilerArgs>
When I first run it by mvn clean compile,it fall with
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project MavenExample: Compilation failure
So I run mvn clean compile -X then found that -J-Xbootclasspath/p:/path/to/javac.jar not included in the command line option.
Then I tred include "-J-Xbootclasspath/p" in and mannualy javac compile it and it successed. But I need use it in maven,so I ask the question.
this is the printed failed command line option
[DEBUG]
-d D:\workproject\TestCheck\target\classes
-classpath D:\workproject\TestCheck\target\classes;C:\Users\张云.m2\repository\org\checkerframework\checker-qual\3.6.1\checker-qual-3.6.1.jar;C:\Users\张云.m2\repository\com\google\errorprone\javac\9+181-r4173-1\javac-9+181-r4173-1.jar;C:\Users\张云.m2\repository\org\apache\commons\commons-lang3\3.1\commons-lang3-3.1.jar;C:\Users\张云.m2\repository\javax\servlet\servlet-api\2.4\servlet-api-2.4.jar;
-sourcepath D:\workproject\TestCheck\src\main\java;D:\workproject\TestCheck\target\generated-sources\annotations; D:\workproject\TestCheck\src\main\java\Main.java -s D:\workproject\TestCheck\target\generated-sources\annotations
-processor org.checkerframework.checker.nullness.NullnessChecker
-processorpath C:\Users\张云.m2\repository\org\checkerframework\checker\3.6.1\checker-3.6.1.jar; -g -verbose -target 1.8 -source 1.8 -encoding UTF-8 -Alint
this is the complete log file log
and project file
pom.xml
file you are using (not just a snippet of it), so that others can reproduce the problem. – mernst