You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2023/12/13 15:44:53 UTC

(maven-surefire) branch master updated: [SUREFIRE-2221] Document minimum supported Java version for Toolchains

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git


The following commit(s) were added to refs/heads/master by this push:
     new 867671476 [SUREFIRE-2221] Document minimum supported Java version for Toolchains
867671476 is described below

commit 867671476643f1f6d615728e06f4b65a73640fe1
Author: Simon Bernard <co...@simonbernard.eu>
AuthorDate: Wed Dec 13 14:47:15 2023 +0100

    [SUREFIRE-2221] Document minimum supported Java version for Toolchains
    
    This closes #701
---
 .../src/site/apt/examples/toolchains.apt.vm        | 39 ++++++++++++++++++++--
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/maven-surefire-plugin/src/site/apt/examples/toolchains.apt.vm b/maven-surefire-plugin/src/site/apt/examples/toolchains.apt.vm
index 891f8b113..592bf503a 100644
--- a/maven-surefire-plugin/src/site/apt/examples/toolchains.apt.vm
+++ b/maven-surefire-plugin/src/site/apt/examples/toolchains.apt.vm
@@ -30,7 +30,7 @@
     {{{https://maven.apache.org/guides/mini/guide-using-toolchains.html}Guide to Using Toolchains}}
 
 
-Using Maven Toolchains with ${thisPlugin}.
+Using Maven Toolchains with ${thisPlugin}
 
     By default, if the pom configures the toolchains plugin as specified in the aforementioned
     guide, ${thisPlugin} will launch the test jvm using the main toolchain
@@ -46,11 +46,44 @@ Using Maven Toolchains with ${thisPlugin}.
 <configuration>
     [...]
     <jdkToolchain>
-        <version>1.11</version>
+        <version>8</version>
         <vendor>zulu</vendor>
     </jdkToolchain>
     [...]
 </configuration>
 +---+
 
-         The above example assumes that your toolchains.xml contains a valid entry with these values.
+     The above example assumes that your `toolchains.xml` contains a valid entry with these values.
+
+* Minimum Java Version for Toolchains
+
+    The minimum version of Java that can be used as a toolchain is limited by the Surefire Booter requirement.
+
+*---------------------+-----------------------+---------------------+
+|| Surefire Version   || Minimum Java Version || Class File Version |
+*---------------------+-----------------------+---------------------+
+| 3.0.0-M6 or higher  |    Java 8             |    52               |
+*---------------------+-----------------------+---------------------+
+| 3.0.0-M5 and lower  |    Java 7             |    51               |
+*---------------------+-----------------------+---------------------+
+| lower than 3.0.0-M1 |    Java 6             |    50               |
+*---------------------+-----------------------+---------------------+
+
+    If you try to use a version older than the minimum supported version, you should face something like:
+
+---
+Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/surefire/booter/ForkedBooter: Unsupported major.minor version 52.0
+	at java.lang.ClassLoader.defineClass1(Native Method)
+	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
+	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
+	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
+	at java.net.URLClassLoader.access${esc.d}100(URLClassLoader.java:71)
+	at java.net.URLClassLoader${esc.d}1.run(URLClassLoader.java:361)
+	at java.net.URLClassLoader${esc.d}1.run(URLClassLoader.java:355)
+	at java.security.AccessController.doPrivileged(Native Method)
+	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
+	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
+	at sun.misc.Launcher${esc.d}AppClassLoader.loadClass(Launcher.java:308)
+	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
+	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
+---
\ No newline at end of file