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

szetszwo pushed a commit to branch branch-3.1.1_review
in repository https://gitbox.apache.org/repos/asf/ratis.git

commit 76fb1a316af4d717a35b8fe7feeb2eefbb1bfc71
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Mon Jul 1 07:41:26 2024 +0200

    RATIS-2121. Set javac --release when compiling with JDK 9+ (#1119)
---
 pom.xml | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2b61bf3d0..e52c34267 100644
--- a/pom.xml
+++ b/pom.xml
@@ -204,7 +204,7 @@
     <shell-executable>bash</shell-executable>
 
     <!-- define the Java language version used by the compiler -->
-    <javac.version>1.8</javac.version>
+    <javac.version>8</javac.version>
     <java.min.version>${javac.version}</java.min.version>
     <maven.min.version>3.3.9</maven.min.version>
 
@@ -522,6 +522,7 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-enforcer-plugin</artifactId>
+          <version>3.2.1</version>
           <configuration>
             <rules>
               <requireMavenVersion>
@@ -574,8 +575,6 @@
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-compiler-plugin</artifactId>
           <configuration>
-            <source>${javac.version}</source>
-            <target>${javac.version}</target>
             <fork>true</fork>
             <meminitial>512m</meminitial>
             <maxmem>2048m</maxmem>
@@ -874,6 +873,25 @@
   </build>
 
   <profiles>
+    <profile>
+      <id>java8</id>
+      <activation>
+        <jdk>[,8]</jdk>
+      </activation>
+      <properties>
+        <maven.compiler.source>${javac.version}</maven.compiler.source>
+        <maven.compiler.target>${javac.version}</maven.compiler.target>
+      </properties>
+    </profile>
+    <profile>
+      <id>java9-or-later</id>
+      <activation>
+        <jdk>[9,]</jdk>
+      </activation>
+      <properties>
+        <maven.compiler.release>${javac.version}</maven.compiler.release> <!-- 
supported since Java 9 -->
+      </properties>
+    </profile>
     <profile>
       <id>experiments-build</id>
       <activation>

Reply via email to