Skip to content

Commit

Permalink
Drop support for Java 8 (#10518)
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi authored Aug 2, 2024
1 parent 6e7113a commit 9a67f0b
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/delta-conversion-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17, 21]
jvm: [11, 17, 21]
env:
SPARK_LOCAL_IP: localhost
steps:
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17, 21]
jvm: [11, 17, 21]
env:
SPARK_LOCAL_IP: localhost
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flink-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17, 21]
jvm: [11, 17, 21]
flink: ['1.17', '1.18', '1.19']
exclude:
# Flink 1.17 does not support Java 17.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hive-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17, 21]
jvm: [11, 17, 21]
env:
SPARK_LOCAL_IP: localhost
steps:
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17, 21]
jvm: [11, 17, 21]
env:
SPARK_LOCAL_IP: localhost
steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/java-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17, 21]
jvm: [11, 17, 21]
env:
SPARK_LOCAL_IP: localhost
steps:
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17, 21]
jvm: [11, 17, 21]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand All @@ -107,7 +107,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17, 21]
jvm: [11, 17, 21]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 8
java-version: 11
- run: |
./gradlew printVersion
./gradlew -DallModules publishApachePublicationToMavenRepository -PmavenUser=${{ secrets.NEXUS_USER }} -PmavenPassword=${{ secrets.NEXUS_PW }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spark-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17, 21]
jvm: [11, 17, 21]
spark: ['3.3', '3.4', '3.5']
scala: ['2.12', '2.13']
exclude:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Community discussions happen primarily on the [dev mailing list][dev-list] or on

### Building

Iceberg is built using Gradle with Java 8, 11, 17, or 21.
Iceberg is built using Gradle with Java 11, 17, or 21.

* To invoke a build and run tests: `./gradlew build`
* To skip tests: `./gradlew build -x test -x integrationTest`
Expand Down
52 changes: 18 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ try {
project.logger.error(e.getMessage())
}

if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
project.ext.jdkVersion = '8'
project.ext.extraJvmArgs = []
} else if (JavaVersion.current() == JavaVersion.VERSION_11) {
if (JavaVersion.current() == JavaVersion.VERSION_11) {
project.ext.jdkVersion = '11'
project.ext.extraJvmArgs = []
} else if (JavaVersion.current() == JavaVersion.VERSION_17 || JavaVersion.current() == JavaVersion.VERSION_21) {
Expand All @@ -86,7 +83,7 @@ if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
"--add-opens", "java.base/sun.security.action=ALL-UNNAMED",
"--add-opens", "java.base/sun.util.calendar=ALL-UNNAMED"]
} else {
throw new GradleException("This build must be run with JDK 8 or 11 or 17 or 21 but was executed with JDK " + JavaVersion.current())
throw new GradleException("This build must be run with JDK 11 or 17 or 21 but was executed with JDK " + JavaVersion.current())
}

tasks.withType(AbstractArchiveTask).configureEach {
Expand Down Expand Up @@ -887,23 +884,12 @@ project(':iceberg-pig') {
}

project(':iceberg-nessie') {
if (JavaVersion.current().isJava11Compatible()) {
test {
useJUnitPlatform()
}
compileTestJava {
sourceCompatibility = "11"
targetCompatibility = "11"
}
} else {
// Do not test Nessie against Java 8, because in-JVM testing requires Nessie server components,
// which require Java 11+.
test {
enabled = false
}
compileTestJava {
enabled = false
}
test {
useJUnitPlatform()
}
compileTestJava {
sourceCompatibility = "11"
targetCompatibility = "11"
}

dependencies {
Expand All @@ -922,21 +908,19 @@ project(':iceberg-nessie') {
// Only there to prevent "warning: unknown enum constant SchemaType.OBJECT" compile messages
compileOnly libs.microprofile.openapi.api

if (JavaVersion.current().isJava11Compatible()) {
testImplementation libs.nessie.jaxrs.testextension
testImplementation libs.nessie.versioned.storage.inmemory.tests
testImplementation libs.nessie.versioned.storage.testextension
// Need to "pull in" el-api explicitly :(
testImplementation libs.jakarta.el.api
testImplementation libs.nessie.jaxrs.testextension
testImplementation libs.nessie.versioned.storage.inmemory.tests
testImplementation libs.nessie.versioned.storage.testextension
// Need to "pull in" el-api explicitly :(
testImplementation libs.jakarta.el.api

testImplementation libs.avro.avro
testImplementation libs.avro.avro

testImplementation project(path: ':iceberg-api', configuration: 'testArtifacts')
testImplementation project(path: ':iceberg-core', configuration: 'testArtifacts')
testImplementation project(path: ':iceberg-api', configuration: 'testArtifacts')
testImplementation project(path: ':iceberg-core', configuration: 'testArtifacts')

// Only there to prevent "warning: unknown enum constant SchemaType.OBJECT" compile messages
testCompileOnly libs.microprofile.openapi.api
}
// Only there to prevent "warning: unknown enum constant SchemaType.OBJECT" compile messages
testCompileOnly libs.microprofile.openapi.api
}
}

Expand Down
4 changes: 2 additions & 2 deletions deploy.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/

if (project.hasProperty('release') && jdkVersion != '8') {
throw new GradleException("Releases must be built with Java 8")
if (project.hasProperty('release') && jdkVersion != '11') {
throw new GradleException("Releases must be built with Java 11")
}

subprojects {
Expand Down
2 changes: 1 addition & 1 deletion hive-runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ project(':iceberg-hive-runtime') {

dependencies {
implementation project(':iceberg-mr')
if (jdkVersion == '8' && hiveVersions.contains("3")) {
if (hiveVersions.contains("3")) {
implementation project(':iceberg-hive3')
}
implementation(project(':iceberg-nessie')) {
Expand Down
4 changes: 2 additions & 2 deletions jmh.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/

if (jdkVersion != '8' && jdkVersion != '11' && jdkVersion != '17' && jdkVersion != '21') {
throw new GradleException("The JMH benchmarks must be run with JDK 8 or JDK 11 or JDK 17 or JDK 21")
if (jdkVersion != '11' && jdkVersion != '17' && jdkVersion != '21') {
throw new GradleException("The JMH benchmarks must be run with JDK 11 or JDK 17 or JDK 21")
}

def flinkVersions = (System.getProperty("flinkVersions") != null ? System.getProperty("flinkVersions") : System.getProperty("defaultFlinkVersions")).split(",")
Expand Down
2 changes: 1 addition & 1 deletion site/docs/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ settle disagreements or to force a decision.

## Building the Project Locally

Iceberg is built using Gradle with Java 8, 11, 17, or 21.
Iceberg is built using Gradle with Java 11, 17, or 21.

* To invoke a build and run tests: `./gradlew build`
* To skip tests: `./gradlew build -x test -x integrationTest`
Expand Down
8 changes: 3 additions & 5 deletions tasks.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ task aggregateJavadoc(type: Javadoc) {

doLast {
// Fix bug with search
if (JavaVersion.current() >= JavaVersion.VERSION_11) {
// Append the fix to the file
def searchScript = new File("site/docs/javadoc/${getJavadocVersion()}" + '/search.js')
searchScript.append JAVADOC_FIX_SEARCH_STR
}
// Append the fix to the file
def searchScript = new File("site/docs/javadoc/${getJavadocVersion()}" + '/search.js')
searchScript.append JAVADOC_FIX_SEARCH_STR
}
}

Expand Down

0 comments on commit 9a67f0b

Please sign in to comment.