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

slachiewicz 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 f7bb8d151 Show a jdkToolchain range that matches setup-java and 
generated entries
f7bb8d151 is described below

commit f7bb8d151b1640048b42e514a0f58127a1f85740
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Wed Nov 4 12:00:20 2026 +0000

    Show a jdkToolchain range that matches setup-java and generated entries
    
    actions/setup-java labels a JDK with its java-version input (8, 17),
    while generate-jdk-toolchains-xml writes the full version (1.8.0_504,
    17.0.20). [1.8,1.9) matched only the latter, so the example failed with
    the toolchains.xml that setup-java writes for java-version 8; [17,18)
    matches both. Vendor matching ignores case.
---
 .../src/site/markdown/examples/toolchains.md.vm            | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/maven-surefire-plugin/src/site/markdown/examples/toolchains.md.vm 
b/maven-surefire-plugin/src/site/markdown/examples/toolchains.md.vm
index 58b978bdc..ddcc45fbd 100644
--- a/maven-surefire-plugin/src/site/markdown/examples/toolchains.md.vm
+++ b/maven-surefire-plugin/src/site/markdown/examples/toolchains.md.vm
@@ -39,7 +39,7 @@ Configuring a different jvm for running tests using toolchains
 <configuration>
     [...]
     <jdkToolchain>
-        <version>[1.8,1.9)</version>
+        <version>[17,18)</version>
         <vendor>zulu</vendor>
     </jdkToolchain>
     [...]
@@ -48,10 +48,14 @@ Configuring a different jvm for running tests using 
toolchains
 
 The above example assumes that your `toolchains.xml` contains a valid entry 
with these values.
 
-A single version must equal the one in `toolchains.xml`: `8` matches only an 
entry whose version is exactly `8`, not
-one that provides `1.8.0_504`, and `17` does not match `17.0.20`. JDKs 
discovered by the toolchains plugin report
-their full version, so use a range such as `[1.8,1.9)` or `[17,18)` to accept 
any update of a Java release. Other
-elements, like `vendor`, must equal the value in `toolchains.xml`.
+How a JDK is labeled in `toolchains.xml` depends on what wrote the entry. On 
GitHub Actions, `actions/setup-java`
+writes its `java-version` input as given, such as `17` or `8`, and the 
distribution as the vendor, such as `zulu`.
+The `generate-jdk-toolchains-xml` goal of the Maven Toolchains Plugin writes 
the JDK's full version, such as `17.0.20`
+or `1.8.0_504`, and its `java.vendor` property as the vendor.
+
+A single version must equal the one in `toolchains.xml`: `17` does not match 
`17.0.20`. A range such as `[17,18)`
+matches both `17` and `17.0.20`. Java 8 is labeled either `8` or `1.8.0_504`, 
so `[8,9)` matches only the first and
+`[1.8,1.9)` only the second. Other elements, like `vendor`, must equal the 
value in `toolchains.xml`, ignoring case.
 
 Minimum Java Version for Toolchains
 -----------------------------------

Reply via email to