As discussed with @philwebb, @wilkinsona and @scottfrederick, in order to improve the usability of Spring Boot native support, I have implemented on Native Build Tools side the support to set the minimal GraalVM version to use. That will avoid hard to diagnose errors like #32915.
The related issue graalvm/native-build-tools#346 has been merged, and will be soon released as part of NBT 0.9.17. Based on that feature, Spring Boot 3 should configure by default with Maven:
<configuration>
<requiredVersion>22.3</requiredVersion>
</configuration>
And with Gradle:
graalvmNative {
requiredVersion = "22.3"
}
Depends on #32923.
Comment From: wilkinsona
With the required changes in place, a Maven build using Graal 22.2 now fails like this:
[INFO] --- native-maven-plugin:0.9.17:compile (default-cli) @ demo-aot-native ---
[INFO] Found GraalVM installation from JAVA_HOME variable.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.964 s
[INFO] Finished at: 2022-11-04T12:56:25Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.graalvm.buildtools:native-maven-plugin:0.9.17:compile (default-cli) on project demo-aot-native: Execution default-cli of goal org.graalvm.buildtools:native-maven-plugin:0.9.17:compile failed: GraalVM version 22.3 is required but 22.2 has been detected, please upgrade. -> [Help 1]
Similarly, a Gradle build fails like this:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':nativeCompile'.
> GraalVM version 22.3 is required but 22.2 has been detected, please upgrade.