Skip to content

Support Temurin JEP 322 patch versions like 26.0.2.1+1 - #1279

Merged
brunoborges merged 2 commits into
mainfrom
brunoborges-fix-temurin-four-part-version
Oct 2, 2026
Merged

brunoborges merged 2 commits into
mainfrom
brunoborges-fix-temurin-four-part-version

Conversation

@brunoborges

Copy link
Copy Markdown
Contributor

Description:
Temurin now publishes respins with a JEP 322 patch field (for example 26.0.2.1+1 and 25.0.4.1+1). In v6, java-version: 26.0.2.1+1 fails with "is not valid SemVer notation", and the version could not have resolved anyway:

  1. normalizeVersion only converted 4+ field versions without build metadata, so X.Y.Z.P+B was rejected.
  2. The Adoptium API version_data.semver encodes the patch into the build number (26.0.2.1+1 -> 26.0.2+101) and appends metadata for LTS releases (25.0.4+7 -> 25.0.4+7.0.LTS), so an exact OpenJDK-style request never matches.

Changes:

  • New normalizeJavaVersionToSemver helper in src/util.ts that maps X.Y.Z.P[+B] to X.Y.Z+P[.B] (consistent with convertVersionToSemver and the Liberica compound-build handling from Preserve compound Liberica build versions from .sdkmanrc #1268). Used by JavaBase.normalizeVersion and the Temurin jdk+jmods version check in package-types.ts.
  • Temurin resolvePackage: for exact (build-qualified) requests, also match against a key derived from the OpenJDK fields (major.minor.security+[patch.]build). The API semver is still used as the resolved version, for sorting, and for tool-cache paths, so ranges (25, 26.0.2, x) behave as before and pick the newest respin.
  • Side effect: exact LTS requests like 25.0.4+7 now resolve remotely (previously only a tool-cache hit worked).
  • README: added 26.0.2.1+1 to the supported version syntax table.
  • Rebuilt dist/.

Known limitation: an exact 26.0.2.1 without build metadata still won't match a respin; 26.0.2.1+1 or 26.0.2 work.

Verified locally against the live Adoptium API by running dist/setup/index.js: 26.0.2.1+1 -> 26.0.2+101, 25.0.4.1+1 -> 25.0.4+101.0.LTS, 25.0.4+7 -> 25.0.4+7.0.LTS, all downloaded successfully.

Related issue:
Fixes: #1270

Check list:

  • Ran npm run check locally (format, lint, build, test) and all checks pass. (45 suites, 1512 tests passed)
  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.
Accept 4-part versions with build metadata (X.Y.Z.P+B -> X.Y.Z+P.B) and
match exact Temurin requests against OpenJDK-derived version keys, since the
Adoptium API semver folds the patch into the build number (26.0.2+101) and
adds LTS metadata (25.0.4+7.0.LTS).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 04:03
@brunoborges
brunoborges requested a review from a team as a code owner October 2, 2026 04:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation is consistent across source and generated bundles and includes focused regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Adds support for Temurin JEP 322 respin versions while preserving existing range resolution behavior.

Changes:

  • Normalizes multi-field Java versions with build metadata.
  • Matches exact Temurin requests against reconstructed OpenJDK versions.
  • Adds documentation, tests, and rebuilt runtime bundles.
File Description
src/​util.ts Adds shared Java-version normalization.
src/​distributions/​temurin/​models.ts Models the optional patch field.
src/​distributions/​temurin/​installer.ts Resolves exact respin and LTS versions.
src/​distributions/​package-types.ts Normalizes versions for jmods validation.
src/​distributions/​base-installer.ts Applies shared normalization to inputs.
README.md Documents respin syntax.
dist/​setup/​index.js Rebuilds setup utility bundle.
dist/​setup/​463.index.js Rebuilds Temurin installer bundle.
dist/​setup/​242.index.js Rebuilds base installer bundle.
dist/​cleanup/​index.js Rebuilds cleanup bundle.
__tests__/​util.test.ts Tests normalization cases.
__tests__/​distributors/​temurin-installer.test.ts Tests respin and LTS resolution.
__tests__/​distributors/​distribution-factory.test.ts Tests jmods compatibility checks.
__tests__/​distributors/​base-installer.test.ts Tests input normalization.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@brunoborges
brunoborges merged commit 47b3648 into main Oct 2, 2026
82 of 85 checks passed
@brunoborges
brunoborges deleted the brunoborges-fix-temurin-four-part-version branch October 2, 2026 04:09
gregor-dietrich pushed a commit to gregor-dietrich/Midas that referenced this pull request Oct 24, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/setup-java](https://github.com/actions/setup-java) | action | minor | `v6.0.1` → `v6.1.0` |

---

### Release Notes

<details>
<summary>actions/setup-java</summary>

### [`v6.1.0`](https://github.com/actions/setup-java/releases/tag/v6.1.0)

[Compare Source](actions/setup-java@v6.0.1...v6.1.0)

##### What's Changed

- Preserve compound Liberica build versions from .sdkmanrc by [@&#8203;brunoborges](https://github.com/brunoborges) with [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;1268](actions/setup-java#1268)
- Support Temurin on Linux RISC-V by [@&#8203;yawkat](https://github.com/yawkat) in [#&#8203;1269](actions/setup-java#1269)
- Stop GPG agent before removing signature-verification home by [@&#8203;brunoborges](https://github.com/brunoborges) with [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;1273](actions/setup-java#1273)
- Prefer Zulu 4-segment hotfix builds when resolving version ranges by [@&#8203;brunoborges](https://github.com/brunoborges) in [#&#8203;1278](actions/setup-java#1278)
- Support Temurin JEP 322 patch versions like 26.0.2.1+1 by [@&#8203;brunoborges](https://github.com/brunoborges) in [#&#8203;1279](actions/setup-java#1279)
- chore(deps): bump undici from 6.28.0 to 6.29.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1274](actions/setup-java#1274)
- chore(deps): bump the monthly-npm-updates group with 13 updates by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;1276](actions/setup-java#1276)
- feat: support Maven server credential origins by [@&#8203;YunaBraska](https://github.com/YunaBraska) in [#&#8203;1282](actions/setup-java#1282)
- Support Maven plugin repositories in generated settings.xml by [@&#8203;brunoborges](https://github.com/brunoborges) in [#&#8203;1286](actions/setup-java#1286)

##### New Contributors

- [@&#8203;yawkat](https://github.com/yawkat) made their first contribution in [#&#8203;1269](actions/setup-java#1269)
- [@&#8203;YunaBraska](https://github.com/YunaBraska) made their first contribution in [#&#8203;1282](actions/setup-java#1282)

**Full Changelog**: <actions/setup-java@v6.0.1...v6.1.0>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNjUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjE2NS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.vptr.de/gregor/midas2/pulls/113
Reviewed-by: gregor <1+gregor@noreply.localhost>
Co-authored-by: Renovate Bot <renovate@vptr.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants