diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f429d0c1..1483bd02 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -18,7 +18,7 @@ jobs: build-test-linux: strategy: matrix: - java: [11, 17] + java: [21] name: Build CCR Plugin on Linux using Container Image runs-on: ubuntu-latest diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95e0b220..c77a52f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: java: - - 17 + - 21 os: - windows-latest - macos-latest diff --git a/.github/workflows/bwc.yml b/.github/workflows/bwc.yml index 4cce518e..85d9ade7 100644 --- a/.github/workflows/bwc.yml +++ b/.github/workflows/bwc.yml @@ -15,10 +15,10 @@ jobs: runs-on: ubuntu-latest steps: # This step uses the setup-java Github action: https://github.com/actions/setup-java - - name: Set Up JDK 11 + - name: Set Up JDK 21 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 21 # This step uses the checkout Github action: https://github.com/actions/checkout - name: Checkout Branch uses: actions/checkout@v4 diff --git a/README.md b/README.md index b2c537ef..c6a9afb0 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ The replication machinery is implemented as an OpenSearch plugin that exposes AP The project in this package uses the [Gradle](https://docs.gradle.org/current/userguide/userguide.html) build system. Gradle comes with excellent documentation that should be your first stop when trying to figure out how to operate or modify the build. ### Building from the command line -Set JAVA_HOME to JDK-11 or above +Set JAVA_HOME to JDK-21 or above 1. `./gradlew build` builds and tests project. 2. `./gradlew clean release` cleans previous builds, creates new build and tests project. diff --git a/build.gradle b/build.gradle index 94802834..715d432d 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ buildscript { plugin_previous_version = opensearch_previous_version.replaceAll(/(\.\d)([^\d]*)$/, '$1.0$2') common_utils_version = System.getProperty("common_utils.version", opensearch_build) - kotlin_version = System.getProperty("kotlin.version", "1.8.21") + kotlin_version = System.getProperty("kotlin.version", "1.9.25") security_plugin_version = opensearch_build if (!isSnapshot) { @@ -89,6 +89,10 @@ plugins { allprojects { group = "org.opensearch" version = "${opensearch_build}" + plugins.withId('org.jetbrains.kotlin.jvm') { + compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaVersion.VERSION_21 + compileTestJava.sourceCompatibility = compileTestJava.targetCompatibility = JavaVersion.VERSION_21 + } } apply plugin: 'java' @@ -165,14 +169,14 @@ repositories { compileKotlin { kotlinOptions { - jvmTarget = "11" + jvmTarget = "21" freeCompilerArgs = ['-Xjsr305=strict'] // Handle OpenSearch @Nullable annotation correctly } } compileTestKotlin { kotlinOptions { - jvmTarget = "11" + jvmTarget = "21" freeCompilerArgs = ['-Xjsr305=strict'] } }