Thanks for the request, @pjBooms 👋
After scoping this against the existing capabilities, we've decided not to add a dedicated multi-distribution input, because both of your use cases are already covered today.
1. Testing against different vendors → use a matrix (separate jobs)
This gives you clean isolation, parallelism, and clear failure attribution per vendor:
jobs:
test:
strategy:
matrix:
distribution: [temurin, zulu]
java-version: [17, 21]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v5
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java-version }}
- run: ./mvnw test
2. Multiple distributions available in a single job → stack setup-java steps
This directly matches your justification ("some tests need a specific distro, others run on any JDK"). Each additional setup-java call appends the JDK to toolchains.xml without touching the previously written settings.xml, and the last step installed becomes the default JAVA_HOME:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v5
with:
distribution: temurin # common default -> JAVA_HOME
java-version: 21
- uses: actions/setup-java@v5
with:
distribution: graalvm # extra distro, added to toolchains.xml
java-version: 21
- run: ./mvnw verify # Maven can select either via <toolchains>
Maven/Gradle then pick the right JDK per module/test via toolchains, while tests that work on "any JDK" just use the default. See Install multiple JDKs and Using Maven Toolchains.
Because a first-class multi-distribution input would introduce ambiguous semantics (index-pairing vs. cross-product vs. explicit mapping, plus which JDK owns JAVA_HOME) for marginal ergonomic gain over the patterns above, we're closing this as not planned. If you hit a concrete scenario that neither pattern above can express, please comment and we'll happily reopen.