Skip to content

Commit

Permalink
Fix thirdPartyAudit tasks when running with Java 20 (#93394) (#93423)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Feb 1, 2023
1 parent e9bf92f commit de95577
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libs/plugin-analysis-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.elasticsearch.gradle.internal.info.BuildParams

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
Expand Down Expand Up @@ -26,3 +28,13 @@ tasks.named('forbiddenApisMain').configure {
tasks.named("dependencyLicenses").configure {
mapping from: /lucene-.*/, to: 'lucene'
}

tasks.named("thirdPartyAudit").configure {
if (BuildParams.runtimeJavaVersion == JavaVersion.VERSION_20) {
ignoreMissingClasses(
// This class was removed in Java 20 but is only referenced by a class that requires preview features anyhow
// See: https://github.com/apache/lucene/pull/12042
'java.lang.foreign.MemorySession',
)
}
}
8 changes: 8 additions & 0 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ tasks.named("thirdPartyAudit").configure {
'org.zeromq.ZMQ',
)
ignoreMissingClasses 'javax.xml.bind.DatatypeConverter'

if (BuildParams.runtimeJavaVersion == JavaVersion.VERSION_20) {
ignoreMissingClasses(
// This class was removed in Java 20 but is only referenced by a class that requires preview features anyhow
// See: https://github.com/apache/lucene/pull/12042
'java.lang.foreign.MemorySession',
)
}
}

tasks.named("dependencyLicenses").configure {
Expand Down

0 comments on commit de95577

Please sign in to comment.