From f867ff6982fc997b8aae3f52f09303595d1f90c1 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Wed, 9 Oct 2024 10:54:18 -0400 Subject: [PATCH] Set alerting plugin 3.0.0 baseline JDK version to JDK-21 Signed-off-by: Andriy Redko --- .github/workflows/bwc-test-workflow.yml | 2 +- .github/workflows/maven-publish.yml | 2 +- .../workflows/multi-node-test-workflow.yml | 2 +- .github/workflows/security-test-workflow.yml | 2 +- .github/workflows/test-workflow.yml | 4 ++-- DEVELOPER_GUIDE.md | 23 ++++++++----------- build.gradle | 8 ++++--- 7 files changed, 20 insertions(+), 23 deletions(-) diff --git a/.github/workflows/bwc-test-workflow.yml b/.github/workflows/bwc-test-workflow.yml index bf8e8ff7c..6707987c3 100644 --- a/.github/workflows/bwc-test-workflow.yml +++ b/.github/workflows/bwc-test-workflow.yml @@ -19,7 +19,7 @@ jobs: needs: Get-CI-Image-Tag strategy: matrix: - java: [ 11 ] + java: [ 21 ] # Job name name: Build and test Alerting # This job runs on Linux diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 75f22834a..e822e15cb 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - jdk: [17] + jdk: [21] platform: ["ubuntu-latest"] if: github.repository == 'opensearch-project/alerting' runs-on: ${{ matrix.platform }} diff --git a/.github/workflows/multi-node-test-workflow.yml b/.github/workflows/multi-node-test-workflow.yml index 7944f43db..7baa62806 100644 --- a/.github/workflows/multi-node-test-workflow.yml +++ b/.github/workflows/multi-node-test-workflow.yml @@ -20,7 +20,7 @@ jobs: needs: Get-CI-Image-Tag strategy: matrix: - java: [ 11, 17 ] + java: [ 21 ] # Job name name: Build and test Alerting # This job runs on Linux diff --git a/.github/workflows/security-test-workflow.yml b/.github/workflows/security-test-workflow.yml index 5ca093c4e..fd40a62e9 100644 --- a/.github/workflows/security-test-workflow.yml +++ b/.github/workflows/security-test-workflow.yml @@ -12,7 +12,7 @@ jobs: build: strategy: matrix: - java: [ 11, 17, 21 ] + java: [ 21 ] # Job name name: Build and test Alerting # This job runs on Linux diff --git a/.github/workflows/test-workflow.yml b/.github/workflows/test-workflow.yml index 626c44565..aabd8b49c 100644 --- a/.github/workflows/test-workflow.yml +++ b/.github/workflows/test-workflow.yml @@ -23,7 +23,7 @@ jobs: WORKING_DIR: ${{ matrix.working_directory }}. strategy: matrix: - java: [11, 17, 21] + java: [21] # Job name name: Build Alerting with JDK ${{ matrix.java }} on Linux # This job runs on Linux @@ -71,7 +71,7 @@ jobs: WORKING_DIR: ${{ matrix.working_directory }}. strategy: matrix: - java: [11, 17, 21] + java: [21] os: [ windows-latest, macos-latest ] include: - os: windows-latest diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index 38bb99af3..1bbf9e245 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -1,8 +1,7 @@ - [Developer Guide](#developer-guide) - [Forking and Cloning](#forking-and-cloning) - [Install Prerequisites](#install-prerequisites) - - [JDK 11](#jdk-11) - - [JDK 14](#jdk-14) + - [JDK 21](#jdk-21) - [Setup](#setup) - [Build](#build) - [Building from the command line](#building-from-the-command-line) @@ -19,32 +18,28 @@ Fork this repository on GitHub, and clone locally with `git clone`. ### Install Prerequisites -#### JDK 11 +#### JDK 21 -OpenSearch builds using Java 11 at a minimum, using the Adoptium distribution. This means you must have a JDK 11 installed with the environment variable `JAVA_HOME` referencing the path to Java home for your JDK 11 installation, e.g. `JAVA_HOME=/usr/lib/jvm/jdk-11`. This is configured in [buildSrc/build.gradle](buildSrc/build.gradle) and [distribution/tools/java-version-checker/build.gradle](distribution/tools/java-version-checker/build.gradle). +OpenSearch builds using Java 21 at a minimum, using the Adoptium distribution. This means you must have a JDK 21 installed with the environment variable `JAVA_HOME` referencing the path to Java home for your JDK 21 installation, e.g. `JAVA_HOME=/usr/lib/jvm/jdk-11`. This is configured in [buildSrc/build.gradle](buildSrc/build.gradle) and [distribution/tools/java-version-checker/build.gradle](distribution/tools/java-version-checker/build.gradle). ``` allprojects { - targetCompatibility = JavaVersion.VERSION_11 - sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_21 + sourceCompatibility = JavaVersion.VERSION_21 } ``` ``` -sourceCompatibility = JavaVersion.VERSION_11 -targetCompatibility = JavaVersion.VERSION_11 +sourceCompatibility = JavaVersion.VERSION_21 +targetCompatibility = JavaVersion.VERSION_21 ``` -Download Java 11 from [here](https://adoptium.net/releases.html?variant=openjdk11). - -#### JDK 14 - -To run the full suite of tests, download and install [JDK 14](https://jdk.java.net/archive/) and set `JAVA11_HOME`, and `JAVA14_HOME`. They are required by the [backwards compatibility test](./TESTING.md#testing-backwards-compatibility). +Download Java 21 from [here](https://adoptium.net/releases.html?variant=openjdk21). ### Setup 1. Clone the repository (see [Forking and Cloning](#forking-and-cloning)) -2. Make sure `JAVA_HOME` is pointing to a Java 11 JDK (see [Install Prerequisites](#install-prerequisites)) +2. Make sure `JAVA_HOME` is pointing to a Java 21 JDK (see [Install Prerequisites](#install-prerequisites)) 3. Launch Intellij IDEA, Choose Import Project and select the settings.gradle file in the root of this package. ### Build diff --git a/build.gradle b/build.gradle index 54c316d5c..6ae02b3d1 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ buildscript { } opensearch_no_snapshot = opensearch_version.replace("-SNAPSHOT","") common_utils_version = System.getProperty("common_utils.version", opensearch_build) - kotlin_version = '1.8.21' + kotlin_version = '1.9.25' } repositories { @@ -87,10 +87,12 @@ allprojects { apply from: "$rootDir/build-tools/repositories.gradle" plugins.withId('java') { - sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21 } plugins.withId('org.jetbrains.kotlin.jvm') { - compileKotlin.kotlinOptions.jvmTarget = compileTestKotlin.kotlinOptions.jvmTarget = JavaVersion.VERSION_11 + compileJava.sourceCompatibility = compileTestJava.sourceCompatibility = JavaVersion.VERSION_21 + compileJava.targetCompatibility = compileTestJava.targetCompatibility = JavaVersion.VERSION_21 + compileKotlin.kotlinOptions.jvmTarget = compileTestKotlin.kotlinOptions.jvmTarget = JavaVersion.VERSION_21 compileKotlin.dependsOn ktlint } tasks.withType(AbstractArchiveTask).configureEach {