This is an automated email from the ASF dual-hosted git repository.
sjaranowski pushed a commit to branch v4
in repository https://gitbox.apache.org/repos/asf/maven-gh-actions-shared.git
The following commit(s) were added to refs/heads/v4 by this push:
new 25d9436 feat: Install and make available all LTS JDK versions via
Toolchains.
25d9436 is described below
commit 25d94369178a4362fe45628cc12848a0430e46f0
Author: Niels Basjes <[email protected]>
AuthorDate: Thu Mar 19 14:54:17 2026 +0100
feat: Install and make available all LTS JDK versions via Toolchains.
---
.github/workflows/maven-verify.yml | 39 +++++++++++++++++++++++++++++++++++++-
pom.xml | 25 ++++++++++++++++++++++++
2 files changed, 63 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/maven-verify.yml
b/.github/workflows/maven-verify.yml
index 28c8be6..15a16f2 100644
--- a/.github/workflows/maven-verify.yml
+++ b/.github/workflows/maven-verify.yml
@@ -32,6 +32,17 @@ on:
default: '[ "ubuntu-latest", "windows-latest", "macos-latest" ]'
type: string
+ jdk-toolchain:
+ description: 'The jdk versions to be present in the maven toolchain
(default: all current LTS versions)'
+ required: false
+ default: |
+ 8
+ 11
+ 17
+ 21
+ 25
+ type: string
+
jdk-matrix:
description: jdk matrix as json array
required: false
@@ -117,6 +128,17 @@ on:
default: '3.9.14'
type: string
+ ff-jdk-toolchain:
+ description: 'The jdk versions to be present in the maven toolchain
during fail-fast-build job (default: all current LTS versions)'
+ required: false
+ default: |
+ 8
+ 11
+ 17
+ 21
+ 25
+ type: string
+
ff-jdk:
description: The jdk version used during fail-fast-build job
required: false
@@ -193,7 +215,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
-# clare all permissions for GITHUB_TOKEN
+# clear all permissions for GITHUB_TOKEN
permissions: {}
jobs:
@@ -274,6 +296,13 @@ jobs:
with:
persist-credentials: false
+ - name: Set up JDKs for Toolchain
+ uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 #
v5.2.0
+ with:
+ java-version: ${{ inputs.ff-jdk-toolchain }}
+ distribution: ${{ inputs.ff-jdk-distribution }}
+ cache: 'maven'
+
- name: Set up JDK
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 #
v5.2.0
with:
@@ -391,6 +420,14 @@ jobs:
with:
persist-credentials: false
+ - name: Set up JDKs for Toolchain
+ if: steps.should-run.conclusion == 'success'
+ uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 #
v5.2.0
+ with:
+ java-version: ${{ inputs.jdk-toolchain }}
+ distribution: ${{ matrix.distribution }}
+ cache: 'maven'
+
- name: Set up JDK
if: steps.should-run.conclusion == 'success'
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 #
v5.2.0
diff --git a/pom.xml b/pom.xml
index 69bcd8c..48d870d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,6 +47,31 @@
</execution>
</executions>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>3.2.0</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <phase>validate</phase>
+ <configuration>
+ <target>
+ <echo message="Current Java Version: ${java.version}" />
+ <echo message="Java Home : ${java.home}" />
+ <echo message="Contents of toolchains.xml:" />
+ <concat>
+ <file name="${user.home}/.m2/toolchains.xml" />
+ </concat>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
</build>