Skip to content

Commit 2f9f364

Browse files
authored
Fix thirdPartyAudit task when running on Java 24 (#121712) (#121840)
We need to explicitly add the incubating vector API module to the third party audit task on Java 24. (cherry picked from commit 0c667ec) # Conflicts: # build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/ThirdPartyAuditTask.java
1 parent 0b865d4 commit 2f9f364

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/ThirdPartyAuditTask.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
import static org.gradle.api.JavaVersion.VERSION_21;
6262
import static org.gradle.api.JavaVersion.VERSION_22;
6363
import static org.gradle.api.JavaVersion.VERSION_23;
64+
import static org.gradle.api.JavaVersion.VERSION_24;
6465

6566
@CacheableTask
6667
public abstract class ThirdPartyAuditTask extends DefaultTask {
@@ -346,8 +347,12 @@ private String runForbiddenAPIsCli() throws IOException {
346347
spec.setExecutable(javaHome.get() + "/bin/java");
347348
}
348349
spec.classpath(getForbiddenAPIsClasspath(), classpath);
349-
// Enable explicitly for each release as appropriate. Just JDK 20/21/22/23 for now, and just the vector module.
350-
if (isJavaVersion(VERSION_20) || isJavaVersion(VERSION_21) || isJavaVersion(VERSION_22) || isJavaVersion(VERSION_23)) {
350+
// Enable explicitly for each release as appropriate. Just JDK 20/21/22/23/24 for now, and just the vector module.
351+
if (isJavaVersion(VERSION_20)
352+
|| isJavaVersion(VERSION_21)
353+
|| isJavaVersion(VERSION_22)
354+
|| isJavaVersion(VERSION_23)
355+
|| isJavaVersion(VERSION_24)) {
351356
spec.jvmArgs("--add-modules", "jdk.incubator.vector");
352357
}
353358
spec.jvmArgs("-Xmx1g");

0 commit comments

Comments
 (0)