Skip to content

Commit 20255e3

Browse files
authored
Set ml-commons plugin 3.0.0 baseline JDK version to JDK-21 (opensearch-project#2583)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
1 parent 2b953cd commit 20255e3

File tree

12 files changed

+44
-21
lines changed

12 files changed

+44
-21
lines changed

.github/workflows/CI-workflow.yml

+5
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ jobs:
101101
role-to-assume: ${{ secrets.ML_ROLE }}
102102
aws-region: us-west-2
103103

104+
- name: Setup Java ${{ matrix.java }}
105+
uses: actions/setup-java@v1
106+
with:
107+
java-version: ${{ matrix.java }}
108+
104109
- name: Checkout MLCommons
105110
uses: actions/checkout@v3
106111
with:

build.gradle

+14-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ buildscript {
1111
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
1212
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
1313
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
14+
asm_version = "9.7"
1415

1516
// 2.0.0-rc1-SNAPSHOT -> 2.0.0.0-rc1-SNAPSHOT
1617
version_tokens = opensearch_version.tokenize('-')
@@ -43,6 +44,16 @@ buildscript {
4344
}
4445
}
4546
}
47+
48+
configurations {
49+
classpath {
50+
resolutionStrategy {
51+
//in order to handle jackson's higher release version in shadow, this needs to be upgraded to latest
52+
force(group: "org.ow2.asm", name: "asm", version: asm_version)
53+
force(group: "org.ow2.asm", name: "asm-commons", version: asm_version)
54+
}
55+
}
56+
}
4657
}
4758

4859
plugins {
@@ -61,8 +72,10 @@ allprojects {
6172
apply from: "$rootDir/build-tools/repositories.gradle"
6273

6374
plugins.withId('java') {
64-
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11
75+
sourceCompatibility = JavaVersion.VERSION_21;
76+
targetCompatibility = JavaVersion.VERSION_21;
6577
}
78+
6679
plugins.withId('jacoco') {
6780
jacoco.toolVersion = '0.8.10'
6881
}

client/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ plugins {
77
id 'java'
88
id "io.freefair.lombok"
99
id 'jacoco'
10-
id 'com.github.johnrengelman.shadow'
10+
id 'io.github.goooler.shadow' version "8.1.7"
1111
id 'maven-publish'
12-
id 'com.diffplug.spotless' version '6.23.0'
12+
id 'com.diffplug.spotless' version '6.25.0'
1313
id 'signing'
1414
}
1515

common/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//TODO: cleanup gradle config file, some overlap
77
plugins {
88
id 'java'
9-
id 'com.github.johnrengelman.shadow'
9+
id 'io.github.goooler.shadow' version "8.1.7"
1010
id 'jacoco'
1111
id "io.freefair.lombok"
1212
id 'maven-publish'

gradle/wrapper/gradle-wrapper.jar

-19.8 KB
Binary file not shown.
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
3+
distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
55
networkTimeout=10000
66
zipStoreBase=GRADLE_USER_HOME
77
zipStorePath=wrapper/dists

gradlew.bat

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
4343
%JAVA_EXE% -version >NUL 2>&1
4444
if %ERRORLEVEL% equ 0 goto execute
4545

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5151

5252
goto fail
5353

@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5757

5858
if exist "%JAVA_EXE%" goto execute
5959

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6565

6666
goto fail
6767

memory/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ plugins {
2020
id 'java'
2121
id 'jacoco'
2222
id "io.freefair.lombok"
23-
id 'com.diffplug.spotless' version '6.23.0'
23+
id 'com.diffplug.spotless' version '6.25.0'
2424
}
2525

2626
dependencies {

ml-algorithms/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
id 'java'
1010
id 'jacoco'
1111
id "io.freefair.lombok"
12-
id 'com.diffplug.spotless' version '6.23.0'
12+
id 'com.diffplug.spotless' version '6.25.0'
1313
}
1414

1515
repositories {

plugin/build.gradle

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plugins {
1313
id "io.freefair.lombok"
1414
id 'jacoco'
1515
id 'java-library'
16-
id 'com.diffplug.spotless' version '6.23.0'
16+
id 'com.diffplug.spotless' version '6.25.0'
1717
}
1818

1919
ext {
@@ -30,6 +30,11 @@ ext {
3030
noticeFile = rootProject.file('NOTICE')
3131
}
3232

33+
java {
34+
targetCompatibility = JavaVersion.VERSION_21
35+
sourceCompatibility = JavaVersion.VERSION_21
36+
}
37+
3338
lombok {
3439
version = "1.18.30"
3540
}

search-processors/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ plugins {
1919
id 'java'
2020
id 'jacoco'
2121
id "io.freefair.lombok"
22-
id 'com.diffplug.spotless' version '6.23.0'
22+
id 'com.diffplug.spotless' version '6.25.0'
2323
}
2424

2525
repositories {

spi/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin
77
import org.opensearch.gradle.test.RestIntegTestTask
88

99
plugins {
10-
id 'com.github.johnrengelman.shadow'
10+
id 'io.github.goooler.shadow' version "8.1.7"
1111
id 'jacoco'
1212
id 'maven-publish'
1313
id 'signing'

0 commit comments

Comments
 (0)