Skip to content

Commit 531c376

Browse files
authored
Fix thirdPartyAudit task when running on Java 24 (#121712) (#121725)
We need to explicitly add the incubating vector API module to the third party audit task on Java 24.
1 parent 3da916f commit 531c376

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
@@ -60,6 +60,7 @@
6060
import static org.gradle.api.JavaVersion.VERSION_21;
6161
import static org.gradle.api.JavaVersion.VERSION_22;
6262
import static org.gradle.api.JavaVersion.VERSION_23;
63+
import static org.gradle.api.JavaVersion.VERSION_24;
6364

6465
@CacheableTask
6566
public abstract class ThirdPartyAuditTask extends DefaultTask {
@@ -341,8 +342,12 @@ private String runForbiddenAPIsCli() throws IOException {
341342
spec.setExecutable(javaHome.get() + "/bin/java");
342343
}
343344
spec.classpath(getForbiddenAPIsClasspath(), getThirdPartyClasspath());
344-
// Enable explicitly for each release as appropriate. Just JDK 20/21/22/23 for now, and just the vector module.
345-
if (isJavaVersion(VERSION_20) || isJavaVersion(VERSION_21) || isJavaVersion(VERSION_22) || isJavaVersion(VERSION_23)) {
345+
// Enable explicitly for each release as appropriate. Just JDK 20/21/22/23/24 for now, and just the vector module.
346+
if (isJavaVersion(VERSION_20)
347+
|| isJavaVersion(VERSION_21)
348+
|| isJavaVersion(VERSION_22)
349+
|| isJavaVersion(VERSION_23)
350+
|| isJavaVersion(VERSION_24)) {
346351
spec.jvmArgs("--add-modules", "jdk.incubator.vector");
347352
}
348353
spec.jvmArgs("-Xmx1g");

0 commit comments

Comments
 (0)