Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.0.0-M4
-
None
-
None
Description
When I use toolchains and configure GraalVM as the active toolchain AND my default JDK is NOT GraalVM (JAVA_HOME != GraalVM) I'm getting NPE from surefire plugin
Caused by: java.lang.NullPointerException
at org.apache.maven.surefire.booter.SystemUtils.toJdkVersionFromReleaseFile (SystemUtils.java:141)
at org.apache.maven.surefire.booter.SystemUtils.isJava9AtLeast (SystemUtils.java:215)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.getEffectiveJvm (AbstractSurefireMojo.java:2446)
It works fine when I change JAVA_HOME to point to GraalVM home.
The reason is that https://github.com/apache/maven-surefire/blob/master/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java try to read JAVA_VERSION from releases file and GraalVM doesn't have this variable there.
I'm not sure who is at fault, maybe GraalVM should export that var.