From 2f7be29a30802b09e49b78287a1574aaa79b875a Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Tue, 7 Mar 2023 22:39:05 +0100 Subject: [PATCH] Specify Error Prone JVM args with `.mvn/jvm.config` (#2339) * Specify Error Prone JVM args with `.mvn/jvm.config` This allows avoiding fork mode for compilation, which: - might slightly reduce compilation time - guarantees that all compiler diagnostics are properly reported * Combine enforcer executions --- .mvn/jvm.config | 10 ++++++++++ pom.xml | 20 +++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 .mvn/jvm.config diff --git a/.mvn/jvm.config b/.mvn/jvm.config new file mode 100644 index 00000000..3ed5dea4 --- /dev/null +++ b/.mvn/jvm.config @@ -0,0 +1,10 @@ +--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED +--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED +--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED diff --git a/pom.xml b/pom.xml index bf69db0f..a8cd0716 100644 --- a/pom.xml +++ b/pom.xml @@ -104,14 +104,19 @@ maven-enforcer-plugin 3.2.1 - - enforce-jdk-version + enforce-versions enforce + + + [3.3.1,) + + + [11,) @@ -133,21 +138,10 @@ true true true - true -XDcompilePolicy=simple -Xplugin:ErrorProne -XepExcludedPaths:.*/generated-test-sources/protobuf/.* - -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED - -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED - -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED - -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED -Xlint:all,-options