Support Java release tags with exact abbreviated builds

Normalize jdk-prefixed numeric versions and pad abbreviated build requests so exact build constraints survive version matching. Keep platform and package validation consistent, document the syntax, and add regression coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Bruno Borges
2026-10-05 18:06:14 +02:00
co-authored by Copilot App
parent d0e6e4dbf7
commit ca21d6d9c1
12 changed files with 250 additions and 94 deletions
@@ -82,7 +82,7 @@ describe('getJavaDistribution', () => {
);
});
it.each(['8', '23.x', '23.0.1.1', '23.0.1.1+1', '<24'])(
it.each(['8', '23.x', '23.0.1.1', '23.0.1.1+1', '<24', 'jdk-23+35'])(
"rejects Temurin java-package 'jdk+jmods' for version %s",
async version => {
await expect(
@@ -96,7 +96,15 @@ describe('getJavaDistribution', () => {
}
);
it.each(['24', '24.0.1.1', '25.0.4.1+1', '25-ea', '>=21', 'latest'])(
it.each([
'24',
'24.0.1.1',
'25.0.4.1+1',
'25-ea',
'>=21',
'latest',
'jdk-27+35'
])(
"accepts Temurin java-package 'jdk+jmods' for version %s",
async version => {
expect(
@@ -117,6 +125,17 @@ describe('getJavaDistribution', () => {
).toBeNull();
});
it('does not change the distribution or package for a jdk-prefixed version', async () => {
const distribution = await getJavaDistribution(
JavaDistribution.Zulu,
installerOptions('jre', 'jdk-27+35')
);
expect(distribution!['distribution']).toBe('Zulu');
expect(distribution!['packageType']).toBe('jre');
expect(distribution!['version']).toBe('27.0.0+35');
});
it.each(['adopt', 'adopt-hotspot', 'adopt-openj9'])(
'does not support legacy Adopt distribution %s',
async distributionName => {