diff --git a/core/deployment/src/test/java/io/quarkus/deployment/pkg/steps/GraalVMTest.java b/core/deployment/src/test/java/io/quarkus/deployment/pkg/steps/GraalVMTest.java index 8ef6ea1196b52..6574f40d13366 100644 --- a/core/deployment/src/test/java/io/quarkus/deployment/pkg/steps/GraalVMTest.java +++ b/core/deployment/src/test/java/io/quarkus/deployment/pkg/steps/GraalVMTest.java @@ -176,6 +176,20 @@ public void testGraalVMEA24DevVersionParser() { assertThat(graalVMEA24Dev.javaVersion.update()).isEqualTo(0); } + @Test + public void testGraalVM23_1CommunityVersionParser() { + final Version version = Version.of(Stream.of(("native-image 21.0.5-beta 2024-10-15\n" + + "GraalVM Runtime Environment GraalVM CE 21.0.5-dev.beta+3.1 (build 21.0.5-beta+3-ea)\n" + + "Substrate VM GraalVM CE 21.0.5-dev.beta+3.1 (build 21.0.5-beta+3-ea, serial gc)") + .split("\\n"))); + assertThat(version.toString().contains(GRAALVM.name())); + assertThat(version.getVersionAsString()).isEqualTo("23.1-dev"); + assertThat(version.javaVersion.toString()).isEqualTo("21.0.5-beta+3-ea"); + assertThat(version.javaVersion.feature()).isEqualTo(21); + assertThat(version.javaVersion.interim()).isEqualTo(0); + assertThat(version.javaVersion.update()).isEqualTo(5); + } + @Test public void testGraalVMVersionsOlderThan() { assertOlderThan("GraalVM Version 19.3.6 CE", "GraalVM Version 20.2.0 (Java Version 11.0.9)"); diff --git a/core/runtime/src/main/java/io/quarkus/runtime/graal/GraalVM.java b/core/runtime/src/main/java/io/quarkus/runtime/graal/GraalVM.java index 06a5e2781ac62..4a127e33a214b 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/graal/GraalVM.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/graal/GraalVM.java @@ -72,7 +72,9 @@ public static class Version implements Comparable { // Temporarily work around https://github.com/quarkusio/quarkus/issues/36246, // till we have a consensus on how to move forward in // https://github.com/quarkusio/quarkus/issues/34161 - protected static final Map GRAAL_MAPPING = Map.of("22", "24.0", + protected static final Map GRAAL_MAPPING = Map.of( + "21", "23.1", + "22", "24.0", "23", "24.1", "24", "24.2", "25", "25.0");