This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j-tools.git


The following commit(s) were added to refs/heads/master by this push:
     new db168bd  Require Java 11 for compilation and add Error Prone
db168bd is described below

commit db168bdb31c4d6962432403b9d942041965e954a
Author: Volkan Yazıcı <[email protected]>
AuthorDate: Mon Dec 12 22:56:17 2022 +0100

    Require Java 11 for compilation and add Error Prone
---
 .github/workflows/build.yml |  8 ++++----
 .java-version               |  2 +-
 .mvn/jvm.config             | 10 ++++++++++
 pom.xml                     | 22 +++++++++++++++++-----
 4 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 430663b..f53890e 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -36,11 +36,11 @@ jobs:
       - name: Checkout repository
         uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8   # 
3.1.0
 
-      - name: Setup JDK 8
+      - name: Setup JDK 11
         uses: actions/setup-java@c3ac5dd0ed8db40fedb61c32fbe677e6b355e94c   # 
3.7.0
         with:
           distribution: temurin
-          java-version: 8
+          java-version: 11
           java-package: jdk
           architecture: x64
           cache: maven
@@ -109,11 +109,11 @@ jobs:
       - name: Checkout repository
         uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8   # 
3.1.0
 
-      - name: Setup JDK 8
+      - name: Setup JDK 11
         uses: actions/setup-java@c3ac5dd0ed8db40fedb61c32fbe677e6b355e94c   # 
3.7.0
         with:
           distribution: temurin
-          java-version: 8
+          java-version: 11
           java-package: jdk
           architecture: x64
           cache: maven
diff --git a/.java-version b/.java-version
index 6259340..b4de394 100644
--- a/.java-version
+++ b/.java-version
@@ -1 +1 @@
-1.8
+11
diff --git a/.mvn/jvm.config b/.mvn/jvm.config
index 2a2667e..6f7d1c8 100644
--- a/.mvn/jvm.config
+++ b/.mvn/jvm.config
@@ -1 +1,11 @@
 -Djava.awt.headless=true
+--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 9fc3e4d..d4b15d8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,12 +55,18 @@
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-    <java.version>1.8</java.version>
+
+    <!-- `minimalJavaBuildVersion` is employed by `org.apache:apache`, which 
is the parent of `org.apache.logging:logging-parent`, which is the parent of us.
+         `minimalJavaBuildVersion` is used for enforcing the compiler version.
+         We will use `java.version` to enforce the target JVM byte code, which 
is 8. -->
+    <minimalJavaBuildVersion>[11,12)</minimalJavaBuildVersion>
+    <java.version>8</java.version>
 
     <!-- `project.build.outputTimestamp` is required for reproducible builds: 
https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
     <project.build.outputTimestamp>0</project.build.outputTimestamp>
 
     <!-- plugin versions -->
+    <error-prone.version>2.16</error-prone.version>
     <flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
 
   </properties>
@@ -72,14 +78,20 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>
-          <source>${java.version}</source>
-          <target>${java.version}</target>
+          <release>${java.version}</release>
           <encoding>${project.build.sourceEncoding}</encoding>
-          <!-- `fork` needs be enabled to make `compilerArgs` take effect -->
-          <fork>true</fork>
           <compilerArgs>
             <arg>-Xlint:all</arg>
+            <arg>-XDcompilePolicy=simple</arg>
+            <arg>-Xplugin:ErrorProne</arg>
           </compilerArgs>
+          <annotationProcessorPaths>
+            <path>
+              <groupId>com.google.errorprone</groupId>
+              <artifactId>error_prone_core</artifactId>
+              <version>${error-prone.version}</version>
+            </path>
+          </annotationProcessorPaths>
         </configuration>
       </plugin>
 

Reply via email to