Skip to content

Commit d6daaee

Browse files
authored
Upgrade to gradle 9.2 and run CI with JDK 25 (#5786)
Signed-off-by: Craig Perkins <[email protected]>
1 parent 2b0b41c commit d6daaee

File tree

10 files changed

+148
-138
lines changed

10 files changed

+148
-138
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
matrix:
4646
gradle_task: ${{ fromJson(needs.generate-test-list.outputs.separateTestsNames) }}
4747
platform: [windows-latest]
48-
jdk: [21, 24]
48+
jdk: [21, 25]
4949
runs-on: ${{ matrix.platform }}
5050

5151
steps:
@@ -80,7 +80,7 @@ jobs:
8080
matrix:
8181
gradle_task: ${{ fromJson(needs.generate-test-list.outputs.separateTestsNames) }}
8282
platform: [ubuntu-latest]
83-
jdk: [21, 24]
83+
jdk: [21, 25]
8484
runs-on: ubuntu-latest
8585
container:
8686
# using the same image which is used by opensearch-build to build the OpenSearch Distribution
@@ -144,7 +144,7 @@ jobs:
144144
strategy:
145145
fail-fast: false
146146
matrix:
147-
jdk: [21, 24]
147+
jdk: [21, 25]
148148
platform: [windows-latest]
149149
runs-on: ${{ matrix.platform }}
150150

@@ -178,7 +178,7 @@ jobs:
178178
strategy:
179179
fail-fast: false
180180
matrix:
181-
jdk: [21, 24]
181+
jdk: [21, 25]
182182
platform: [ubuntu-latest]
183183
runs-on: ubuntu-latest
184184
container:
@@ -221,7 +221,7 @@ jobs:
221221
strategy:
222222
fail-fast: false
223223
matrix:
224-
jdk: [21,24]
224+
jdk: [21, 25]
225225
platform: [ubuntu-latest]
226226
runs-on: ${{ matrix.platform }}
227227
container:
@@ -262,7 +262,7 @@ jobs:
262262
strategy:
263263
fail-fast: false
264264
matrix:
265-
jdk: [21, 24]
265+
jdk: [21, 25]
266266
platform: [windows-latest]
267267
runs-on: ${{ matrix.platform }}
268268

@@ -295,7 +295,7 @@ jobs:
295295
strategy:
296296
fail-fast: false
297297
matrix:
298-
jdk: [21, 24]
298+
jdk: [21, 25]
299299
platform: [ubuntu-latest]
300300
runs-on: ${{ matrix.platform }}
301301

@@ -338,7 +338,7 @@ jobs:
338338
strategy:
339339
fail-fast: false
340340
matrix:
341-
jdk: [11, 17]
341+
jdk: [21]
342342
platform: [ubuntu-latest, windows-latest]
343343
runs-on: ${{ matrix.platform }}
344344

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
jdk: [21, 24]
14+
jdk: [21, 25]
1515
test-run: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
1616

1717
steps:

.github/workflows/plugin_install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
os: [ubuntu-latest, windows-latest]
15-
jdk: [21, 24]
15+
jdk: [21, 25]
1616
runs-on: ${{ matrix.os }}
1717

1818
steps:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5959
- Bump `org.apache.ws.xmlschema:xmlschema-core` from 2.3.1 to 2.3.2 ([#5781](https://github.com/opensearch-project/security/pull/5781))
6060
- Bump `commons-io:commons-io` from 2.20.0 to 2.21.0 ([#5780](https://github.com/opensearch-project/security/pull/5780))
6161
- Bump `com.nimbusds:nimbus-jose-jwt` from 10.5 to 10.6 ([#5782](https://github.com/opensearch-project/security/pull/5782))
62+
- Upgrade to gradle 9.2 and run CI with JDK 25 ([#5786](https://github.com/opensearch-project/security/pull/5786))
6263

6364
### Documentation
6465

build.gradle

Lines changed: 97 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,29 @@ bundlePlugin {
449449
}
450450
}
451451

452+
//create source set 'integrationTest'
453+
//add classes from the main source set to the compilation and runtime classpaths of the integrationTest
454+
sourceSets {
455+
integrationTest {
456+
java {
457+
srcDir file ('src/integrationTest/java')
458+
compileClasspath += sourceSets.main.output
459+
runtimeClasspath += sourceSets.main.output
460+
}
461+
resources {
462+
srcDir file('src/integrationTest/resources')
463+
}
464+
processIntegrationTestResources {
465+
duplicatesStrategy(DuplicatesStrategy.INCLUDE)
466+
}
467+
}
468+
}
469+
470+
configurations {
471+
integrationTestImplementation.extendsFrom implementation
472+
integrationTestRuntimeOnly.extendsFrom runtimeOnly
473+
}
474+
452475
configurations {
453476
all {
454477
resolutionStrategy {
@@ -497,9 +520,24 @@ configurations {
497520
force "com.google.guava:failureaccess:1.0.3"
498521
}
499522
}
523+
}
500524

501-
integrationTestImplementation.extendsFrom implementation
502-
integrationTestRuntimeOnly.extendsFrom runtimeOnly
525+
subprojects {
526+
plugins.withId('java') {
527+
dependencies {
528+
testImplementation 'org.hamcrest:hamcrest:2.2'
529+
testImplementation 'junit:junit:4.13.2'
530+
testImplementation "org.opensearch:opensearch:${opensearch_version}"
531+
testImplementation "org.mockito:mockito-core:5.20.0"
532+
}
533+
534+
afterEvaluate {
535+
if (project.configurations.findByName('integrationTestImplementation')) {
536+
configurations.integrationTestImplementation.extendsFrom configurations.implementation
537+
configurations.integrationTestRuntimeOnly.extendsFrom configurations.runtimeOnly
538+
}
539+
}
540+
}
503541
}
504542

505543
allprojects {
@@ -513,87 +551,62 @@ allprojects {
513551
maven { url "build.shibboleth.net/maven/releases"}
514552
}
515553

516-
configurations {
517-
integrationTestImplementation.extendsFrom implementation
518-
compile.extendsFrom compileOnly
519-
compile.extendsFrom testImplementation
520-
}
521-
dependencies {
522-
// unit test framework
523-
testImplementation 'org.hamcrest:hamcrest:2.2'
524-
testImplementation 'junit:junit:4.13.2'
525-
testImplementation "org.opensearch:opensearch:${opensearch_version}"
526-
testImplementation "org.mockito:mockito-core:5.20.0"
527-
528-
//integration test framework:
529-
integrationTestImplementation('com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.3') {
530-
exclude(group: 'junit', module: 'junit')
531-
}
532-
integrationTestImplementation 'junit:junit:4.13.2'
533-
integrationTestImplementation("org.opensearch.plugin:reindex-client:${opensearch_version}"){
534-
exclude(group: 'org.slf4j', module: 'slf4j-api')
535-
}
536-
integrationTestImplementation "org.opensearch:protobufs:${versions.opensearchprotobufs}"
537-
integrationTestImplementation "io.grpc:grpc-stub:${versions.grpc}"
538-
integrationTestImplementation "io.grpc:grpc-netty-shaded:${versions.grpc}"
539-
integrationTestImplementation "org.opensearch.plugin:transport-grpc:${opensearch_version}"
540-
integrationTestImplementation "org.opensearch.plugin:percolator-client:${opensearch_version}"
541-
integrationTestImplementation 'commons-io:commons-io:2.21.0'
542-
integrationTestImplementation "org.apache.logging.log4j:log4j-core:${versions.log4j}"
543-
integrationTestImplementation "org.apache.logging.log4j:log4j-jul:${versions.log4j}"
544-
integrationTestImplementation 'org.hamcrest:hamcrest:2.2'
545-
integrationTestImplementation "org.bouncycastle:bc-fips:${versions.bouncycastle_jce}"
546-
integrationTestImplementation "org.bouncycastle:bcpkix-fips:${versions.bouncycastle_pkix}"
547-
integrationTestImplementation "org.bouncycastle:bcutil-fips:${versions.bouncycastle_util}"
548-
integrationTestImplementation('org.awaitility:awaitility:4.3.0') {
549-
exclude(group: 'org.hamcrest', module: 'hamcrest')
550-
}
551-
integrationTestImplementation 'com.unboundid:unboundid-ldapsdk:4.0.14'
552-
integrationTestImplementation "org.opensearch.plugin:mapper-size:${opensearch_version}"
553-
integrationTestImplementation "org.apache.httpcomponents:httpclient-cache:4.5.14"
554-
integrationTestImplementation "org.apache.httpcomponents:httpclient:4.5.14"
555-
integrationTestImplementation "org.apache.httpcomponents:fluent-hc:4.5.14"
556-
integrationTestImplementation "org.apache.httpcomponents:httpcore:4.4.16"
557-
integrationTestImplementation "org.apache.httpcomponents:httpasyncclient:4.1.5"
558-
integrationTestImplementation "org.mockito:mockito-core:5.20.0"
559-
integrationTestImplementation "org.passay:passay:1.6.6"
560-
integrationTestImplementation "org.opensearch:opensearch:${opensearch_version}"
561-
integrationTestImplementation "org.opensearch.plugin:transport-netty4-client:${opensearch_version}"
562-
integrationTestImplementation "org.opensearch.plugin:aggs-matrix-stats-client:${opensearch_version}"
563-
integrationTestImplementation "org.opensearch.plugin:parent-join-client:${opensearch_version}"
564-
integrationTestImplementation "com.password4j:password4j:${versions.password4j}"
565-
integrationTestImplementation "com.google.guava:guava:${guava_version}"
566-
integrationTestImplementation "org.apache.commons:commons-lang3:${versions.commonslang}"
567-
integrationTestImplementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
568-
integrationTestImplementation 'org.greenrobot:eventbus-java:3.3.1'
569-
integrationTestImplementation "org.apache.commons:commons-collections4:${versions.commonscollections4}"
570-
integrationTestImplementation('com.flipkart.zjsonpatch:zjsonpatch:0.4.16'){
571-
exclude(group:'com.fasterxml.jackson.core')
572-
exclude(group: 'org.apache.commons', module: 'commons-collections4')
573-
}
574-
integrationTestImplementation 'org.slf4j:slf4j-api:2.0.12'
575-
integrationTestImplementation 'com.selectivem.collections:special-collections-complete:1.4.0'
576-
577-
integrationTestImplementation ('com.jayway.jsonpath:json-path:2.10.0') {
578-
exclude(group: 'net.minidev', module: 'json-smart')
579-
}
580-
}
581-
}
554+
afterEvaluate {
555+
if (project.configurations.findByName('integrationTestImplementation')) {
556+
dependencies {
557+
//integration test framework:
558+
integrationTestImplementation('com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.3') {
559+
exclude(group: 'junit', module: 'junit')
560+
}
561+
integrationTestImplementation 'junit:junit:4.13.2'
562+
integrationTestImplementation("org.opensearch.plugin:reindex-client:${opensearch_version}"){
563+
exclude(group: 'org.slf4j', module: 'slf4j-api')
564+
}
565+
integrationTestImplementation "org.opensearch:protobufs:${versions.opensearchprotobufs}"
566+
integrationTestImplementation "io.grpc:grpc-stub:${versions.grpc}"
567+
integrationTestImplementation "io.grpc:grpc-netty-shaded:${versions.grpc}"
568+
integrationTestImplementation "org.opensearch.plugin:transport-grpc:${opensearch_version}"
569+
integrationTestImplementation "org.opensearch.plugin:percolator-client:${opensearch_version}"
570+
integrationTestImplementation 'commons-io:commons-io:2.21.0'
571+
integrationTestImplementation "org.apache.logging.log4j:log4j-core:${versions.log4j}"
572+
integrationTestImplementation "org.apache.logging.log4j:log4j-jul:${versions.log4j}"
573+
integrationTestImplementation 'org.hamcrest:hamcrest:2.2'
574+
integrationTestImplementation "org.bouncycastle:bc-fips:${versions.bouncycastle_jce}"
575+
integrationTestImplementation "org.bouncycastle:bcpkix-fips:${versions.bouncycastle_pkix}"
576+
integrationTestImplementation "org.bouncycastle:bcutil-fips:${versions.bouncycastle_util}"
577+
integrationTestImplementation('org.awaitility:awaitility:4.3.0') {
578+
exclude(group: 'org.hamcrest', module: 'hamcrest')
579+
}
580+
integrationTestImplementation 'com.unboundid:unboundid-ldapsdk:4.0.14'
581+
integrationTestImplementation "org.opensearch.plugin:mapper-size:${opensearch_version}"
582+
integrationTestImplementation "org.apache.httpcomponents:httpclient-cache:4.5.14"
583+
integrationTestImplementation "org.apache.httpcomponents:httpclient:4.5.14"
584+
integrationTestImplementation "org.apache.httpcomponents:fluent-hc:4.5.14"
585+
integrationTestImplementation "org.apache.httpcomponents:httpcore:4.4.16"
586+
integrationTestImplementation "org.apache.httpcomponents:httpasyncclient:4.1.5"
587+
integrationTestImplementation "org.mockito:mockito-core:5.20.0"
588+
integrationTestImplementation "org.passay:passay:1.6.6"
589+
integrationTestImplementation "org.opensearch:opensearch:${opensearch_version}"
590+
integrationTestImplementation "org.opensearch.plugin:transport-netty4-client:${opensearch_version}"
591+
integrationTestImplementation "org.opensearch.plugin:aggs-matrix-stats-client:${opensearch_version}"
592+
integrationTestImplementation "org.opensearch.plugin:parent-join-client:${opensearch_version}"
593+
integrationTestImplementation "com.password4j:password4j:${versions.password4j}"
594+
integrationTestImplementation "com.google.guava:guava:${guava_version}"
595+
integrationTestImplementation "org.apache.commons:commons-lang3:${versions.commonslang}"
596+
integrationTestImplementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
597+
integrationTestImplementation 'org.greenrobot:eventbus-java:3.3.1'
598+
integrationTestImplementation "org.apache.commons:commons-collections4:${versions.commonscollections4}"
599+
integrationTestImplementation('com.flipkart.zjsonpatch:zjsonpatch:0.4.16'){
600+
exclude(group:'com.fasterxml.jackson.core')
601+
exclude(group: 'org.apache.commons', module: 'commons-collections4')
602+
}
603+
integrationTestImplementation 'org.slf4j:slf4j-api:2.0.12'
604+
integrationTestImplementation 'com.selectivem.collections:special-collections-complete:1.4.0'
582605

583-
//create source set 'integrationTest'
584-
//add classes from the main source set to the compilation and runtime classpaths of the integrationTest
585-
sourceSets {
586-
integrationTest {
587-
java {
588-
srcDir file ('src/integrationTest/java')
589-
compileClasspath += sourceSets.main.output
590-
runtimeClasspath += sourceSets.main.output
591-
}
592-
resources {
593-
srcDir file('src/integrationTest/resources')
594-
}
595-
processIntegrationTestResources {
596-
duplicatesStrategy(DuplicatesStrategy.INCLUDE)
606+
integrationTestImplementation ('com.jayway.jsonpath:json-path:2.10.0') {
607+
exclude(group: 'net.minidev', module: 'json-smart')
608+
}
609+
}
597610
}
598611
}
599612
}
@@ -801,24 +814,14 @@ dependencies {
801814
}
802815

803816
jar {
804-
libsDirName = '.'
805-
into '', {
806-
from 'NOTICE.txt', "THIRD-PARTY.txt", "LICENSE"
807-
}
808-
processResources {
809-
exclude("KEYS")
810-
}
817+
from('NOTICE.txt', 'THIRD-PARTY.txt', 'LICENSE')
811818
}
812819

813820
tasks.register('testsJar', Jar) {
814821
archiveClassifier = 'tests'
815822
from(sourceSets.test.output)
816823
}
817824

818-
testsJar {
819-
libsDirName = '.'
820-
}
821-
822825
task bundleSecurityAdminStandalone(dependsOn: jar, type: Zip) {
823826
archiveClassifier = 'securityadmin-standalone'
824827
from(configurations.runtimeClasspath) {
@@ -901,7 +904,7 @@ afterEvaluate {
901904
version = "${project.version}" - "-SNAPSHOT"
902905

903906
into '/usr/share/opensearch/plugins'
904-
from(zipTree(bundlePlugin.archivePath)) {
907+
from(zipTree(bundlePlugin.archiveFile)) {
905908
into opensearchplugin.name
906909
}
907910

gradle/wrapper/gradle-wrapper.jar

59 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=ed1a8d686605fd7c23bdf62c7fc7add1c5b23b2bbc3721e661934ef4a4911d7c
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
3+
distributionSha256Sum=16f2b95838c1ddcf7242b1c39e7bbbb43c842f1f1a1a0dc4959b6d4d68abcac3
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-all.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

117-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
118118

119119

120120
# Determine the Java command to use to start the JVM.
@@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
213213
set -- \
214214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215215
-classpath "$CLASSPATH" \
216-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217217
"$@"
218218

219219
# Stop when "xargs" is not available.

gradlew.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ goto fail
7070
:execute
7171
@rem Setup the command line
7272

73-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
set CLASSPATH=
7474

7575

7676
@rem Execute Gradle
77-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
77+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7878

7979
:end
8080
@rem End local scope for the variables with windows NT shell

0 commit comments

Comments
 (0)