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

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 8f610da91f HDDS-11076. NoSuchMethodError: ByteBuffer.position 
compiling with Java 9+, running with Java 8 (#6897)
8f610da91f is described below

commit 8f610da91f32ec9e8a124b6cbd211407f0290ca3
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Mon Jul 8 08:23:06 2024 +0200

    HDDS-11076. NoSuchMethodError: ByteBuffer.position compiling with Java 9+, 
running with Java 8 (#6897)
---
 pom.xml | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0efcd67743..ec059503dc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -230,7 +230,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xs
     <weld-servlet.version>3.1.9.Final</weld-servlet.version>
 
     <!-- define the Java language version used by the compiler -->
-    <javac.version>1.8</javac.version>
+    <javac.version>8</javac.version>
 
     <!-- The java version enforced by the maven enforcer -->
     <!-- more complex patterns can be used here, such as
@@ -1322,8 +1322,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xs
           <artifactId>maven-compiler-plugin</artifactId>
           <version>${maven-compiler-plugin.version}</version>
           <configuration>
-            <source>${javac.version}</source>
-            <target>${javac.version}</target>
             <useIncrementalCompilation>false</useIncrementalCompilation>
           </configuration>
         </plugin>
@@ -1968,6 +1966,28 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xs
         </plugins>
       </build>
     </profile>
+
+    <!-- Profiles for specific JDK versions -->
+    <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>go-offline</id>
       <properties>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to