Skip to content

Commit 5118f23

Browse files
committed
HDDS-11076. NoSuchMethodError: ByteBuffer.position compiling with Java 9+, running with Java 8 (#6897)
(cherry picked from commit 8f610da)
1 parent cc95ee3 commit 5118f23

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

pom.xml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
230230
<weld-servlet.version>3.1.9.Final</weld-servlet.version>
231231

232232
<!-- define the Java language version used by the compiler -->
233-
<javac.version>1.8</javac.version>
233+
<javac.version>8</javac.version>
234234

235235
<!-- The java version enforced by the maven enforcer -->
236236
<!-- more complex patterns can be used here, such as
@@ -1296,8 +1296,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
12961296
<artifactId>maven-compiler-plugin</artifactId>
12971297
<version>${maven-compiler-plugin.version}</version>
12981298
<configuration>
1299-
<source>${javac.version}</source>
1300-
<target>${javac.version}</target>
13011299
<useIncrementalCompilation>false</useIncrementalCompilation>
13021300
</configuration>
13031301
</plugin>
@@ -1963,6 +1961,28 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
19631961
</plugins>
19641962
</build>
19651963
</profile>
1964+
1965+
<!-- Profiles for specific JDK versions -->
1966+
<profile>
1967+
<id>java8</id>
1968+
<activation>
1969+
<jdk>[,8]</jdk>
1970+
</activation>
1971+
<properties>
1972+
<maven.compiler.source>${javac.version}</maven.compiler.source>
1973+
<maven.compiler.target>${javac.version}</maven.compiler.target>
1974+
</properties>
1975+
</profile>
1976+
<profile>
1977+
<id>java9-or-later</id>
1978+
<activation>
1979+
<jdk>[9,]</jdk>
1980+
</activation>
1981+
<properties>
1982+
<maven.compiler.release>${javac.version}</maven.compiler.release> <!-- supported since Java 9 -->
1983+
</properties>
1984+
</profile>
1985+
19661986
<profile>
19671987
<id>go-offline</id>
19681988
<properties>

0 commit comments

Comments
 (0)