From f6280f7003d678c45fdf08466ea5d9ce3d61d99c Mon Sep 17 00:00:00 2001 From: aggarwalShivani Date: Thu, 16 Jan 2025 19:42:52 +0530 Subject: [PATCH] Set cross-cluster-replication plugin 3.0.0 baseline JDK version to JDK-21 Signed-off-by: aggarwalShivani --- .github/workflows/build-and-test.yml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/bwc.yml | 4 ++-- README.md | 2 +- build.gradle | 10 +++++++--- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f429d0c12..1483bd029 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 95e0b2201..c77a52f13 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 4cce518e0..85d9ade71 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 b2c537ef1..c6a9afb02 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 948028345..715d432d5 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'] } }