Skip to content

Commit 422d732

Browse files
authored
Revert java 17 compiler (#18831)
* revert-17 * revert * java-17 * note
1 parent ccade1a commit 422d732

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

.github/workflows/static-checks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ jobs:
121121
- name: (openjdk17) strict compilation
122122
# errorprone requires JDK 11+
123123
# Strict compilation requires more than 2 GB
124-
run: ${MVN} clean -DstrictCompile compile test-compile --fail-at-end ${MAVEN_SKIP} ${MAVEN_SKIP_TESTS} -T1C
124+
# safe to exclude embedded-tests, it's not in distribution
125+
run: ${MVN} clean -DstrictCompile -pl '!embedded-tests' compile test-compile --fail-at-end ${MAVEN_SKIP} ${MAVEN_SKIP_TESTS} -T1C
125126

126127
openrewrite:
127128
runs-on: ubuntu-latest

embedded-tests/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929

3030
<properties>
3131
<surefire.rerunFailingTestsCount>0</surefire.rerunFailingTestsCount>
32+
<!-- Hadoop relies upon JDK 11 language level which breaks when upgraded to anything higher, but we can use 17 in \
33+
embedded-tests, which supports more features such as multiline text block literal delimiter (""") -->
34+
<maven.compiler.release>17</maven.compiler.release>
3235
</properties>
3336

3437
<parent>
@@ -551,6 +554,14 @@
551554

552555
<build>
553556
<plugins>
557+
<plugin>
558+
<groupId>org.apache.maven.plugins</groupId>
559+
<artifactId>maven-compiler-plugin</artifactId>
560+
<version>3.11.0</version>
561+
<configuration>
562+
<release>${maven.compiler.release}</release> <!-- forced for this module -->
563+
</configuration>
564+
</plugin>
554565
<!-- Skip this module from jacoco coverage as it contains only tests -->
555566
<plugin>
556567
<groupId>org.jacoco</groupId>

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@
7070
</scm>
7171

7272
<properties>
73-
<java.version>17</java.version>
73+
<!-- java 11 is no longer supported, but for backward compatibility reasons we plan to stay on 11 until druid37, see https://github.com/apache/druid/pull/18759.
74+
Note for upgrade:
75+
- remove the maven-compiler-plugin in embedded-tests
76+
- remove exclusion of embedded-tests in strict compilation check
77+
-->
78+
<java.version>11</java.version>
7479
<maven.compiler.release>${java.version}</maven.compiler.release>
7580
<project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
7681
<aether.version>0.9.0.M2</aether.version>

0 commit comments

Comments
 (0)