Skip to content

Commit 93ba778

Browse files
authored
[8.7] Use correct target compatibility for third party audit tasks (#94648) (#94650)
* Use correct target compatibility for third party audit tasks (#94648) * Fix when runtime java home isn't set
1 parent 44b0c0a commit 93ba778

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

build-tools-internal/src/main/groovy/elasticsearch.runtime-jdk-provision.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ configure(allprojects) {
6161
project.getTasks().withType(ThirdPartyAuditTask.class).configureEach {
6262
if (BuildParams.getIsRuntimeJavaHomeSet() == false) {
6363
javaHome.set(providers.provider(() -> "${project.jdks.provisioned_runtime.javaHomePath}"))
64+
targetCompatibility.set(providers.provider(() -> JavaVersion.toVersion(project.jdks.provisioned_runtime.major)))
6465
}
6566
}
6667
}

libs/plugin-analysis-api/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ tasks.named("dependencyLicenses").configure {
3131
}
3232

3333
tasks.named("thirdPartyAudit").configure {
34-
if (BuildParams.runtimeJavaVersion == JavaVersion.VERSION_20) {
34+
if (BuildParams.runtimeJavaVersion == JavaVersion.VERSION_20 || BuildParams.isRuntimeJavaHomeSet == false) {
3535
ignoreMissingClasses(
3636
// This class was removed in Java 20 but is only referenced by a class that requires preview features anyhow
3737
// See: https://github.com/apache/lucene/pull/12042

server/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ tasks.named("thirdPartyAudit").configure {
236236
)
237237
ignoreMissingClasses 'javax.xml.bind.DatatypeConverter'
238238

239-
if (BuildParams.runtimeJavaVersion == JavaVersion.VERSION_20) {
239+
if (BuildParams.runtimeJavaVersion == JavaVersion.VERSION_20 || BuildParams.isRuntimeJavaHomeSet == false) {
240240
ignoreMissingClasses(
241241
// This class was removed in Java 20 but is only referenced by a class that requires preview features anyhow
242242
// See: https://github.com/apache/lucene/pull/12042

0 commit comments

Comments
 (0)