[build] Add Java 21 and Java 25 to CI as advisory builds

Open Beginner friendly
#5,304 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
github-actions, java

Research direction

Start with the existing Java 17 jobs in .github/workflows/maven.yml and .github/workflows/maven_on_pull_request.yml. Review the workflow matrix, Maven commands, fail-fast setting, and experimental error handling. Done means both workflows show builds for Java 17, 21, and 25 with only Java 17 gating as specified; branch protection still needs maintainer attention.

Written by the indexing model from the issue text.

Description

Motivation

XChange currently builds and tests only against Java 17 (<version.java>17</version.java> in pom.xml). As Java 21 and 25 see growing adoption, we want early visibility into compile/test compatibility on those JDKs without changing our supported target. The new matrix entries should be informational only — failures must not block PR merges or develop pushes.

Proposed change

Convert the single-JDK build in both workflows to a matrix over Java 17, 21, and 25. Java 17 remains the sole gating entry; 21 and 25 are marked experimental and use continue-on-error: ${{ matrix.experimental || false }} so they cannot fail the workflow.

Files:

  • .github/workflows/maven.yml — push to develop. Java 17 entry keeps mvn clean deploy; 21/25 use mvn clean verify so no snapshots are published from non-17 JDKs.
  • .github/workflows/maven_on_pull_request.yml — PRs to develop. All entries use mvn clean verify.

Both workflows set fail-fast: false so one experimental failure does not cancel the other JDK's run.

The Maven <release> target stays at 17 — we are testing that the project still builds/tests on newer JDKs, not retargeting bytecode.

Acceptance criteria

  • Each workflow shows three matrix entries: build (17), build (21), build (25).
  • A failure in build (21) or build (25) leaves the workflow's overall conclusion green.
  • A failure in build (17) still turns the workflow red.
  • On maven.yml, only the Java 17 entry runs deploy; 21 and 25 stop at verify.

Follow-up / caveats

  • Branch protection. The required status check name changes from build to build (17). A maintainer with admin access to knowm/XChange needs to update the branch protection rule on develop accordingly, otherwise the required check will appear missing on new PRs.
Dominant language
Java
Stars
4.1k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from knowm/XChange

All issues in knowm/XChange

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.