Compare commits

..

13 Commits

Author SHA1 Message Date
Bruno Borges
60d2c8e17e Compare JDK version reports across main, v6, and v5 (#1331)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-19 17:05:55 -08:00
Bruno Borges
3fc1c6e612 Add daily latest JDK versions report workflow (#1329)
* Add daily latest JDK versions report workflow

Add a scheduled workflow that resolves, without downloading, the exact
version each distribution currently provides for the LTS majors, the
newest feature release, and `latest` on Linux, macOS, and Windows for
x64 and aarch64. Resolution reuses each installer's metadata lookup, so
the report matches what setup-java installs on a tool-cache miss or with
`check-latest: true`. Results are combined into a job summary with a
per-platform breakdown and a section for distributions needing
attention. Link the report from the README.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Report every supported platform in latest JDK versions report

Resolve each distribution on every OS and architecture in the capability
map, including Alpine Linux, and render a full per-platform table for each
distribution instead of a merged overview. Platform differences are
expected and no longer flagged; only lookup errors and distributions that
resolve nothing are listed under "Needs attention".

Share HEAD responses per distribution so JetBrains lookups no longer
re-probe every release URL, cutting a Linux run from ~7 min to ~1 min.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Complete JDK report platform and major coverage

Resolve every major from Java 6 through the newest GA release, including non-LTS versions. Query Liberica Solaris metadata through its installer and include Solaris in the workflow matrix. Preserve exact per-platform versions without flagging normal differences.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-18 15:44:10 -08:00
Bruno Borges
3c7a629527 Fix Oracle JDK 21 e2e and warn on archived GA fallback (#1327)
Oracle no longer serves JDK 21 under /java/21/latest/, so a major-only
request falls back to the archived 21 GA build and reports version 21.
The e2e check required a concrete version for floating Oracle requests,
so the oracle 21 jobs failed.

Move floating Oracle e2e coverage to JDK 25 and keep a single oracle 21
job that exercises the archive fallback without the concrete-version
requirement. Warn when a major-only request falls back from /latest/ to
the archived GA release, since that build may lack security updates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-14 00:10:04 -05:00
Bruno Borges
d1374f8ac7 Make Java problem matcher opt-in (#1326)
Default the problem-matcher input to false so setup-java no longer
registers Java compiler and uncaught-exception annotations unless
explicitly enabled with problem-matcher: true.

Fixes #1322

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-13 23:47:17 -05:00
Copilot
5fb63c9bc9 Fix JetBrains Runtime hotfix version selection (#1321)
* Initial plan

* Fix JetBrains hotfix version selection and cache precedence

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Bruno Borges <brborges@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-13 23:33:00 -05:00
Copilot
a1bf0b5568 Add Microsoft OpenJDK 25.0.5.0.2 support (#1320)
* Initial plan

* Support Microsoft OpenJDK 25.0.5.0.2 with bundled manifest fallback

* Fix Microsoft OpenJDK version matching

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Bruno Borges <brborges@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-13 23:30:44 -05:00
dependabot[bot]
a3c8068301 chore(deps): bump fast-xml-parser from 5.11.2 to 5.12.0 (#1323)
* chore(deps): bump fast-xml-parser from 5.11.2 to 5.12.0

Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 5.11.2 to 5.12.0.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v5.11.2...v5.12.0)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-version: 5.12.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix generated dist and license records

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bruno Borges <brborges@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-13 23:15:48 -05:00
v-mahabaleshwars
9ce5b12cb9 Architecture validation for JDK file installs (#1324)
* Enhance architecture validation and error handling

* Improve architecture normalization and validation for custom tokens

* Refactor architecture validation to consolidate error handling for invalid tokens
2026-11-13 23:04:15 -05:00
Bruno Borges
77dd5b2ce2 Support Maven mirrors in generated settings.xml (#1289)
* Support Maven mirrors in generated settings.xml

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 59df028a-0d1b-49cb-8126-ab26408663e4

* Reject Maven mirrors missing selectors after URL authorities

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 59df028a-0d1b-49cb-8126-ab26408663e4

* Use self-repository syntax in Maven mirrors E2E

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 59df028a-0d1b-49cb-8126-ab26408663e4

* Document mvn-mirrors URL scheme and colon encoding requirements

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 59df028a-0d1b-49cb-8126-ab26408663e4

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 59df028a-0d1b-49cb-8126-ab26408663e4
2026-11-04 17:10:04 -05:00
David Phillips
644a850ee5 Support exact Corretto release versions (#1310)
* Support exact Corretto release versions

Corretto users cannot pin the release used by their local builds and
production. Accept full release numbers so a workflow keeps using its
chosen release after Amazon publishes a newer patch.

* Fix Corretto release review findings

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Bruno Borges <brborges@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-04 16:40:21 -05:00
Bruno Borges
dade0c5eef Save uncommitted changes (#1312) 2026-11-04 16:26:30 -05:00
Bruno Borges
ef0b922255 Fix Liberica Java 25 release resolution (#1313)
* Fix Liberica multi-component patch resolution

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Fix Liberica patch version ordering

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-04 16:26:15 -05:00
dependabot[bot]
e144521edf chore(deps): bump the monthly-npm-updates group with 12 updates (#1309)
* chore(deps): bump the monthly-npm-updates group with 12 updates

Bumps the monthly-npm-updates group with 12 updates:

| Package | From | To |
| --- | --- | --- |
| [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache) | `6.2.0` | `6.3.0` |
| [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) | `5.11.1` | `5.11.2` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `26.6.2` | `26.6.5` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.70.1` | `8.72.0` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `8.70.1` | `8.72.0` |
| [eslint](https://github.com/eslint/eslint) | `10.11.0` | `10.13.0` |
| [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) | `29.16.6` | `29.17.0` |
| [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) | `18.3.0` | `18.5.0` |
| [globals](https://github.com/sindresorhus/globals) | `17.12.0` | `17.13.0` |
| [lint-staged](https://github.com/lint-staged/lint-staged) | `17.5.1` | `17.6.0` |
| [prettier](https://github.com/prettier/prettier) | `3.9.9` | `3.9.10` |
| [ts-jest](https://github.com/kulshekhar/ts-jest) | `29.4.13` | `29.4.15` |


Updates `@actions/cache` from 6.2.0 to 6.3.0
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache)

Updates `fast-xml-parser` from 5.11.1 to 5.11.2
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v5.11.1...v5.11.2)

Updates `@types/node` from 26.6.2 to 26.6.5
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@typescript-eslint/eslint-plugin` from 8.70.1 to 8.72.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.72.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.70.1 to 8.72.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.72.0/packages/parser)

Updates `eslint` from 10.11.0 to 10.13.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/compare/v10.11.0...v10.13.0)

Updates `eslint-plugin-jest` from 29.16.6 to 29.17.0
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v29.16.6...v29.17.0)

Updates `eslint-plugin-n` from 18.3.0 to 18.5.0
- [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases)
- [Changelog](https://github.com/eslint-community/eslint-plugin-n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint-community/eslint-plugin-n/compare/v18.3.0...v18.5.0)

Updates `globals` from 17.12.0 to 17.13.0
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v17.12.0...v17.13.0)

Updates `lint-staged` from 17.5.1 to 17.6.0
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lint-staged/lint-staged/compare/v17.5.1...v17.6.0)

Updates `prettier` from 3.9.9 to 3.9.10
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.9.9...3.9.10)

Updates `ts-jest` from 29.4.13 to 29.4.15
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.4.13...v29.4.15)

---
updated-dependencies:
- dependency-name: "@actions/cache"
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: monthly-npm-updates
- dependency-name: fast-xml-parser
  dependency-version: 5.11.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: monthly-npm-updates
- dependency-name: "@types/node"
  dependency-version: 26.6.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: monthly-npm-updates
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-version: 8.72.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: monthly-npm-updates
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.72.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: monthly-npm-updates
- dependency-name: eslint
  dependency-version: 10.13.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: monthly-npm-updates
- dependency-name: eslint-plugin-jest
  dependency-version: 29.17.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: monthly-npm-updates
- dependency-name: eslint-plugin-n
  dependency-version: 18.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: monthly-npm-updates
- dependency-name: globals
  dependency-version: 17.13.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: monthly-npm-updates
- dependency-name: lint-staged
  dependency-version: 17.6.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: monthly-npm-updates
- dependency-name: prettier
  dependency-version: 3.9.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: monthly-npm-updates
- dependency-name: ts-jest
  dependency-version: 29.4.15
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: monthly-npm-updates
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: rebuild dist bundles

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* chore: refresh npm license cache

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bruno Borges <brborges@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-04 15:56:21 -05:00
69 changed files with 187652 additions and 959 deletions

43
.github/copilot-instructions.md vendored Normal file
View File

@@ -0,0 +1,43 @@
# Copilot instructions
## Build, test, and lint
Use Node.js 24 or later (`package.json` declares `>=24.0.0`).
- `npm ci` installs the locked dependencies.
- `npm test` runs Jest serially with coverage.
- `npm test -- --runTestsByPath __tests__/setup-java.test.ts` runs one test file.
- `npm test -- --runTestsByPath __tests__/setup-java.test.ts --testNamePattern="pattern"` filters that file to matching test names.
- `npm run lint` runs ESLint on TypeScript files.
- `npm run format-check` checks Prettier formatting; `npm run format` applies it.
- `npm run build` bundles the setup and post-job entrypoints into `dist/`.
- `npm run check` runs format check, lint, build, and the full test suite.
## Architecture
This repository implements a Node.js GitHub Action. `action.yml` defines its inputs and outputs and runs `dist/setup/index.js` as the main entrypoint and `dist/cleanup/index.js` as the post-job entrypoint. The TypeScript sources in `src/` are bundled with NCC; the committed `dist/` files are what the action executes.
The setup entrypoint parses inputs, resolves versions, and configures the action's shared features. `src/distributions/distribution-factory.ts` lazily selects a vendor installer. Vendor installers implement metadata lookup and archive handling on top of `JavaBase` in `src/distributions/base-installer.ts`, which centralizes version resolution, tool-cache/JDK-cache use, download verification, and Java environment setup. Package support and OS/architecture support are validated centrally in `package-types.ts` and `platform-types.ts`.
The setup flow also configures problem matchers, Maven authentication and arguments, and Maven toolchains. The post-job entrypoint removes any isolated GPG home and saves enabled caches when the job succeeds and cache saving is not read-only.
## Repository-specific conventions
- Keep TypeScript source imports ESM-compatible: relative imports include the `.js` extension, even when the source file is `.ts`.
- Distribution-specific download and metadata logic belongs in its installer under `src/distributions/`; reuse `JavaBase` rather than duplicating common resolution, caching, verification, or environment behavior.
- When adding or changing distribution support, keep the distribution enum, factory, package-capability map, platform-capability map, README support documentation, unit tests, and relevant end-to-end workflow coverage consistent.
- Unit tests live under `__tests__/` and use Jest/ts-jest. Distribution tests are grouped under `__tests__/distributors/`; use the corresponding test and fixture patterns when changing an installer. End-to-end coverage is defined in `.github/workflows/e2e-*.yml`.
- Rebuild and commit generated `dist/` bundles for runtime-affecting source or dependency changes; do not make the bundles the source of truth. `npm run check` includes the build.
- New npm dependencies need lockfile changes and corresponding license records under `.licenses/`, following `.licensed.yml` and the licensed workflow.
## Action behavior principles
- Treat `action.yml` inputs, outputs, defaults, and compatibility aliases as the public API. Keep implementation, README, and advanced-usage documentation aligned when behavior changes; preserve deprecated aliases unless a documented breaking change removes them.
- Do not assume version syntax, package variants, or platform/architecture support is uniform across distributions. Keep capability checks and vendor resolution behavior consistent with the documented support matrix. `latest` means the newest stable GA release, not an early-access build.
- Preserve selection semantics: a recognized vendor in a supported version file may supply the distribution; otherwise the caller must provide it. If both `java-version` and `java-version-file` are given, the explicit `java-version` takes precedence.
- Preserve install-state behavior for multiple JDKs. The last installed JDK becomes the default unless `set-default: false`; all installed JDKs remain available through their version-specific environment variables and Maven toolchains. Toolchain entries accumulate non-destructively, and custom IDs must correspond one-for-one with requested versions.
- Treat dependency, wrapper, and JDK caches as distinct features with distinct keys and save behavior. `cache` enables dependency caching and implicitly enables JDK caching unless `cache-jdk` overrides it; `cache-read-only` restores without saving. Keep changes to cache identity or lifecycle aligned with these documented contracts.
- Preserve download-integrity guarantees: verify authoritative checksums when published. Signature verification is distribution-specific; explicit `verify-signature: true` must enforce verification where supported and fail clearly where unsupported. Do not silently weaken verification or imply that a cached install was downloaded and reverified.
- Keep Maven credential inputs as environment-variable names, not secret values. Generated settings and custom repository behavior must respect the documented overwrite option, while toolchain merging remains non-destructive and independent of that option.
See `docs/CONTRIBUTING.md` for contribution and validation guidance, `README.md` for the public contract, and `docs/advanced-usage.md` for detailed behavior and examples.

View File

@@ -175,6 +175,94 @@ jobs:
throw "settings.xml file is not found in expected location"
}
test-maven-mirrors:
name: Maven mirrors (${{ matrix.mirror-of }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
mirror-of: ['*', 'external:*']
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Configure Maven mirrors without repository inputs
uses: $/
with:
distribution: 'temurin'
java-version: '21'
settings-path: ${{ runner.temp }}/maven-mirror-test
mvn-server-credentials: |
private:PRIVATE_USERNAME:PRIVATE_TOKEN
mvn-mirrors: |
private:https://mirror.example.invalid/maven:${{ matrix.mirror-of }}
- name: Validate generated settings and Maven mirror selection
env:
MIRROR_OF: ${{ matrix.mirror-of }}
PRIVATE_USERNAME: mirror-test-user
PRIVATE_TOKEN: mirror-test-token
run: |
$directory = Join-Path $env:RUNNER_TEMP "maven-mirror-test"
$settingsPath = Join-Path $directory "settings.xml"
[xml]$settings = Get-Content -Path $settingsPath -Raw
$mirrors = @($settings.settings.mirrors.mirror)
if ($mirrors.Count -ne 1 -or $mirrors[0].id -ne "private" -or $mirrors[0].url -ne "https://mirror.example.invalid/maven" -or $mirrors[0].mirrorOf -ne $env:MIRROR_OF) {
throw "Incorrect generated mirror"
}
if ($settings.settings.profiles -or $settings.settings.activeProfiles) {
throw "Mirror-only settings must not add repository profiles"
}
$server = $settings.settings.servers.server
if ($server.id -ne "private" -or $server.username -ne '${env.PRIVATE_USERNAME}' -or $server.password -ne '${env.PRIVATE_TOKEN}') {
throw "Mirror credentials were not preserved"
}
$pomPath = Join-Path $directory "pom.xml"
@'
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>setup-java.test</groupId>
<artifactId>mirror-settings</artifactId>
<version>1.0</version>
<repositories>
<repository>
<id>pom-dependencies</id>
<url>https://dependencies.example.invalid/maven</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>pom-plugins</id>
<url>https://plugins.example.invalid/maven</url>
</pluginRepository>
</pluginRepositories>
</project>
'@ | Set-Content -Path $pomPath
# validate requires no plugins or dependencies, so mirror selection can
# be inspected offline without contacting the deliberately invalid URLs.
$output = & mvn --batch-mode --no-transfer-progress --offline --debug `
--settings $settingsPath --file $pomPath `
"-Dmaven.repo.local=$directory/repository" validate 2>&1
if ($LASTEXITCODE -ne 0) {
throw "Could not inspect Maven mirror selection: $output"
}
$log = $output -join "`n"
foreach ($id in @("central", "pom-dependencies")) {
$expected = "Using mirror private (https://mirror.example.invalid/maven) for $id ("
if (-not $log.Contains($expected)) {
throw "Maven did not select the mirror for ${id}: $log"
}
}
foreach ($type in @("dependencies", "plugins")) {
$pattern = 'Repositories \(' + $type + '\)\s*: \[private \(https://mirror\.example\.invalid/maven, [^\]]+\)\]'
if ($log -notmatch $pattern) {
throw "Maven did not redirect all $type repositories: $log"
}
}
test-maven-repositories:
name: Maven ${{ matrix.repositories }} repositories
runs-on: ${{ matrix.os }}

View File

@@ -51,6 +51,15 @@ jobs:
- distribution: microsoft
os: macos-latest
version: 25
- distribution: microsoft
os: windows-latest
version: '25.0.5+0.2'
- distribution: microsoft
os: ubuntu-latest
version: '25.0.5+0.2'
- distribution: microsoft
os: macos-latest
version: '25.0.5+0.2'
- distribution: kona
os: windows-latest
version: 25
@@ -71,10 +80,14 @@ jobs:
version: 25
- distribution: oracle
os: macos-15-intel
version: 21
version: 25
- distribution: oracle
os: windows-latest
version: 21
version: 25
- distribution: oracle
os: ubuntu-latest
version: 25
# Oracle no longer publishes JDK 21 under /latest, so a major-only request resolves to the archived GA build.
- distribution: oracle
os: ubuntu-latest
version: 21
@@ -118,7 +131,7 @@ jobs:
JAVA_VERSION: ${{ matrix.version }}
JAVA_PATH: ${{ steps.setup-java.outputs.path }}
SETUP_JAVA_VERSION: ${{ steps.setup-java.outputs.version }}
REQUIRE_CONCRETE_VERSION: ${{ (matrix.distribution == 'oracle' || matrix.distribution == 'graalvm') && !contains(matrix.version, '.') && !contains(matrix.version, '-ea') }}
REQUIRE_CONCRETE_VERSION: ${{ ((matrix.distribution == 'oracle' && matrix.version != 21) || matrix.distribution == 'graalvm') && !contains(matrix.version, '.') && !contains(matrix.version, '-ea') }}
run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH" "$SETUP_JAVA_VERSION" "$REQUIRE_CONCRETE_VERSION"
shell: bash

View File

@@ -0,0 +1,225 @@
# Daily report of the exact JDK version each distribution currently resolves
# for every major from Java 6 through the newest GA release, and `latest`, on every operating
# system and architecture setup-java supports for it. Versions are resolved
# from vendor metadata only; no JDK is downloaded. Compare main and the latest
# v6/v5 tags using each revision's own installers and locked dependencies.
name: Latest JDK versions report
on:
schedule:
- cron: '30 6 * * *'
workflow_dispatch:
inputs:
java-versions:
description: 'Comma-separated java-version values (default: every major from Java 6 through the newest GA release, and latest)'
required: false
default: ''
pull_request:
paths:
- 'src/reports/**'
- 'scripts/build-report-resolver.mjs'
- '__tests__/latest-versions-report.test.ts'
- '.github/workflows/latest-jdk-versions.yml'
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build:
name: Build report tool
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24.x'
cache: npm
- name: Install dependencies
run: npm ci
- name: Bundle report tool
run: npm run build:latest-versions-report
- name: Upload report tool
uses: actions/upload-artifact@v7
with:
name: latest-versions-report-tool
path: lib/latest-versions-report/
retention-days: 1
build-resolvers:
name: Build resolver (${{ matrix.setup-java }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
setup-java: [main, v6, v5]
steps:
- name: Checkout report tooling
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Checkout setup-java revision
uses: actions/checkout@v7
with:
repository: actions/setup-java
ref: ${{ matrix.setup-java }}
path: resolver-source
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24.x'
cache: npm
cache-dependency-path: resolver-source/package-lock.json
- name: Install revision dependencies
working-directory: resolver-source
run: npm ci
- name: Bundle revision metadata resolver
run: node scripts/build-report-resolver.mjs resolver-source "$SETUP_JAVA_REF" resolver
env:
SETUP_JAVA_REF: ${{ matrix.setup-java }}
- name: Upload revision metadata resolver
uses: actions/upload-artifact@v7
with:
name: jdk-metadata-resolver-${{ matrix.setup-java }}
path: resolver/
retention-days: 1
resolve:
name: Resolve versions (${{ matrix.setup-java }}, ${{ matrix.platform }})
needs: [build, build-resolvers]
if: ${{ !cancelled() && needs.build.result == 'success' }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
setup-java: [main, v6, v5]
platform: [linux, macos, windows, solaris]
include:
- os: ubuntu-latest
platform: linux
- os: macos-latest
platform: macos
- os: windows-latest
platform: windows
# Liberica's Solaris metadata is queried without running a Solaris JDK.
- os: ubuntu-latest
platform: solaris
steps:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24.x'
- name: Download report tool
uses: actions/download-artifact@v8
with:
name: latest-versions-report-tool
path: tool
- name: Download revision metadata resolver
uses: actions/download-artifact@v8
with:
name: jdk-metadata-resolver-${{ matrix.setup-java }}
path: resolver
- name: Resolve latest versions without downloading
run: node tool/index.js resolve "results/$SETUP_JAVA_REF-$REPORT_PLATFORM.json"
env:
GITHUB_TOKEN: ${{ github.token }}
REPORT_VERSIONS: ${{ inputs.java-versions }}
REPORT_PLATFORM: ${{ matrix.platform }}
REPORT_RESOLVER: resolver
SETUP_JAVA_REF: ${{ matrix.setup-java }}
- name: Upload resolved versions
uses: actions/upload-artifact@v7
with:
name: latest-jdk-versions-${{ matrix.setup-java }}-${{ matrix.platform }}
path: results/
retention-days: 1
# Installers pick musl builds on Alpine, which can resolve to other versions.
resolve-alpine:
name: Resolve versions (${{ matrix.setup-java }}, alpine)
needs: [build, build-resolvers]
if: ${{ !cancelled() && needs.build.result == 'success' }}
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: node:24-alpine
strategy:
fail-fast: false
matrix:
setup-java: [main, v6, v5]
defaults:
run:
shell: sh
steps:
- name: Download report tool
uses: actions/download-artifact@v8
with:
name: latest-versions-report-tool
path: tool
- name: Download revision metadata resolver
uses: actions/download-artifact@v8
with:
name: jdk-metadata-resolver-${{ matrix.setup-java }}
path: resolver
- name: Resolve latest versions without downloading
run: node tool/index.js resolve "results/$SETUP_JAVA_REF-alpine.json"
env:
GITHUB_TOKEN: ${{ github.token }}
REPORT_VERSIONS: ${{ inputs.java-versions }}
REPORT_RESOLVER: resolver
SETUP_JAVA_REF: ${{ matrix.setup-java }}
- name: Upload resolved versions
uses: actions/upload-artifact@v7
with:
name: latest-jdk-versions-${{ matrix.setup-java }}-alpine
path: results/
retention-days: 1
report:
name: Report
needs: [build, build-resolvers, resolve, resolve-alpine]
if: ${{ !cancelled() && needs.build.result == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24.x'
- name: Download report tool
uses: actions/download-artifact@v8
with:
name: latest-versions-report-tool
path: tool
- name: Download resolved versions
uses: actions/download-artifact@v8
with:
pattern: latest-jdk-versions-*
path: results
merge-multiple: true
- name: Write report
if: ${{ !cancelled() }}
run: node tool/index.js summarize results latest-jdk-versions.md
env:
REPORT_REFS: main,v6,v5
- name: Upload report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7
with:
name: latest-jdk-versions-report
path: |
latest-jdk-versions.md
results/
retention-days: 30

View File

@@ -1,6 +1,6 @@
---
name: "@actions/cache"
version: 6.2.0
version: 6.3.0
type: npm
summary: Actions cache lib
homepage: https://github.com/actions/toolkit/tree/main/packages/cache

View File

@@ -1,6 +1,6 @@
---
name: "@azure/core-client"
version: 1.11.0
version: 1.11.1
type: npm
summary: Core library for interfacing with AutoRest generated code
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-client/

View File

@@ -0,0 +1,32 @@
---
name: "@azure/core-rest-pipeline"
version: 1.23.0
type: npm
summary: Isomorphic client library for making HTTP requests in node.js and browser.
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-rest-pipeline/
license: mit
licenses:
- sources: LICENSE
text: |
Copyright (c) Microsoft Corporation.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
notices: []

View File

@@ -1,9 +1,9 @@
---
name: "@azure/storage-blob"
version: 12.33.0
version: 12.31.0
type: npm
summary: Microsoft Azure Storage SDK for JavaScript - Blob
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-blob/README.md
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/
license: mit
licenses:
- sources: LICENSE

View File

@@ -1,6 +1,6 @@
---
name: "@azure/storage-common"
version: 12.4.1
version: 12.5.0
type: npm
summary: Azure Storage Common Client Library for JavaScript
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-common/README.md

View File

@@ -1,6 +1,6 @@
---
name: "@nodable/entities"
version: 3.0.0
version: 3.1.0
type: npm
summary: Entity parser for XML, HTML, External entites with security and NCR control
homepage:

View File

@@ -1,6 +1,6 @@
---
name: "@typespec/ts-http-runtime"
version: 0.3.7
version: 0.3.9
type: npm
summary: Isomorphic client library for making HTTP requests in node.js and browser.
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/ts-http-runtime/README.md

View File

@@ -1,6 +1,6 @@
---
name: fast-xml-builder
version: 1.3.0
version: 1.3.1
type: npm
summary: Build XML from JSON without C/C++ based libraries
homepage:

View File

@@ -1,6 +1,6 @@
---
name: fast-xml-parser
version: 5.11.1
version: 5.12.0
type: npm
summary: Validate XML, Parse XML, Build XML without C/C++ based libraries
homepage:

View File

@@ -1,6 +1,6 @@
---
name: is-unsafe
version: 2.0.0
version: 2.0.3
type: npm
summary: Zero-dependency, DOM-free, pure predicate for detecting unsafe strings across
HTML, XML, SVG, SQL, SHELL, and REGEX contexts

View File

@@ -1,6 +1,6 @@
---
name: strnum
version: 2.4.2
version: 2.5.1
type: npm
summary: Parse String to Number based on configuration
homepage:

View File

@@ -3,6 +3,7 @@
[![Basic validation](https://github.com/actions/setup-java/actions/workflows/basic-validation.yml/badge.svg?branch=main)](https://github.com/actions/setup-java/actions/workflows/basic-validation.yml)
[![Validate Java e2e](https://github.com/actions/setup-java/actions/workflows/e2e-versions.yml/badge.svg?branch=main)](https://github.com/actions/setup-java/actions/workflows/e2e-versions.yml)
[![Validate cache](https://github.com/actions/setup-java/actions/workflows/e2e-cache.yml/badge.svg?branch=main)](https://github.com/actions/setup-java/actions/workflows/e2e-cache.yml)
[![Latest JDK versions report](https://github.com/actions/setup-java/actions/workflows/latest-jdk-versions.yml/badge.svg?branch=main)](https://github.com/actions/setup-java/actions/workflows/latest-jdk-versions.yml)
Set up Java for GitHub Actions workflows. `setup-java` installs a requested Java distribution, adds it to `PATH`, configures `JAVA_HOME`, and can optionally cache build dependencies for Apache Maven, Gradle, and sbt; generate Maven publishing configuration, verify JDK package signatures, manage multiple JDKs, and manage Maven toolchains.
@@ -59,7 +60,7 @@ steps:
- Warm JDK-cached jobs can reuse cached release metadata, avoiding vendor API calls while retaining a stale-metadata fallback for vendor outages and rate limits.
- Maven configuration now supports multiple server credentials and custom dependency-resolution repositories.
- Maven signing keys are imported into an isolated temporary GPG home instead of the runner's default keyring.
- Set `problem-matcher: false` to disable Java compiler and uncaught-exception annotations.
- Java compiler and uncaught-exception annotations are now disabled by default. Set `problem-matcher: true` to enable them.
- GraalVM distributions now set `GRAALVM_HOME` in addition to `JAVA_HOME`.
- Invalid boolean values, unsupported distribution/package/platform combinations, and mismatched Maven toolchain ID counts now fail with targeted errors.
- Renamed environment-variable-name inputs so they are not mistaken for secret values:
@@ -155,7 +156,7 @@ steps:
| `check-latest` | Check remote metadata for the latest version satisfying the version spec before using the runner tool cache. | `false` |
| `force-download` | Always download Java and replace any matching version in the tool cache. | `false` |
| `set-default` | Add Java to `PATH` and set `JAVA_HOME`. When `false`, only version-specific `JAVA_HOME_<major>_<arch>` variables are set. | `true` |
| `problem-matcher` | Register Java compiler and uncaught exception problem matchers. | `true` |
| `problem-matcher` | Register Java compiler and uncaught exception problem matchers. | `false` |
| `verify-signature` | Verify downloaded Java package signatures when supported. Explicitly setting this to `true` makes verification failures fatal. | Distribution-dependent; see [Download integrity and signatures](#download-integrity-and-signatures) |
| `verify-signature-public-key` | One or more ASCII-armored GPG public keys used for signature verification. Concatenate multiple armored key blocks. Custom keys replace the bundled distribution keys. | |
| `token` | Token for fetching GitHub.com-hosted version manifests, useful on GitHub Enterprise Server when unauthenticated requests are rate-limited. | `${{ github.token }}` on GitHub.com; empty string on GHES |
@@ -171,6 +172,7 @@ steps:
| `mvn-server-repository-origins` | Multiline Maven credential origins in the format `server-id:repository-origin`. Each origin must belong to a configured server ID. Requires Maven 3.10+. | |
| `mvn-repositories` | Multiline Maven dependency repositories in the format `repository-id:repository-url:snapshots-enabled`. | |
| `mvn-plugin-repositories` | Multiline Maven plugin repositories in the format `repository-id:repository-url:snapshots-enabled`. Can be used independently of `mvn-repositories`. | |
| `mvn-mirrors` | Multiline Maven mirrors in the format `mirror-id:mirror-url:mirror-of`. Redirect matching dependency and plugin repositories; use a matching server ID for authentication. | |
| `mvn-repositories-include-central` | Include Maven Central for dependency and plugin repositories in the generated profile. When `false`, Central is disabled for both types unless that type explicitly declares `central`. Has no effect when neither repository list is configured. | `true` |
| `mvn-repositories-prioritize-central` | Place Maven Central before custom dependency and plugin repositories. Has no effect when Central is excluded or neither repository list is configured. | `true` |
| `settings-path` | Directory where `settings.xml` is written. | `~/.m2` |
@@ -224,6 +226,7 @@ Additional distribution notes:
- Oracle OpenJDK builds are archived after a limited number of releases and no longer receive security updates. To continue receiving security patches, use Oracle JDK or another vendor.
- Azul Zulu maps `arm64` to `aarch64` when querying the Azul Metadata API.
- Microsoft Build of OpenJDK uses Microsoft's live version manifest, falling back to the bundled version list when no release matches. Version `25.0.5.0.2` can also be requested as `25.0.5+0.2`.
- GraalVM Community is available as `distribution: graalvm-community` for stable JDK 17 and later releases.
- On Ubuntu runners, commands executed with `sudo` do not inherit the `JAVA_HOME` and `PATH` set by `setup-java` and may fall back to the system-default JDK.
@@ -243,6 +246,10 @@ When `check-latest` is `false`, the action first tries the runner tool cache for
GitHub-hosted runners primarily pre-cache Eclipse Temurin JDKs. See the installed Java versions for [Ubuntu](https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#java), [Windows](https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-Readme.md#java), and [macOS](https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#java). On a fresh GitHub-hosted runner, requests for other distributions usually miss the tool cache and resolve from remote metadata. For broad version ranges such as a major version (`21`, `25`), this often behaves similarly to `check-latest: true` because the action downloads the latest available release that satisfies the range.
To see which exact version a request resolves to today, open the summary of the latest run of the daily [Latest JDK versions report](https://github.com/actions/setup-java/actions/workflows/latest-jdk-versions.yml) workflow. It compares `setup-java@main`, the latest `setup-java@v6`, and the latest `setup-java@v5`, with separate sections and the exact commit checked for each. Each revision uses its own installers and locked dependencies to resolve vendor metadata for every major from Java 6 through the newest stable GA release (including non-LTS releases), plus `latest`, across its distributions, operating systems and architectures, including Alpine Linux and Solaris. Older revisions without capability maps probe all candidate architectures; unsupported combinations and version syntax (such as `latest` in v5) are marked `n/a`. Distribution support and resolved versions can differ between action revisions as well as platforms. Missing reports and lookup failures are shown explicitly. The report doesn't download any JDKs. Floating vendor URLs are marked when their exact version cannot be established from metadata alone. It shows what a job installs on a tool-cache miss or with `check-latest: true`.
The `latest-jdk-versions-report` artifact contains the full Markdown report and per-revision/platform JSON results. If the combined report exceeds GitHub's job-summary size limit, the summary shows an overview pointing to this artifact instead.
## Download integrity and signatures
`setup-java` automatically verifies downloaded archive checksums when a selected distribution publishes an authoritative checksum. Automatic checksum verification currently applies to `temurin`, `semeru`, `corretto`, `dragonwell`, `kona`, `sapmachine`, `graalvm`, `graalvm-community`, `zulu`, `oracle`, `oracle-openjdk`, `microsoft`, and `jetbrains`.
@@ -490,6 +497,11 @@ match `mvn-server-credentials` IDs when authentication is required.
See [Resolving Maven dependencies from custom repositories](docs/advanced-usage.md#resolving-maven-dependencies-from-custom-repositories)
and [Resolving Maven plugins from custom repositories](docs/advanced-usage.md#resolving-maven-plugins-from-custom-repositories).
To redirect repositories, including Central and repositories declared in project
or parent POMs, use [`mvn-mirrors`](docs/advanced-usage.md#redirecting-maven-repositories-with-mirrors).
It works independently of the repository inputs; a `mirrorOf` pattern of `*`
routes all dependency and plugin repositories through the configured mirror.
> [!WARNING]
> `mvn-repositories-include-central: false` now disables inherited Maven Central
> for **both dependencies and plugins**, even in existing workflows that only

View File

@@ -882,6 +882,186 @@ describe('auth tests', () => {
]);
});
it.each([
'*',
'central',
'external:*',
'external:http:*',
'*,!internal',
'external:*,!internal',
'!internal,external:http:*',
'external:*,!external:http:*'
])('preserves the mirror selector %s and URL colons', mirrorOf => {
expect(
auth.parseMavenMirrors([
'',
' \t ',
` private : https://[2001:db8::1]:8443/maven : ${mirrorOf} `,
'public:https://repo.example.com:443/releases:central'
])
).toEqual([
{
id: 'private',
url: 'https://[2001:db8::1]:8443/maven',
mirrorOf
},
{
id: 'public',
url: 'https://repo.example.com:443/releases',
mirrorOf: 'central'
}
]);
});
it.each([
'https://repo.example.com:8443',
'https://repo.example.com:8443/maven',
'https://[2001:db8::1]',
'https://[2001:db8::1]/maven',
'https://[2001:db8::1]:8443',
'https://[2001:db8::1]:8443/maven',
'https://repo.example.com/maven?redirect=https%3A//upstream.example.com%3A8443',
'https://repo.example.com/maven#urn%3Aartifact',
'https://repo.example.com/maven?redirect=https://upstream.example.com:8443',
'https://repo.example.com/maven#urn:artifact'
])('preserves the complete mirror URL %s with an explicit selector', url => {
expect(
auth.parseMavenMirrors([`private:${url}:external:http:*,!internal`])
).toEqual([{id: 'private', url, mirrorOf: 'external:http:*,!internal'}]);
});
it.each([
'private',
'private:https://repo.example.com',
'private:https://repo.example.com:8443',
'private:https://repo.example.com:8443/maven',
'private:https://[2001:db8::1]',
'private:https://[2001:db8::1]/maven',
'private:https://[2001:db8::1]:8443',
'private:https://[2001:db8::1]:8443/maven',
'private:repo.example.com:central',
':https://repo.example.com:*',
'private::*',
'private:https://repo.example.com:',
'private: :*',
'private:https://repo.example.com: '
])('rejects malformed mirror entry %s with a line number', entry => {
expect(() => auth.parseMavenMirrors(['', entry])).toThrow(
'Invalid mvn-mirrors entry at line 2.'
);
});
it('rejects duplicate mirror IDs after trimming', () => {
expect(() =>
auth.parseMavenMirrors([
'private:https://first.example.com:*',
' private :https://second.example.com:central'
])
).toThrow("Duplicate mirror-id 'private' in mvn-mirrors input at line 2");
});
it('leaves settings unchanged for absent or blank mirrors', () => {
const servers = credentials('github', 'USERNAME', 'PASSWORD');
expect(auth.parseMavenMirrors(['', ' ', '\t'])).toEqual([]);
expect(auth.generate(servers, undefined, undefined, [])).toBe(
auth.generate(servers)
);
expect(auth.generate(servers)).not.toContain('<mirrors>');
});
it('generates public mirrors without credentials or repository profiles', () => {
const mirrors = auth.parseMavenMirrors([
'public:https://repo.example.com:external:*',
'fallback:https://other.example.com:central'
]);
const xml = auth.generate([], undefined, undefined, mirrors);
expect(parseXmlObject(xml)).toMatchObject({
settings: {mirrors: {mirror: mirrors}}
});
expect(xml).not.toContain('<profiles>');
expect(xml).not.toContain('<activeProfiles>');
});
it('escapes all mirror fields as XML text', () => {
const mirror = {
id: 'private<&>',
url: 'https://repo.example.com/maven?a=1&b=<value>',
mirrorOf: '*,!internal<&>'
};
const xml = auth.generate([], undefined, undefined, [mirror]);
expect(xml).toContain('<id>private&lt;&amp;&gt;</id>');
expect(xml).toContain('a=1&amp;b=&lt;value&gt;');
expect(xml).toContain('<mirrorOf>*,!internal&lt;&amp;&gt;</mirrorOf>');
expect(parseXmlObject(xml)).toMatchObject({
settings: {mirrors: {mirror}}
});
});
it.each([
{combined: false, overwrite: true},
{combined: true, overwrite: true},
{combined: true, overwrite: false}
])(
'configures mirrors with combined=$combined and overwrite=$overwrite',
async ({combined, overwrite}) => {
const directory = path.join(m2Dir, 'mirrors');
const location = path.join(directory, MVN_SETTINGS_FILE);
fs.mkdirSync(directory, {recursive: true});
fs.writeFileSync(location, 'EXISTING SETTINGS');
const url = 'https://maven.example.com/releases';
const inputs: Record<string, string> = {
'settings-path': directory,
'overwrite-settings': String(overwrite),
'mvn-repositories-include-central': 'false',
...(combined ? {'gpg-passphrase-env-var': 'GPG_PASSPHRASE'} : {})
};
const multilineInputs: Record<string, string[]> = {
'mvn-server-credentials': ['private:PRIVATE_USERNAME:PRIVATE_TOKEN'],
'mvn-mirrors': [`private:${url}:*`],
...(combined
? {
'mvn-repositories': [`private:${url}:false`],
'mvn-plugin-repositories': [`private:${url}:false`]
}
: {})
};
jest.mocked(core.getInput).mockImplementation(name => inputs[name] ?? '');
jest
.mocked(core.getMultilineInput)
.mockImplementation(name => multilineInputs[name] ?? []);
await auth.configureAuthentication();
const xml = fs.readFileSync(location, 'utf8');
if (!overwrite) {
expect(xml).toBe('EXISTING SETTINGS');
return;
}
expect(parseXmlObject(xml)).toMatchObject({
settings: {
mirrors: {mirror: {id: 'private', url, mirrorOf: '*'}},
servers: {
server: {
id: 'private',
username: '${env.PRIVATE_USERNAME}',
password: '${env.PRIVATE_TOKEN}'
}
}
}
});
if (combined) {
expect(xml).toContain('<repositories>');
expect(xml).toContain('<pluginRepositories>');
expect(xml).toContain('<gpg.passphraseEnvName>GPG_PASSPHRASE');
} else {
expect(xml).not.toContain('<profiles>');
expect(core.getInput).not.toHaveBeenCalledWith(
'mvn-repositories-include-central'
);
}
}
);
it.each(repositoryInputs)(
'parses %s while preserving colons in URLs',
inputName => {

View File

@@ -244,19 +244,282 @@ describe('getAvailableVersions', () => {
).rejects.toThrow('Early access versions are not supported');
});
it('with non major version expect to throw not supported error', async () => {
const version = '18.0.1';
it.each(['18.0.1', '17.0.13.11', '17.0.13.11.1.1'])(
'rejects partial or malformed release %s',
async version => {
const distribution = new CorrettoDistribution({
version,
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
mockPlatform(distribution, 'linux');
await expect(
distribution['findPackageForDownload'](version)
).rejects.toThrow(
'Specify a major version or a full Corretto release, such as 25.0.5.0.10'
);
}
);
it.each([
[
'25.0.5.0.10',
'linux',
'x64',
'jdk',
'25.0.5+0.10',
'https://corretto.aws/downloads/resources/25.0.5.0.10/amazon-corretto-25.0.5.0.10-linux-x64.tar.gz'
],
[
'25.0.5+0.10',
'macos',
'arm64',
'jdk',
'25.0.5+0.10',
'https://corretto.aws/downloads/resources/25.0.5.0.10/amazon-corretto-25.0.5.0.10-macosx-aarch64.tar.gz'
],
[
'17.0.2.8.1',
'windows',
'x64',
'jdk',
'17.0.2+8.1',
'https://corretto.aws/downloads/resources/17.0.2.8.1/amazon-corretto-17.0.2.8.1-windows-x64-jdk.zip'
],
[
'25.0.5.0.10',
'alpine',
'aarch64',
'jdk',
'25.0.5+0.10',
'https://corretto.aws/downloads/resources/25.0.5.0.10/amazon-corretto-25.0.5.0.10-alpine-linux-aarch64.tar.gz'
],
[
'11.0.14.10.1',
'linux',
'armv7',
'jdk',
'11.0.14+10.1',
'https://corretto.aws/downloads/resources/11.0.14.10.1/amazon-corretto-11.0.14.10.1-linux-armv7.tar.gz'
],
[
'8.472.8+1',
'linux',
'x64',
'jdk',
'8.472.8+1',
'https://corretto.aws/downloads/resources/8.472.08.1/amazon-corretto-8.472.08.1-linux-x64.tar.gz'
],
[
'8.472.08.1',
'linux',
'x64',
'jdk',
'8.472.8+1',
'https://corretto.aws/downloads/resources/8.472.08.1/amazon-corretto-8.472.08.1-linux-x64.tar.gz'
],
[
'8.472.08.1',
'windows',
'x86',
'jre',
'8.472.8+1',
'https://corretto.aws/downloads/resources/8.472.08.1/amazon-corretto-8.472.08.1-windows-x86-jre.zip'
]
])(
'resolves exact release %s on %s/%s (%s)',
async (
requestedVersion,
platform,
architecture,
packageType,
expectedVersion,
url
) => {
const checksum = 'a'.repeat(64);
spyHttpClient.mockResolvedValue({
statusCode: 200,
headers: {},
result: {
body: `|JDK|[archive](${url})|\`md5\` /<br /> \`${checksum}\`|`
}
});
const distribution = new CorrettoDistribution({
version: requestedVersion,
architecture,
packageType,
checkLatest: false
});
mockPlatform(distribution, platform);
const release = await distribution['findPackageForDownload'](
distribution['version']
);
const rawVersion = new URL(url).pathname.split('/')[3];
const source = `https://api.github.com/repos/corretto/corretto-${rawVersion.split('.')[0]}/releases/tags/${rawVersion}`;
expect(release).toEqual({
version: expectedVersion,
url,
checksum: {algorithm: 'sha256', value: checksum, source}
});
expect(spyHttpClient).toHaveBeenCalledTimes(1);
expect(spyHttpClient).toHaveBeenCalledWith(
source,
expect.objectContaining({accept: 'application/vnd.github+json'})
);
}
);
it('rejects exact releases without an archive for the requested platform', async () => {
spyHttpClient.mockResolvedValueOnce({
statusCode: 200,
headers: {},
result: {
body:
'|[other archive](https://example.com/archive)|`' +
'a'.repeat(64) +
'`|'
}
});
const distribution = new CorrettoDistribution({
version,
version: '25.0.5.0.10',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
mockPlatform(distribution, 'linux');
await expect(
distribution['findPackageForDownload'](distribution['version'])
).rejects.toThrow(
'No linux/x64 jdk archive is listed for Corretto 25.0.5.0.10'
);
});
it('rejects historical archives with only an MD5 checksum', async () => {
spyHttpClient.mockResolvedValueOnce({
statusCode: 200,
headers: {},
result: {
body:
'|[archive](https://corretto.aws/downloads/resources/17.0.1.12.1/amazon-corretto-17.0.1.12.1-linux-x64.tar.gz)|`' +
'a'.repeat(32) +
'`|'
}
});
const distribution = new CorrettoDistribution({
version: '17.0.1.12.1',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
mockPlatform(distribution, 'linux');
await expect(
distribution['findPackageForDownload'](distribution['version'])
).rejects.toThrow(
'No SHA-256 checksum is published for Corretto 17.0.1.12.1 (linux, x64, jdk)'
);
});
it('does not substitute a JDK for an exact Linux JRE request', async () => {
const distribution = new CorrettoDistribution({
version: '25.0.5.0.10',
architecture: 'x64',
packageType: 'jre',
checkLatest: false
});
mockPlatform(distribution, 'linux');
await expect(
distribution['findPackageForDownload'](distribution['version'])
).rejects.toThrow('Corretto JRE archives are only available for Windows');
expect(spyHttpClient).not.toHaveBeenCalled();
});
it('resolves catalog-only releases without a GitHub release', async () => {
spyHttpClient.mockResolvedValueOnce({
statusCode: 404,
headers: {},
result: null
});
const distribution = new CorrettoDistribution({
version: '15.0.2.7.1',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
mockPlatform(distribution, 'linux');
expect(
await distribution['findPackageForDownload'](distribution['version'])
).toEqual({
version: '15.0.2+7.1',
url: 'https://corretto.aws/downloads/resources/15.0.2.7.1/amazon-corretto-15.0.2.7.1-linux-x64.tar.gz',
checksum: {
algorithm: 'sha256',
value: manifestData.linux.x64.jdk['15']['tar.gz'].checksum_sha256,
source:
'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json'
}
});
});
it('falls back to the catalog when the GitHub lookup fails', async () => {
spyHttpClient.mockRejectedValueOnce(new Error('GitHub rate limit'));
const distribution = new CorrettoDistribution({
version: '15.0.2.7.1',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
mockPlatform(distribution, 'linux');
expect(
await distribution['findPackageForDownload'](distribution['version'])
).toEqual({
version: '15.0.2+7.1',
url: 'https://corretto.aws/downloads/resources/15.0.2.7.1/amazon-corretto-15.0.2.7.1-linux-x64.tar.gz',
checksum: {
algorithm: 'sha256',
value: manifestData.linux.x64.jdk['15']['tar.gz'].checksum_sha256,
source:
'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json'
}
});
expect(spyHttpClient).toHaveBeenCalledTimes(2);
});
it('reports missing release metadata without substituting the latest release', async () => {
spyHttpClient.mockResolvedValueOnce({
statusCode: 404,
headers: {},
result: null
});
const distribution = new CorrettoDistribution({
version: '17.0.0.0.999',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
mockPlatform(distribution, 'linux');
await expect(
distribution['findPackageForDownload'](version)
).rejects.toThrow('Only major versions are supported');
distribution['findPackageForDownload'](distribution['version'])
).rejects.toThrow(
"Corretto release 17.0.0.0.999 was not found in Amazon's GitHub releases or current download catalog"
);
});
it('does not normalize zero-padded major-only inputs', () => {
expect(
() =>
new CorrettoDistribution({
version: '08',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
})
).toThrow(
"The string '08' is not valid SemVer notation for a Java version"
);
});
it('with unfound version throw could not find error', async () => {

View File

@@ -9,6 +9,9 @@ import {
afterAll
} from '@jest/globals';
import https from 'https';
import fs from 'fs';
import os from 'os';
import path from 'path';
import {HttpClient, HttpClientResponse} from '@actions/http-client';
import type {IncomingMessage} from 'http';
import {Readable} from 'stream';
@@ -476,6 +479,109 @@ describe('findPackageForDownload', () => {
}
);
describe('hotfix releases', () => {
beforeEach(() => {
jest.spyOn(HttpClient.prototype, 'getJson').mockResolvedValue({
statusCode: 200,
headers: {},
result: [
release('jbr-release-25.0.4b508.27', false),
release('jbr-release-25.0.4.1b635.9', false),
release('jbr-release-25.0.4.1b635.79', false),
release('jbr-release-25.0.3.2b1000.1', false)
]
});
jest.spyOn(HttpClient.prototype, 'head').mockResolvedValue(response(200));
});
it.each(['linux', 'osx', 'windows'])(
'selects the patched JBR archive and checksum on %s',
async platform => {
const distribution = new JetBrainsDistribution({
version: '25',
architecture: 'x64',
packageType: 'jdk',
checkLatest: true
});
distribution['getPlatformOption'] = () => platform;
const url = `https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-25.0.4.1-${platform}-x64-b635.79.tar.gz`;
const result = await distribution['findPackageForDownload']('25');
expect(result).toEqual({
version: '25.0.4+1.635.79',
url,
checksum: {
algorithm: 'sha512',
value: JETBRAINS_CHECKSUM,
source: `${url}.checksum`
}
});
expect(HttpClient.prototype.head).toHaveBeenCalledWith(url);
expect(spyHttpClientGet).toHaveBeenCalledTimes(1);
expect(spyHttpClientGet).toHaveBeenCalledWith(`${url}.checksum`);
}
);
it.each([
['latest', '25.0.4+1.635.79'],
['25.0.4', '25.0.4+1.635.79'],
['25.0.4.0', '25.0.4+508.27'],
['25.0.4.1', '25.0.4+1.635.79'],
['25.0.4.1+635.79', '25.0.4+1.635.79'],
['25.0.4+1.635.9', '25.0.4+1.635.9'],
['25.0.4+508.27', '25.0.4+508.27']
])('resolves %s to %s', async (input, expected) => {
const distribution = new JetBrainsDistribution({
version: input,
architecture: 'x64',
packageType: 'jdk',
checkLatest: true
});
await expect(
distribution['findPackageForDownload'](distribution['version'])
).resolves.toMatchObject({version: expected});
});
it('resolves early-access hotfix releases separately', async () => {
jest.spyOn(HttpClient.prototype, 'getJson').mockResolvedValue({
statusCode: 200,
headers: {},
result: [
release('jbr-release-25.0.4.1b635.79', true),
release('jbr-release-25.0.4.2b636.1', false)
]
});
const distribution = new JetBrainsDistribution({
version: '25.0.4.1-ea',
architecture: 'x64',
packageType: 'jdk',
checkLatest: true
});
await expect(
distribution['findPackageForDownload'](distribution['version'])
).resolves.toMatchObject({version: '25.0.4+1.635.79'});
});
it.each(['25.0.4.2', '25.0.4.1+635.80'])(
'does not substitute another patch or build for %s',
async input => {
const distribution = new JetBrainsDistribution({
version: input,
architecture: 'x64',
packageType: 'jdk',
checkLatest: true
});
await expect(
distribution['findPackageForDownload'](distribution['version'])
).rejects.toThrow(/No matching version found/);
}
);
});
it('version is not found', async () => {
const distribution = new JetBrainsDistribution({
version: '8.0.452',
@@ -569,4 +675,84 @@ describe('findPackageForDownload', () => {
source: `${result.url}.checksum`
});
});
describe('compareVersions', () => {
it.each([
['25.0.4+1.635.79', '25.0.4+508.27', 1],
['25.0.5+1.1', '25.0.4+1.635.79', 1],
['25.0.4+10.1.1', '25.0.4+2.999.99', 1],
['25.0.4+1.635.79', '25.0.4+1.635.9', 1],
['25.0.4+1.636.1', '25.0.4+1.635.79', 1],
['25.0.4+0.635.79', '25.0.4+635.79', 0],
['11.0.11+1522', '11.0.11+1522.1', -1],
['25.0.4', '25.0.4+508.27', -1]
])('compares %s with %s', (first, second, expected) => {
const distribution = new JetBrainsDistribution({
version: '25',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
expect(Math.sign(distribution['compareVersions'](first, second))).toBe(
expected
);
expect(
Math.sign(distribution['compareVersions'](second, first)) || 0
).toBe(-expected || 0);
});
});
describe('hotfix releases in the tool cache', () => {
let cacheRoot: string;
const previousToolcache = process.env['RUNNER_TOOL_CACHE'];
beforeEach(async () => {
cacheRoot = await fs.promises.mkdtemp(
path.join(os.tmpdir(), 'jetbrains-')
);
process.env['RUNNER_TOOL_CACHE'] = cacheRoot;
for (const version of ['25.0.4-508.27', '25.0.4-1.635.79']) {
const javaPath = path.join(
cacheRoot,
'Java_JetBrains_jdk',
version,
'x64'
);
await fs.promises.mkdir(javaPath, {recursive: true});
await fs.promises.writeFile(`${javaPath}.complete`, '');
}
});
afterEach(async () => {
if (previousToolcache === undefined) {
delete process.env['RUNNER_TOOL_CACHE'];
} else {
process.env['RUNNER_TOOL_CACHE'] = previousToolcache;
}
await fs.promises.rm(cacheRoot, {recursive: true, force: true});
});
it.each(['25', '25.0.4.1', '25.0.4.1+635.79'])(
'reuses the patched JBR for %s',
input => {
const distribution = new JetBrainsDistribution({
version: input,
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
expect(distribution['findInToolcache']()).toEqual({
version: '25.0.4+1.635.79',
path: path.join(
cacheRoot,
'Java_JetBrains_jdk',
'25.0.4-1.635.79',
'x64'
)
});
}
);
});
});

View File

@@ -320,6 +320,60 @@ describe('findPackageForDownload', () => {
});
});
it('selects the latest multi-component patch release for Java 25', async () => {
const releases: LibericaVersion[] = [
'25.0.5+11',
'25.0.5.0.2+5',
'25.0.5.0.3+5'
].map(version => {
const [versionWithoutBuild, buildVersion] = version.split('+');
const [featureVersion, interimVersion, updateVersion] =
versionWithoutBuild.split('.').map(Number);
return {
version,
featureVersion,
interimVersion,
updateVersion,
buildVersion: Number(buildVersion),
downloadUrl: `https://download.bell-sw.com/java/${version}/jdk.tar.gz`
};
});
distribution['getAvailableVersions'] = async () => releases;
await expect(distribution['findPackageForDownload']('25')).resolves.toEqual(
{
version: '25.0.5+0.3.5',
url: 'https://download.bell-sw.com/java/25.0.5.0.3+5/jdk.tar.gz'
}
);
});
it('compares patch components before build numbers when patch lengths differ', async () => {
const releases: LibericaVersion[] = ['25.0.5.1+10', '25.0.5.1.1+1'].map(
version => {
const [versionWithoutBuild, buildVersion] = version.split('+');
const [featureVersion, interimVersion, updateVersion] =
versionWithoutBuild.split('.').map(Number);
return {
version,
featureVersion,
interimVersion,
updateVersion,
buildVersion: Number(buildVersion),
downloadUrl: `https://download.bell-sw.com/java/${version}/jdk.tar.gz`
};
}
);
distribution['getAvailableVersions'] = async () => releases;
await expect(
distribution['findPackageForDownload']('25.0.5')
).resolves.toEqual({
version: '25.0.5+1.1.1',
url: 'https://download.bell-sw.com/java/25.0.5.1.1+1/jdk.tar.gz'
});
});
it('should throw an error', async () => {
await expect(distribution['findPackageForDownload']('17')).rejects.toThrow(
/No matching version found for SemVer/
@@ -431,6 +485,39 @@ describe('patch request resolution from the constructor', () => {
expect(distribution['version']).toBe('17.0.20.1');
});
it('normalizes multi-component patch-only requests for exact matching', async () => {
const releases: LibericaVersion[] = ['25.0.5.0.2+5', '25.0.5.0.3+5'].map(
version => {
const [versionWithoutBuild, buildVersion] = version.split('+');
const [featureVersion, interimVersion, updateVersion] =
versionWithoutBuild.split('.').map(Number);
return {
version,
featureVersion,
interimVersion,
updateVersion,
buildVersion: Number(buildVersion),
downloadUrl: `https://download.bell-sw.com/java/${version}/jdk.tar.gz`
};
}
);
const distribution = new LibericaDistributions({
version: '25.0.5.0.3',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
distribution['getAvailableVersions'] = async () => releases;
expect(distribution['version']).toBe('25.0.5.0.3');
await expect(
distribution['findPackageForDownload'](distribution['version'])
).resolves.toEqual({
version: '25.0.5+0.3.5',
url: 'https://download.bell-sw.com/java/25.0.5.0.3+5/jdk.tar.gz'
});
});
it('orders main versions, patches, and builds consistently in cache', async () => {
for (const version of ['17.0.20-1.2', '17.0.20-1.10', '17.0.21-1']) {
const javaPath = path.join(
@@ -577,6 +664,16 @@ describe('convertVersionToSemver', () => {
},
'25.0.4+1.1'
],
[
{
version: '25.0.5.0.3+5',
featureVersion: 25,
interimVersion: 0,
updateVersion: 5,
buildVersion: 5
},
'25.0.5+0.3.5'
],
[
{
version: '17.0.20.1+2',

View File

@@ -216,6 +216,172 @@ describe('findPackageForDownload', () => {
expect(result.signatureUrl).toBe(`${url}.sig`);
});
describe.each(['25.0.5.0.2', '25.0.5+0.2', '25.0.5'])(
'version %s missing from the live manifest',
version => {
it.each([
['darwin', 'x64', 'macos', 'tar.gz'],
['linux', 'x64', 'linux', 'tar.gz'],
['win32', 'x64', 'windows', 'zip'],
['darwin', 'aarch64', 'macos', 'tar.gz'],
['linux', 'aarch64', 'linux', 'tar.gz'],
['win32', 'aarch64', 'windows', 'zip']
])(
'resolves the bundled release for %s/%s',
async (platform, architecture, osType, extension) => {
mockOsPlatform.mockReturnValue(platform);
const distro = new MicrosoftDistributions({
version,
architecture,
packageType: 'jdk',
checkLatest: false
});
const result = await distro['findPackageForDownload'](
distro['version']
);
const url = `https://aka.ms/download-jdk/microsoft-jdk-25.0.5.0.2-${osType}-${architecture}.${extension}`;
expect(result).toEqual({
version: '25.0.5+0.2',
url,
signatureUrl: `${url}.sig`,
checksum: {
algorithm: 'sha256',
value: MICROSOFT_CHECKSUM,
source: `${url}.sha256sum.txt`
}
});
expect(spyHttpClientGet).toHaveBeenCalledWith(`${url}.sha256sum.txt`);
}
);
}
);
it('prefers the live manifest when it contains the requested release', async () => {
mockOsPlatform.mockReturnValue('linux');
const url =
'https://example.test/microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz';
spyGetManifestFromRepo.mockResolvedValue({
result: [
{
version: '25.0.5+0.2',
stable: true,
release_url: 'https://aka.ms/download-jdk',
files: [
{
filename: 'microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz',
arch: 'x64',
platform: 'linux',
download_url: url
}
]
}
],
statusCode: 200,
headers: {}
});
const result = await distribution['findPackageForDownload']('25.0.5+0.2');
expect(result.version).toBe('25.0.5+0.2');
expect(result.url).toBe(url);
expect(spyGetManifestFromRepo).toHaveBeenCalledWith(
'https://aka.ms/download-jdk/microsoft-openjdk-versions.json',
{accept: 'application/json'}
);
});
it('falls back to the bundled build when the live manifest has another build', async () => {
mockOsPlatform.mockReturnValue('linux');
spyGetManifestFromRepo.mockResolvedValue({
result: [
{
version: '25.0.5+0.3',
stable: true,
release_url: 'https://aka.ms/download-jdk',
files: [
{
filename: 'microsoft-jdk-25.0.5.0.3-linux-x64.tar.gz',
arch: 'x64',
platform: 'linux',
download_url:
'https://example.test/microsoft-jdk-25.0.5.0.3-linux-x64.tar.gz'
}
]
}
],
statusCode: 200,
headers: {}
});
const result = await distribution['findPackageForDownload']('25.0.5+0.2');
expect(result.version).toBe('25.0.5+0.2');
expect(result.url).toBe(
'https://aka.ms/download-jdk/microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz'
);
});
it('matches dotted Java versions without falling back to the base release', async () => {
mockOsPlatform.mockReturnValue('linux');
spyGetManifestFromRepo.mockResolvedValue({
result: [
{
version: '17.0.8',
stable: true,
release_url: 'https://aka.ms/download-jdk',
files: [
{
filename: 'microsoft-jdk-17.0.8-linux-x64.tar.gz',
arch: 'x64',
platform: 'linux',
download_url: 'https://example.test/microsoft-jdk-17.0.8.tar.gz'
}
]
},
{
version: '17.0.8.1',
stable: true,
release_url: 'https://aka.ms/download-jdk',
files: [
{
filename: 'microsoft-jdk-17.0.8.1-linux-x64.tar.gz',
arch: 'x64',
platform: 'linux',
download_url: 'https://example.test/microsoft-jdk-17.0.8.1.tar.gz'
}
]
}
],
statusCode: 200,
headers: {}
});
distribution = new MicrosoftDistributions({
version: '17.0.8.1',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
});
const result = await distribution['findPackageForDownload'](
distribution['version']
);
expect(result.version).toBe('17.0.8+1');
expect(result.url).toBe(
'https://example.test/microsoft-jdk-17.0.8.1.tar.gz'
);
});
it('preserves the error when the live manifest cannot be loaded', async () => {
spyGetManifestFromRepo.mockRejectedValue(new Error('Network error'));
await expect(
distribution['findPackageForDownload']('25.0.5+0.2')
).rejects.toThrow('Could not load manifest for Microsoft Build of OpenJDK');
});
it.each([
['amd64', 'x64'],
['arm64', 'aarch64']

View File

@@ -185,6 +185,19 @@ describe('findPackageForDownload', () => {
expect(spyHttpClientGet).toHaveBeenCalledTimes(1);
});
it('warns when a major-only request falls back to the archived GA release', async () => {
spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
spyHttpClient
.mockResolvedValueOnce({message: {statusCode: 404}})
.mockResolvedValueOnce({message: {statusCode: 200}});
await distribution['findPackageForDownload']('21');
expect(core.warning).toHaveBeenCalledWith(
'Oracle JDK 21 is no longer available from the latest endpoint. Falling back to its archived GA release, which may not include security updates.'
);
});
it('always resolves major-only requests remotely', () => {
expect(distribution['requiresRemoteResolution']()).toBe(true);
const exactDistribution = new OracleDistribution({

View File

@@ -272,7 +272,7 @@ describe('findPackageForDownload', () => {
}
);
it.each(['zos', 'z/OS', 'z/os', 'test0987654321=', '++=++', 'myArch'])(
it.each(['zos', 'myArch'])(
'incorrect Semeru `%s` architecture throws',
async (arch: string) => {
const distribution = new SemeruDistribution({

View File

@@ -31,6 +31,36 @@ describe('Java platform capabilities', () => {
expect(normalizeArchitecture(input)).toBe(expected);
});
it.each(['constructor', 'Constructor'])(
'preserves custom architecture token %s for jdkfile',
architecture => {
expect(normalizeArchitecture(architecture)).toBe(architecture);
expect(validateJavaPlatform('jdkfile', 'linux', architecture, '17')).toBe(
architecture
);
}
);
it.each([
'x64<<end\nvalue\nend',
'z/OS',
'z/os',
'test0987654321=',
'++=++',
'../x64',
'x64\\other',
'x64 other',
'-x64',
'_x64'
])('rejects invalid architecture token %s', architecture => {
const message = `Unsupported architecture value: ${JSON.stringify(architecture)}`;
expect(() => normalizeArchitecture(architecture)).toThrow(message);
expect(() =>
validateJavaPlatform('jdkfile', 'linux', architecture, '17')
).toThrow(message);
});
it.each([
['linux', false, 'linux-glibc'],
['linux', true, 'linux-musl'],

View File

@@ -0,0 +1,658 @@
import {afterEach, describe, expect, it, jest} from '@jest/globals';
import {HttpClient, HttpClientResponse} from '@actions/http-client';
import fs from 'fs';
import os from 'os';
import path from 'path';
import {IncomingMessage} from 'http';
import {Socket} from 'net';
import {JavaBase} from '../src/distributions/base-installer.js';
import {
currentResolver,
loadMetadataResolver,
type MetadataResolver
} from '../src/reports/resolver.js';
import {
classifyResolutionError,
getDefaultVersions,
getSupportedArchitectures,
renderMarkdownReport,
ResolutionReport,
resolveLatestVersions,
VersionResolution
} from '../src/reports/latest-versions.js';
function result(
overrides: Partial<VersionResolution> &
Pick<VersionResolution, 'distribution' | 'versionSpec'>
): VersionResolution {
return {
platform: 'linux',
architecture: 'x64',
status: 'resolved',
...overrides
};
}
function report(
platform: string,
results: VersionResolution[]
): ResolutionReport {
return {
source: {ref: 'main'},
platform,
generatedAt: '2026-11-18T06:30:00.000Z',
results
};
}
function tableRows(markdown: string, distribution: string): string[] {
const section = markdown.split(`## \`${distribution}\``)[1].split('\n## ')[0];
return section.split('\n').filter(line => /^\| (?!Platform|---)/.test(line));
}
describe('latest versions report', () => {
afterEach(() => {
jest.restoreAllMocks();
jest.useRealTimers();
});
it('includes every major from Java 6 through GA, including non-LTS releases but not EA', async () => {
jest.spyOn(HttpClient.prototype, 'getJson').mockResolvedValue({
statusCode: 200,
headers: {},
result: {
most_recent_feature_release: 27,
most_recent_feature_version: 28,
most_recent_lts: 25
}
});
await expect(getDefaultVersions(new HttpClient())).resolves.toEqual([
'6',
'7',
'8',
'9',
'10',
'11',
'12',
'13',
'14',
'15',
'16',
'17',
'18',
'19',
'20',
'21',
'22',
'23',
'24',
'25',
'26',
'27',
'latest'
]);
});
it('fails rather than publishing incomplete defaults when discovery fails', async () => {
jest
.spyOn(HttpClient.prototype, 'getJson')
.mockRejectedValue(new Error('Java release metadata is unavailable'));
await expect(getDefaultVersions(new HttpClient())).rejects.toThrow(
'Java release metadata is unavailable'
);
});
it.each([5, 27.5, Infinity])(
'rejects invalid newest major %s',
async major => {
jest.spyOn(HttpClient.prototype, 'getJson').mockResolvedValue({
statusCode: 200,
headers: {},
result: {most_recent_feature_release: major}
});
await expect(getDefaultVersions(new HttpClient())).rejects.toThrow(
'Invalid newest Java feature release'
);
}
);
it('resolves Solaris metadata and combines its exact builds with every other platform', async () => {
const getJson = jest
.spyOn(HttpClient.prototype, 'getJson')
.mockResolvedValue({
statusCode: 200,
headers: {},
result: [
{
downloadUrl: 'https://example.com/solaris-jdk8-old.tar.gz',
version: '8.0.452+9',
featureVersion: 8,
interimVersion: 0,
updateVersion: 452,
buildVersion: 9
},
{
downloadUrl: 'https://example.com/solaris-jdk8.tar.gz',
version: '8.0.462+10',
featureVersion: 8,
interimVersion: 0,
updateVersion: 462,
buildVersion: 10
},
{
downloadUrl: 'https://example.com/solaris-jdk9.tar.gz',
version: '9.0.4+11',
featureVersion: 9,
interimVersion: 0,
updateVersion: 4,
buildVersion: 11
}
]
});
const install = jest
.spyOn(JavaBase.prototype, 'setupJava')
.mockRejectedValue(new Error('The report must not install a JDK'));
const network = jest
.spyOn(HttpClient.prototype, 'request')
.mockRejectedValue(
new Error('Only the mocked metadata request is permitted')
);
const hostPlatform = process.platform;
const solaris = await resolveLatestVersions({
distributions: ['liberica'],
versions: ['8', '9', '11', 'latest'],
platform: 'solaris'
});
expect(solaris.platform).toBe('solaris');
expect(solaris.results).toEqual([
result({
distribution: 'liberica',
platform: 'solaris',
versionSpec: '8',
version: '8.0.462+10'
}),
result({
distribution: 'liberica',
platform: 'solaris',
versionSpec: '9',
version: '9.0.4+11'
}),
expect.objectContaining({
platform: 'solaris',
versionSpec: '11',
status: 'unavailable'
}),
result({
distribution: 'liberica',
platform: 'solaris',
versionSpec: 'latest',
version: '9.0.4+11'
})
]);
expect(getJson).toHaveBeenCalledTimes(1);
const url = new URL(getJson.mock.calls[0][0]);
expect(url.origin).toBe('https://api.bell-sw.com');
expect(Object.fromEntries(url.searchParams)).toMatchObject({
os: 'solaris',
arch: 'x86',
bitness: '64',
'bundle-type': 'jdk',
'installation-type': 'archive'
});
expect(install).not.toHaveBeenCalled();
expect(network).not.toHaveBeenCalled();
expect(process.platform).toBe(hostPlatform);
const otherReports = ['linux', 'linux-musl', 'macos', 'windows'].map(
(platform, index) =>
report(
platform,
['8', '9', '11', 'latest'].map(versionSpec =>
result({
distribution: 'liberica',
platform,
versionSpec,
version: `${versionSpec === 'latest' ? '11' : versionSpec}.0.1+${index + 1}`
})
)
)
);
const markdown = renderMarkdownReport([solaris, ...otherReports]);
expect(tableRows(markdown, 'liberica')).toEqual([
'| Linux x64 | `8.0.1+1` | `9.0.1+1` | `11.0.1+1` | `11.0.1+1` |',
'| Alpine Linux x64 | `8.0.1+2` | `9.0.1+2` | `11.0.1+2` | `11.0.1+2` |',
'| macOS x64 | `8.0.1+3` | `9.0.1+3` | `11.0.1+3` | `11.0.1+3` |',
'| Windows x64 | `8.0.1+4` | `9.0.1+4` | `11.0.1+4` | `11.0.1+4` |',
'| Solaris x64 | `8.0.462+10` | `9.0.4+11` | — | `9.0.4+11` |'
]);
expect(markdown).not.toContain('Needs attention');
expect(markdown).not.toContain('Not checked');
});
it('classifies missing releases separately from lookup failures', () => {
const notFound = new Error("No matching version found for SemVer '8'.");
notFound.name = 'VersionNotFoundError';
expect(classifyResolutionError(notFound)).toBe('unavailable');
expect(
classifyResolutionError(
new Error('Oracle JDK is only supported for JDK 17 and later')
)
).toBe('unsupported');
expect(
classifyResolutionError(
new Error(
'No Kona release for the specified version "27" on OS "macos" and arch "aarch64".'
)
)
).toBe('unavailable');
expect(classifyResolutionError(new Error('socket hang up'))).toBe('error');
});
it('resolves Alpine with the Linux architectures, including version-restricted ones', () => {
expect(getSupportedArchitectures('redhat', 'linux-musl')).toEqual([
'x64',
'aarch64',
'ppc64le'
]);
expect(getSupportedArchitectures('dragonwell', 'macos')).toEqual([]);
});
it('lists the exact version for every platform, ordered by operating system and architecture', () => {
const markdown = renderMarkdownReport([
report('macos', [
result({
distribution: 'temurin',
versionSpec: '21',
platform: 'macos',
architecture: 'aarch64',
version: '21.0.13+100000002.0.LTS'
})
]),
report('linux', [
result({
distribution: 'temurin',
versionSpec: '21',
architecture: 's390x',
version: '21.0.12+7'
}),
result({
distribution: 'temurin',
versionSpec: '21',
version: '21.0.13+9'
})
]),
report('linux-musl', [
result({
distribution: 'temurin',
versionSpec: '21',
platform: 'linux-musl',
version: '21.0.13+9'
})
])
]);
expect(tableRows(markdown, 'temurin')).toEqual([
'| Linux x64 | `21.0.13+9` |',
'| Linux s390x | `21.0.12+7` |',
'| Alpine Linux x64 | `21.0.13+9` |',
'| macOS aarch64 | `21.0.13+100000002.0.LTS` |'
]);
expect(markdown).not.toContain('Needs attention');
expect(markdown).toContain(
'Not checked, because no runner reported these platforms: Windows (x64, x86, aarch64).'
);
});
it('distinguishes unsupported, unpublished, and floating releases', () => {
const markdown = renderMarkdownReport([
report('linux', [
result({
distribution: 'redhat',
versionSpec: '11',
architecture: 'aarch64',
version: '11.0.29'
}),
result({
distribution: 'redhat',
versionSpec: '25',
architecture: 'aarch64',
status: 'unsupported'
}),
result({
distribution: 'oracle',
versionSpec: '11',
status: 'unavailable'
}),
result({
distribution: 'oracle',
versionSpec: '25',
version: '25',
floating: true,
advertisedVersion: '25.0.5.1',
publishedAt: '2026-10-27'
})
])
]);
expect(tableRows(markdown, 'redhat')).toEqual([
'| Linux aarch64 | `11.0.29` | n/a |'
]);
expect(tableRows(markdown, 'oracle')).toEqual([
'| Linux x64 | — | `25.0.5.1` ¹ (published 2026-10-27) |'
]);
expect(markdown).toContain('¹ Major-only requests download');
});
it('reports lookup errors and distributions that resolved nothing', () => {
const markdown = renderMarkdownReport([
report('linux', [
result({
distribution: 'oracle-openjdk',
versionSpec: '25',
status: 'unavailable'
}),
result({
distribution: 'zulu',
versionSpec: '25',
status: 'error',
message: 'socket hang up\nstack'
})
])
]);
expect(markdown).toContain('## `oracle-openjdk` ❗');
expect(tableRows(markdown, 'zulu')).toEqual(['| Linux x64 | ❗ error |']);
expect(markdown).toContain(
'| `oracle-openjdk` | all | all | No release matched any requested version'
);
expect(markdown).toContain(
'| `zulu` | `25` | Linux x64 | socket hang up |'
);
});
it('uses the selected revision without substituting main for unsupported version syntax', async () => {
const mainFactory = jest.spyOn(currentResolver, 'getJavaDistribution');
const lookup = jest.fn(async () => ({
version: '21.0.8+9',
url: 'https://example.com/jdk.tar.gz'
}));
const legacy: MetadataResolver = {
source: {ref: 'v5', sha: 'a'.repeat(40), version: '5.6.0'},
distributions: ['adopt'],
getJavaDistribution: (_distribution, options) => {
if (options.version === 'latest') {
throw new Error("The string 'latest' is not valid SemVer notation");
}
return {
version: options.version,
http: new HttpClient(),
findPackageForDownload: lookup
};
},
createSolarisInstaller: () => {
throw new Error('Unexpected Solaris lookup');
}
};
const resolved = await resolveLatestVersions({
resolver: legacy,
distributions: legacy.distributions,
versions: ['21', 'latest'],
architectures: ['x64']
});
expect(resolved.source).toEqual(legacy.source);
expect(resolved.results).toEqual([
expect.objectContaining({
distribution: 'adopt',
versionSpec: '21',
version: '21.0.8+9'
}),
expect.objectContaining({
distribution: 'adopt',
versionSpec: 'latest',
status: 'unsupported'
})
]);
expect(lookup).toHaveBeenCalledTimes(1);
expect(lookup).toHaveBeenCalledWith('21');
expect(mainFactory).not.toHaveBeenCalled();
expect(getSupportedArchitectures('adopt', 'linux', legacy)).toContain(
's390x'
);
expect(getSupportedArchitectures('redhat', 'linux', legacy)).toEqual([]);
});
it('marks legacy mutable Oracle URLs as floating instead of reporting a major as exact', async () => {
const response = new IncomingMessage(new Socket());
response.headers['last-modified'] = 'Tue, 27 Oct 2026 00:00:00 GMT';
jest
.spyOn(HttpClient.prototype, 'head')
.mockResolvedValue(new HttpClientResponse(response));
jest.spyOn(HttpClient.prototype, 'getJson').mockResolvedValue({
statusCode: 200,
headers: {},
result: {releaseVersion: '25.0.1', licenseDetails: {licenseType: 'NFTC'}}
});
const resolved = await resolveLatestVersions({
resolver: {
...currentResolver,
source: {ref: 'v5'},
getJavaDistribution: () => ({
version: '25',
http: new HttpClient(),
findPackageForDownload: async () => ({
version: '25',
url: 'https://download.oracle.com/java/25/latest/jdk-25_linux-x64_bin.tar.gz'
})
})
},
distributions: ['oracle'],
versions: ['25'],
architectures: ['x64']
});
expect(resolved.results[0]).toMatchObject({
status: 'resolved',
floating: true,
advertisedVersion: '25.0.1',
publishedAt: '2026-10-27'
});
});
it('refuses to install if a revision crosses the metadata boundary', async () => {
const download = jest.fn();
const installer = {
version: '21',
http: new HttpClient(),
downloadTool: download,
async findPackageForDownload() {
this.downloadTool();
return {version: '21', url: 'https://example.com/jdk.tar.gz'};
}
};
const resolved = await resolveLatestVersions({
resolver: {...currentResolver, getJavaDistribution: () => installer},
distributions: ['temurin'],
versions: ['21'],
architectures: ['x64']
});
expect(resolved.results[0]).toMatchObject({
status: 'error',
message: 'JDK download/install is forbidden in the versions report.'
});
expect(download).not.toHaveBeenCalled();
});
it('records stalled legacy endpoints as errors and does not retry them for every major', async () => {
jest.useFakeTimers();
const request = jest
.spyOn(HttpClient.prototype, 'getJson')
.mockImplementation(() => new Promise(() => {}));
const dispose = jest.spyOn(HttpClient.prototype, 'dispose');
const pending = resolveLatestVersions({
resolver: {
...currentResolver,
getJavaDistribution: (_distribution, options) => ({
version: options.version,
http: new HttpClient(),
async findPackageForDownload() {
await this.http.getJson('https://example.com/retired-api');
throw new Error('Unreachable');
}
})
},
distributions: ['temurin'],
versions: ['17', '21'],
architectures: ['x64']
});
await jest.advanceTimersByTimeAsync(60_000);
const resolved = await pending;
expect(resolved.results).toEqual([
expect.objectContaining({
versionSpec: '17',
status: 'error',
message: expect.stringContaining('Metadata request timed out')
}),
expect.objectContaining({
versionSpec: '21',
status: 'error',
message: expect.stringContaining('Metadata request timed out')
})
]);
expect(request).toHaveBeenCalledTimes(1);
expect(dispose).toHaveBeenCalledTimes(1);
});
it('keeps different revision results and failures separate, including missing runners', () => {
const main = report('linux', [
result({distribution: 'temurin', versionSpec: '21', version: '21.0.13+9'})
]);
const v6 = {
...report('linux', [
result({
distribution: 'temurin',
versionSpec: '21',
version: '21.0.12+7'
})
]),
source: {ref: 'v6', sha: 'b'.repeat(40), version: '6.0.0'}
};
const v5 = {
...report('linux', [
result({
distribution: 'adopt',
versionSpec: '21',
status: 'unavailable'
}),
result({
distribution: 'temurin',
versionSpec: '21',
status: 'error',
message: 'metadata failed'
})
]),
source: {ref: 'v5', sha: 'a'.repeat(40), version: '5.6.0'},
targets: {adopt: {linux: ['x64'], windows: ['x64']}}
};
const markdown = renderMarkdownReport([main, v6, v5]);
const mainSection = markdown
.split('<summary>setup-java@main</summary>')[1]
.split('</details>')[0];
const v6Section = markdown
.split('<summary>setup-java@v6</summary>')[1]
.split('</details>')[0];
const v5Section = markdown
.split('<summary>setup-java@v5</summary>')[1]
.split('</details>')[0];
expect(mainSection).toContain('`21.0.13+9`');
expect(mainSection).not.toContain('Needs attention');
expect(v6Section).toContain('`21.0.12+7`');
expect(v6Section).not.toContain('`21.0.13+9`');
expect(v5Section).toContain('metadata failed');
expect(v5Section).toContain('## `adopt` ❗');
expect(v5Section).toContain(
'Not checked, because no runner reported these platforms: Windows (x64).'
);
expect(markdown).toContain(
`https://github.com/actions/setup-java/commit/${'a'.repeat(40)}`
);
});
it('shows missing revisions and rejects mixed commits within one revision', () => {
const main = report('linux', []);
expect(
renderMarkdownReport([main], {expectedRefs: ['main', 'v6', 'v5']})
).toContain('| `v5` | - | - | Not checked: no reports received |');
expect(() =>
renderMarkdownReport([
{...main, source: {ref: 'v6', sha: 'a'.repeat(40)}},
{...main, source: {ref: 'v6', sha: 'b'.repeat(40)}}
])
).toThrow("Reports for 'v6' were produced from different revisions.");
});
it.each(['module', 'commonjs'])(
'loads a separate %s resolver with its provenance',
async type => {
const directory = fs.mkdtempSync(
path.join(os.tmpdir(), 'setup-java resolver-')
);
try {
fs.writeFileSync(
path.join(directory, 'package.json'),
JSON.stringify({type})
);
const source = {ref: 'v5', sha: 'a'.repeat(40), version: '5.6.0'};
fs.writeFileSync(
path.join(directory, 'index.js'),
`
const source = ${JSON.stringify(source)};
const distributions = ['adopt'];
const getJavaDistribution = () => 'selected checkout';
const createSolarisInstaller = () => null;
${type === 'module' ? 'export' : 'module.exports ='}
{source, distributions, getJavaDistribution, createSolarisInstaller};
`
);
const loaded = await loadMetadataResolver(directory);
expect(loaded.source).toEqual(source);
expect(
loaded.getJavaDistribution('adopt', {
version: '21',
architecture: 'x64',
packageType: 'jdk',
checkLatest: true
})
).toBe('selected checkout');
} finally {
fs.rmSync(directory, {recursive: true, force: true});
}
}
);
it('fails explicitly instead of falling back to main when the resolver bundle is invalid', async () => {
const directory = fs.mkdtempSync(
path.join(os.tmpdir(), 'setup-java resolver-')
);
try {
fs.writeFileSync(
path.join(directory, 'package.json'),
'{"type":"module"}'
);
fs.writeFileSync(
path.join(directory, 'index.js'),
'export const source = {ref: "v5"};'
);
await expect(loadMetadataResolver(directory)).rejects.toThrow(
'Invalid metadata resolver bundle'
);
} finally {
fs.rmSync(directory, {recursive: true, force: true});
}
});
});

View File

@@ -27,7 +27,16 @@ describe('configureProblemMatcher', () => {
jest.resetAllMocks();
});
it('registers the Java problem matcher by default', () => {
it('does not register the Java problem matcher by default', () => {
configureProblemMatcher('/matchers/java.json');
expect(mockInfo).not.toHaveBeenCalled();
expect(mockDebug).toHaveBeenCalledWith('Java problem matcher is disabled');
});
it('registers the Java problem matcher when explicitly enabled', () => {
inputs[INPUT_PROBLEM_MATCHER] = 'true';
configureProblemMatcher('/matchers/java.json');
expect(mockInfo).toHaveBeenCalledWith('##[add-matcher]/matchers/java.json');

View File

@@ -278,6 +278,28 @@ describe('validatePaginationUrl', () => {
});
describe('getVersionFromFileContent', () => {
it.each(['25.0.5.0.10', '8.472.08.1', '25.0.5+0.10'])(
'preserves full Corretto release %s in .java-version',
version => {
expect(
getVersionFromFileContent(version, 'corretto', '.java-version')
).toEqual({version, distribution: undefined});
}
);
it.each([
['17.0.3.1', '.java-version', '17'],
['1.8.0.472.1', '.java-version', '8'],
['8.0.472.08.1', '.java-version', '8'],
['8.0.282+8', '.java-version', '8'],
['java corretto-17.0.13.11.1-jre', '.tool-versions', '17'],
['java corretto-17.0.13.11.1+1', '.tool-versions', '17']
])('keeps the existing major selection for %s', (content, file, version) => {
expect(getVersionFromFileContent(content, 'corretto', file)?.version).toBe(
version
);
});
describe('.sdkmanrc', () => {
it.each([
['java=26-tem', '26', 'temurin'],
@@ -290,6 +312,8 @@ describe('getVersionFromFileContent', () => {
['java=21.0.5-zulu', '21.0.5', 'zulu'],
['java=17.0.13-albba', '17.0.13', 'dragonwell'],
['java=17.0.13-amzn', '17', 'corretto'],
['java=25.0.5.0.10-amzn', '25.0.5.0.10', 'corretto'],
['java=8.472.08.1-amzn', '8.472.08.1', 'corretto'],
['java=21.0.5-graal', '21.0.5', 'graalvm'],
['java=17.0.9-graalce', '17.0.9', 'graalvm'],
['java=11.0.25-librca', '11.0.25', 'liberica'],
@@ -368,7 +392,8 @@ describe('getVersionFromFileContent', () => {
['java adoptopenjdk-11.0.16+8', '11.0.16+8', 'temurin'],
['java adoptopenjdk-openj9-11.0.16+8', '11.0.16+8', 'temurin'],
['java zulu-11.56.19', '11.56.19', 'zulu'],
['java corretto-17.0.13.11.1', '17', 'corretto'], // corretto -> major only
['java corretto-17.0.13.11.1', '17.0.13.11.1', 'corretto'],
['java corretto-8.472.08.1', '8.472.08.1', 'corretto'],
['java liberica-11.0.15+10', '11.0.15+10', 'liberica'],
['java microsoft-11.0.13.8.1', '11.0.13', 'microsoft'],
['java semeru-openj9-11.0.25+9', '11.0.25+9', 'semeru'],

View File

@@ -15,6 +15,13 @@ EXPECTED_PATH=$2
SETUP_JAVA_VERSION=$3
REQUIRE_CONCRETE_VERSION=$4
if [[ $EXPECTED_JAVA_VERSION == *"+"* ]] && [ "$SETUP_JAVA_VERSION" != "$EXPECTED_JAVA_VERSION" ]; then
echo "::error::The version output does not match the requested build"
echo "Requested version: $EXPECTED_JAVA_VERSION"
echo "Version output: $SETUP_JAVA_VERSION"
exit 1
fi
EXPECTED_JAVA_VERSION=$(echo $EXPECTED_JAVA_VERSION | cut -d'+' -f1)
if [[ $EXPECTED_JAVA_VERSION == 8 ]] || [[ $EXPECTED_JAVA_VERSION == 8.* ]]; then
EXPECTED_JAVA_VERSION="1.${EXPECTED_JAVA_VERSION}"

View File

@@ -75,6 +75,9 @@ inputs:
mvn-plugin-repositories:
description: 'Multiline list of Maven plugin repositories in the format `repository-id:repository-url:snapshots-enabled`.'
required: false
mvn-mirrors:
description: 'Multiline list of Maven mirrors in the format `mirror-id:mirror-url:mirror-of`. The URL must include a scheme; percent-encode colons in its path, query, or fragment. Use a matching server ID for authentication. Can be used independently of repository inputs.'
required: false
mvn-repositories-include-central:
description: 'Include Maven Central for dependency and plugin repositories in the generated profile. When false, Central is disabled for both types unless that type explicitly declares ID `central`. Has no effect when neither repository list is configured.'
required: false
@@ -135,9 +138,9 @@ inputs:
required: false
default: false
problem-matcher:
description: 'Whether to register the Java problem matcher (compiler errors/warnings and uncaught exceptions). Set to "false" to disable annotations.'
description: 'Whether to register the Java problem matcher (compiler errors/warnings and uncaught exceptions). Disabled by default; set to "true" to enable annotations.'
required: false
default: true
default: false
outputs:
distribution:
description: 'Distribution of Java that has been installed'

63446
dist/cleanup/230.index.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -21,8 +21,8 @@ var external_fs_default = /*#__PURE__*/__webpack_require__.n(external_fs_);
// EXTERNAL MODULE: external "path"
var external_path_ = __webpack_require__(6928);
var external_path_default = /*#__PURE__*/__webpack_require__.n(external_path_);
// EXTERNAL MODULE: ./node_modules/@actions/cache/lib/cache.js + 291 modules
var lib_cache = __webpack_require__(5767);
// EXTERNAL MODULE: ./node_modules/@actions/cache/lib/cache.js + 323 modules
var lib_cache = __webpack_require__(8230);
// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js + 7 modules
var lib_core = __webpack_require__(3838);
// EXTERNAL MODULE: ./src/util.ts

View File

@@ -15,7 +15,7 @@ export const modules = {
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6928);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5767);
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8230);
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3838);

View File

@@ -13,7 +13,7 @@ export const modules = {
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(857);
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(os__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5767);
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8230);
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3838);
/* harmony import */ var _actions_glob__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2377);
/**

63317
dist/cleanup/80.index.js vendored Normal file

File diff suppressed because it is too large Load Diff

38
dist/cleanup/index.js vendored
View File

@@ -31144,7 +31144,7 @@ module.exports = {
/* harmony export */ gk: () => (/* binding */ INPUT_CACHE),
/* harmony export */ wG: () => (/* binding */ INPUT_JOB_STATUS)
/* harmony export */ });
/* unused harmony exports MACOS_JAVA_CONTENT_POSTFIX, INPUT_JAVA_VERSION, INPUT_JAVA_VERSION_FILE, INPUT_ARCHITECTURE, INPUT_JAVA_PACKAGE, INPUT_DISTRIBUTION, INPUT_JDK_FILE, INPUT_JDK_FILE_DEPRECATED, INPUT_CHECK_LATEST, INPUT_FORCE_DOWNLOAD, INPUT_SET_DEFAULT, INPUT_PROBLEM_MATCHER, INPUT_VERIFY_SIGNATURE, INPUT_VERIFY_SIGNATURE_PUBLIC_KEY, SIGNATURE_VERIFICATION_DOCUMENTATION_URL, SIGNATURE_VERIFICATION_FAILURE_HELP, INPUT_MVN_SERVER_CREDENTIALS, INPUT_MVN_SERVER_REPOSITORY_ORIGINS, INPUT_MVN_REPOSITORIES, INPUT_MVN_PLUGIN_REPOSITORIES, INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL, INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL, INPUT_SERVER_ID, INPUT_SERVER_USERNAME_ENV_VAR, INPUT_SERVER_PASSWORD_ENV_VAR, INPUT_SERVER_USERNAME_DEPRECATED, INPUT_SERVER_PASSWORD_DEPRECATED, INPUT_SETTINGS_PATH, INPUT_OVERWRITE_SETTINGS, INPUT_GPG_PRIVATE_KEY, INPUT_GPG_PASSPHRASE_ENV_VAR, INPUT_GPG_PASSPHRASE_DEPRECATED, INPUT_DEFAULT_SERVER_USERNAME, INPUT_DEFAULT_SERVER_PASSWORD, INPUT_DEFAULT_GPG_PRIVATE_KEY, INPUT_DEFAULT_GPG_PASSPHRASE, MAVEN_GPG_PASSPHRASE_DEFAULT_ENV, GPG_PASSPHRASE_PROFILE_ID, MAVEN_REPOSITORIES_PROFILE_ID, MAVEN_CENTRAL_REPOSITORY_ID, MAVEN_CENTRAL_REPOSITORY_URL, INPUT_CACHE_DEPENDENCY_PATH, INPUT_CACHE_PATH, M2_DIR, MVN_SETTINGS_FILE, MVN_TOOLCHAINS_FILE, INPUT_MVN_TOOLCHAIN_ID, INPUT_MVN_TOOLCHAIN_VENDOR, INPUT_SHOW_DOWNLOAD_PROGRESS, MAVEN_ARGS_ENV, MAVEN_NO_TRANSFER_PROGRESS_FLAG, MAVEN_NO_TRANSFER_PROGRESS_LONG_FLAG, DISTRIBUTIONS_ONLY_MAJOR_VERSION */
/* unused harmony exports MACOS_JAVA_CONTENT_POSTFIX, INPUT_JAVA_VERSION, INPUT_JAVA_VERSION_FILE, INPUT_ARCHITECTURE, INPUT_JAVA_PACKAGE, INPUT_DISTRIBUTION, INPUT_JDK_FILE, INPUT_JDK_FILE_DEPRECATED, INPUT_CHECK_LATEST, INPUT_FORCE_DOWNLOAD, INPUT_SET_DEFAULT, INPUT_PROBLEM_MATCHER, INPUT_VERIFY_SIGNATURE, INPUT_VERIFY_SIGNATURE_PUBLIC_KEY, SIGNATURE_VERIFICATION_DOCUMENTATION_URL, SIGNATURE_VERIFICATION_FAILURE_HELP, INPUT_MVN_SERVER_CREDENTIALS, INPUT_MVN_SERVER_REPOSITORY_ORIGINS, INPUT_MVN_REPOSITORIES, INPUT_MVN_PLUGIN_REPOSITORIES, INPUT_MVN_MIRRORS, INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL, INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL, INPUT_SERVER_ID, INPUT_SERVER_USERNAME_ENV_VAR, INPUT_SERVER_PASSWORD_ENV_VAR, INPUT_SERVER_USERNAME_DEPRECATED, INPUT_SERVER_PASSWORD_DEPRECATED, INPUT_SETTINGS_PATH, INPUT_OVERWRITE_SETTINGS, INPUT_GPG_PRIVATE_KEY, INPUT_GPG_PASSPHRASE_ENV_VAR, INPUT_GPG_PASSPHRASE_DEPRECATED, INPUT_DEFAULT_SERVER_USERNAME, INPUT_DEFAULT_SERVER_PASSWORD, INPUT_DEFAULT_GPG_PRIVATE_KEY, INPUT_DEFAULT_GPG_PASSPHRASE, MAVEN_GPG_PASSPHRASE_DEFAULT_ENV, GPG_PASSPHRASE_PROFILE_ID, MAVEN_REPOSITORIES_PROFILE_ID, MAVEN_CENTRAL_REPOSITORY_ID, MAVEN_CENTRAL_REPOSITORY_URL, INPUT_CACHE_DEPENDENCY_PATH, INPUT_CACHE_PATH, M2_DIR, MVN_SETTINGS_FILE, MVN_TOOLCHAINS_FILE, INPUT_MVN_TOOLCHAIN_ID, INPUT_MVN_TOOLCHAIN_VENDOR, INPUT_SHOW_DOWNLOAD_PROGRESS, MAVEN_ARGS_ENV, MAVEN_NO_TRANSFER_PROGRESS_FLAG, MAVEN_NO_TRANSFER_PROGRESS_LONG_FLAG, DISTRIBUTIONS_ONLY_MAJOR_VERSION */
const MACOS_JAVA_CONTENT_POSTFIX = 'Contents/Home';
const INPUT_JAVA_VERSION = 'java-version';
const INPUT_JAVA_VERSION_FILE = 'java-version-file';
@@ -31165,6 +31165,7 @@ const INPUT_MVN_SERVER_CREDENTIALS = 'mvn-server-credentials';
const INPUT_MVN_SERVER_REPOSITORY_ORIGINS = 'mvn-server-repository-origins';
const INPUT_MVN_REPOSITORIES = 'mvn-repositories';
const INPUT_MVN_PLUGIN_REPOSITORIES = 'mvn-plugin-repositories';
const INPUT_MVN_MIRRORS = 'mvn-mirrors';
const INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL = 'mvn-repositories-include-central';
const INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL = 'mvn-repositories-prioritize-central';
const INPUT_SERVER_ID = 'server-id';
@@ -31220,7 +31221,7 @@ const DISTRIBUTIONS_ONLY_MAJOR_VERSION = (/* unused pure expression or super */
/* harmony export */ Vt: () => (/* binding */ getBooleanInput),
/* harmony export */ lN: () => (/* binding */ isJdkCacheEnabled)
/* harmony export */ });
/* unused harmony exports getVersionFromToolcachePath, extractJdkFile, cacheJdkDir, getJavaVersionFromReleaseFile, getDownloadArchiveExtension, isVersionSatisfies, getToolcachePath, isGhes, getVersionFromFileContent, convertVersionToSemver, normalizeJavaVersionToSemver, getArtifactFingerprint, getGitHubToken, getGitHubHttpHeaders, MAX_PAGINATION_PAGES, getNextPageUrlFromLinkHeader, validatePaginationUrl, renameWinArchive, getLatestMajorVersion */
/* unused harmony exports getVersionFromToolcachePath, extractJdkFile, cacheJdkDir, getJavaVersionFromReleaseFile, getDownloadArchiveExtension, isVersionSatisfies, getToolcachePath, isGhes, getVersionFromFileContent, isExactCorrettoVersion, convertVersionToSemver, normalizeJavaVersionToSemver, getArtifactFingerprint, getGitHubToken, getGitHubHttpHeaders, MAX_PAGINATION_PAGES, getNextPageUrlFromLinkHeader, validatePaginationUrl, renameWinArchive, getLatestMajorVersion */
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(857);
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(os__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(6928);
@@ -31527,6 +31528,15 @@ function getVersionFromFileContent(content, distributionName, versionFile) {
}
const tentativeVersion = avoidOldNotation(capturedVersion);
const rawVersion = tentativeVersion.split('-')[0];
// Preserve Corretto's full vendor release before generic coercion drops its extra numeric fields.
if ((extractedDistribution || distributionName) === 'corretto' &&
capturedVersion === tentativeVersion &&
isExactCorrettoVersion(tentativeVersion)) {
return {
version: tentativeVersion,
distribution: extractedDistribution
};
}
let version = semver.validRange(rawVersion)
? tentativeVersion
: semver.coerce(tentativeVersion);
@@ -31610,6 +31620,10 @@ function mapAsdfDistribution(asdfDist) {
function avoidOldNotation(content) {
return content.startsWith('1.') ? content.substring(2) : content;
}
function isExactCorrettoVersion(version) {
// Java 8 releases have a nonzero update field; later releases use five numeric fields.
return /^(?:8\.(?!0+(?:\.|$))\d+(?:\.\d+){2}|(?!8\.)\d+(?:\.\d+){4})$/.test(version.replace('+', '.'));
}
function convertVersionToSemver(version) {
// Some distributions may use semver-like notation (12.10.2.1, 12.10.2.1.1)
const versionArray = Array.isArray(version) ? version : version.split('.');
@@ -31894,13 +31908,6 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:https")
/***/ }),
/***/ 8995:
/***/ ((module) => {
module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:module");
/***/ }),
/***/ 7030:
/***/ ((module) => {
@@ -31915,13 +31922,6 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os");
/***/ }),
/***/ 6760:
/***/ ((module) => {
module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
/***/ }),
/***/ 643:
/***/ ((module) => {
@@ -36343,12 +36343,12 @@ async function saveCaches() {
}
const saves = [];
if (cache) {
const { save } = await Promise.all(/* import() */[__nccwpck_require__.e(767), __nccwpck_require__.e(377)]).then(__nccwpck_require__.bind(__nccwpck_require__, 7377));
const { save } = await Promise.all(/* import() */[__nccwpck_require__.e(230), __nccwpck_require__.e(377)]).then(__nccwpck_require__.bind(__nccwpck_require__, 7377));
saves.push(save(cache));
}
if (cacheJdk) {
const { saveJdkCaches } = await Promise.all(/* import() */[__nccwpck_require__.e(767), __nccwpck_require__.e(314)]).then(__nccwpck_require__.bind(__nccwpck_require__, 2314));
const { saveJdkResolutionCaches } = await Promise.all(/* import() */[__nccwpck_require__.e(767), __nccwpck_require__.e(348)]).then(__nccwpck_require__.bind(__nccwpck_require__, 967));
const { saveJdkCaches } = await Promise.all(/* import() */[__nccwpck_require__.e(230), __nccwpck_require__.e(314)]).then(__nccwpck_require__.bind(__nccwpck_require__, 2314));
const { saveJdkResolutionCaches } = await Promise.all(/* import() */[__nccwpck_require__.e(230), __nccwpck_require__.e(348)]).then(__nccwpck_require__.bind(__nccwpck_require__, 967));
saves.push(saveJdkCaches());
saves.push(saveJdkResolutionCaches());
}

View File

@@ -13,9 +13,11 @@ export const modules = {
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6928);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4527);
/* harmony import */ var _base_installer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6242);
/* harmony import */ var _platform_types_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7444);
/* harmony import */ var _actions_http_client__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4942);
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4527);
/* harmony import */ var _base_installer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6242);
/* harmony import */ var _platform_types_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7444);
@@ -23,29 +25,42 @@ export const modules = {
const CORRETTO_VERSIONS_URL = 'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json';
class CorrettoDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_4__/* .JavaBase */ .O {
class CorrettoDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_5__/* .JavaBase */ .O {
requestedVersion;
constructor(installerOptions) {
super('Corretto', installerOptions);
super('Corretto', {
...installerOptions,
// Java 8 releases use zero-padded fields, e.g. 8.472.08.1.
version: (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .isExactCorrettoVersion */ .kI)(installerOptions.version)
? installerOptions.version.replace(/(^|\.)0+(?=\d)/g, '$1')
: installerOptions.version
});
this.requestedVersion = installerOptions.version
.replace('+', '.')
.replace(/^8\.(\d+)\.(\d)\./, '8.$1.0$2.');
}
async downloadTool(javaRelease) {
_actions_core__WEBPACK_IMPORTED_MODULE_0__/* .info */ .pq(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
let javaArchivePath = await this.downloadAndVerify(javaRelease);
_actions_core__WEBPACK_IMPORTED_MODULE_0__/* .info */ .pq(`Extracting Java archive...`);
const extension = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__/* .getDownloadArchiveExtension */ .ag)();
const extension = (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .getDownloadArchiveExtension */ .ag)();
if (process.platform === 'win32') {
javaArchivePath = (0,_util_js__WEBPACK_IMPORTED_MODULE_3__/* .renameWinArchive */ .n2)(javaArchivePath);
javaArchivePath = (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .renameWinArchive */ .n2)(javaArchivePath);
}
const extractedJavaPath = await (0,_util_js__WEBPACK_IMPORTED_MODULE_3__/* .extractJdkFile */ .PE)(javaArchivePath, extension);
const extractedJavaPath = await (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .extractJdkFile */ .PE)(javaArchivePath, extension);
const archiveName = fs__WEBPACK_IMPORTED_MODULE_1___default().readdirSync(extractedJavaPath)[0];
const archivePath = path__WEBPACK_IMPORTED_MODULE_2___default().join(extractedJavaPath, archiveName);
const version = this.getToolcacheVersionName(javaRelease.version);
const javaPath = await (0,_util_js__WEBPACK_IMPORTED_MODULE_3__/* .cacheJdkDir */ .Vj)(archivePath, this.toolcacheFolderName, version, this.architecture);
const javaPath = await (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .cacheJdkDir */ .Vj)(archivePath, this.toolcacheFolderName, version, this.architecture);
return { version: javaRelease.version, path: javaPath };
}
async findPackageForDownload(version) {
if (!this.stable) {
throw new Error('Early access versions are not supported');
}
if ((0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .isExactCorrettoVersion */ .kI)(this.requestedVersion)) {
return this.findExactRelease();
}
const availableVersions = await this.getAvailableVersions();
// The `latest` alias is normalized to the SemVer wildcard, but Corretto
// matches on an exact major version, so resolve it to the newest available
@@ -60,13 +75,13 @@ class CorrettoDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_4
version = Math.max(...majors).toString();
}
if (version.includes('.')) {
throw new Error('Only major versions are supported');
throw new Error('Specify a major version or a full Corretto release, such as 25.0.5.0.10');
}
const matchingVersions = availableVersions
.filter(item => item.version == version)
.map(item => {
return {
version: (0,_util_js__WEBPACK_IMPORTED_MODULE_3__/* .convertVersionToSemver */ .ZY)(item.correttoVersion),
version: (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .convertVersionToSemver */ .ZY)(item.correttoVersion),
url: item.downloadLink,
checksum: {
algorithm: 'sha256',
@@ -82,6 +97,76 @@ class CorrettoDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_4
}
return resolvedVersion;
}
async findExactRelease() {
const version = this.requestedVersion;
const major = version.split('.')[0];
const platform = this.getPlatformOption();
const arch = this.architecture;
if (platform !== 'windows' && this.packageType !== 'jdk') {
throw new Error('Corretto JRE archives are only available for Windows');
}
const os = platform === 'macos'
? 'macosx'
: platform === 'alpine'
? 'alpine-linux'
: platform;
const suffix = platform === 'windows' ? `-${this.packageType}.zip` : '.tar.gz';
const url = `https://corretto.aws/downloads/resources/${version}/amazon-corretto-${version}-${os}-${arch}${suffix}`;
// Versioned archives have no checksum sidecar; Amazon publishes their SHA-256s in the release notes.
const source = `https://api.github.com/repos/corretto/corretto-${major}/releases/tags/${version}`;
const findCatalogRelease = async () => {
const archive = (await this.getAvailableVersions()).find(item => item.downloadLink === url);
if (!archive) {
return undefined;
}
return {
version: this.version,
url,
checksum: {
algorithm: 'sha256',
value: archive.checksum_sha256,
source: CORRETTO_VERSIONS_URL
}
};
};
let response;
try {
response = await this.http.getJson(source, {
...(0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .getGitHubHttpHeaders */ .U_)(),
accept: 'application/vnd.github+json'
});
}
catch (error) {
const catalogRelease = await findCatalogRelease();
if (catalogRelease) {
return catalogRelease;
}
throw error;
}
const row = response.result?.body
?.split(/\r?\n/)
.find(line => line.includes(`](${url})`));
const checksum = row?.match(/`([a-fA-F0-9]{64})`/)?.[1];
if (checksum) {
return {
version: this.version,
url,
checksum: { algorithm: 'sha256', value: checksum, source }
};
}
// The current catalog also covers releases missing from GitHub, such as Corretto 15 and 16.
const catalogRelease = await findCatalogRelease();
if (catalogRelease) {
return catalogRelease;
}
if (response.statusCode === _actions_http_client__WEBPACK_IMPORTED_MODULE_3__/* .HttpCodes */ .Hv.NotFound) {
throw new Error(`Corretto release ${version} was not found in Amazon's GitHub releases or current download catalog`);
}
if (!row) {
throw new Error(`No ${platform}/${arch} ${this.packageType} archive is listed for Corretto ${version}`);
}
throw new Error(`No SHA-256 checksum is published for Corretto ${version} (${platform}, ${arch}, ${this.packageType})`);
}
async getAvailableVersions() {
const platform = this.getPlatformOption();
const arch = this.distributionArchitecture();
@@ -112,7 +197,7 @@ class CorrettoDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_4
for (const version in eligibleVersions) {
const availableVersion = eligibleVersions[version];
for (const fileType in availableVersion) {
const skipNonExtractableBinaries = fileType != (0,_util_js__WEBPACK_IMPORTED_MODULE_3__/* .getDownloadArchiveExtension */ .ag)();
const skipNonExtractableBinaries = fileType != (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .getDownloadArchiveExtension */ .ag)();
if (skipNonExtractableBinaries) {
continue;
}
@@ -139,7 +224,7 @@ class CorrettoDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_4
case 'win32':
return 'windows';
case 'linux':
return (0,_platform_types_js__WEBPACK_IMPORTED_MODULE_5__/* .isAlpineLinux */ .G6)() ? 'alpine' : 'linux';
return (0,_platform_types_js__WEBPACK_IMPORTED_MODULE_6__/* .isAlpineLinux */ .G6)() ? 'alpine' : 'linux';
default:
return process.platform;
}

View File

@@ -82,6 +82,7 @@ class OracleDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_3__
possibleUrls.push(`${ORACLE_DL_BASE}/${major}/latest/jdk-${major}_${platform}-${arch}_bin.${extension}`);
}
const floatingUrl = isOnlyMajorProvided ? possibleUrls[0] : undefined;
let latestUrlNotFound = false;
possibleUrls.push(`${ORACLE_DL_BASE}/${major}/archive/jdk-${range}_${platform}-${arch}_bin.${extension}`);
if (parseInt(major) < 17) {
throw new Error('Oracle JDK is only supported for JDK 17 and later');
@@ -90,6 +91,9 @@ class OracleDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_3__
const response = await this.http.head(url);
if (response.message.statusCode === _actions_http_client__WEBPACK_IMPORTED_MODULE_5__/* .HttpCodes */ .Hv.OK) {
const floating = url === floatingUrl;
if (latestUrlNotFound) {
_actions_core__WEBPACK_IMPORTED_MODULE_0__/* .warning */ .$e(`Oracle JDK ${major} is no longer available from the latest endpoint. Falling back to its archived GA release, which may not include security updates.`);
}
return {
url,
version: range,
@@ -100,6 +104,9 @@ class OracleDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_3__
: undefined
};
}
if (url === floatingUrl) {
latestUrlNotFound = true;
}
if (response.message.statusCode !== _actions_http_client__WEBPACK_IMPORTED_MODULE_5__/* .HttpCodes */ .Hv.NotFound) {
throw new Error(`Http request for Oracle JDK failed with status code: ${response.message.statusCode}`);
}

View File

@@ -56,7 +56,7 @@ class LocalDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_3__/
let jdkCache;
if (this.cacheJdk) {
const [{ getJdkVerificationIdentity }, source] = await Promise.all([
Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779)),
Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779)),
hashFile(jdkFilePath)
]);
jdkCache = {
@@ -70,7 +70,7 @@ class LocalDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_3__/
};
}
if (!this.forceDownload && jdkCache) {
const { restoreJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
const { restoreJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
const restored = await restoreJdk(jdkCache);
const restoredPath = restored
? this.getRestoredJdkPath(this.version)
@@ -94,7 +94,7 @@ class LocalDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_3__/
path: javaPath
};
if (jdkCache) {
const { registerJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
const { registerJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
registerJdk(jdkCache);
}
}

56165
dist/setup/219.index.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,330 +0,0 @@
export const id = 220;
export const ids = [220];
export const modules = {
/***/ 3220:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
MicrosoftDistributions: () => (/* binding */ MicrosoftDistributions)
});
// UNUSED EXPORTS: MICROSOFT_PUBLIC_KEY
// EXTERNAL MODULE: ./src/distributions/base-installer.ts + 2 modules
var base_installer = __webpack_require__(6242);
// EXTERNAL MODULE: ./src/util.ts
var util = __webpack_require__(4527);
// EXTERNAL MODULE: ./src/gpg.ts
var gpg = __webpack_require__(8343);
;// CONCATENATED MODULE: ./src/distributions/microsoft/microsoft-key.ts
// Microsoft Build of OpenJDK GPG signing key
// Retrieved from: https://download.visualstudio.microsoft.com/download/pr/b90071e2-e0cf-4411-98be-dbeb09d67bf0/8622862bcd54206e158c5abca0582c9b/464279_464280_aoc_20210208.asc
const MICROSOFT_PUBLIC_KEY = `-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: BSN Pgp v1.1.0.0
mQENBGAhlWcBCADCQjj6huLTenvZSLej35e9YKEHm4lix2uvPOONexMaU8V2v7KL
RGdoXF7jwHci7efnPZ+9zpS2+g3rhvv8M7yWy9E/1psEtGzvmp1IL/qIabMEQqi+
UlhPGh7MQ/BkXAlic8Dyl3XYqr0EXS11iCiTr6Zkxs9Ee4V54gxL4gogRn4wk9sl
/nrjgDzMsUwla0pynoQQvYpqCdiAr3gKKllT1skCDqgVOMMyZxsx9HjZxg/3AJz6
r5i512L2R+3Hkv+XmxT+mnGBCFcny0DM7PjNXEmIK3ZSkro1tQML90zx3Fyh5esx
fpVvuIXGFV75o35VVCBZoiD3hcfOnIJsPQ9nABEBAAG0OE1pY3Jvc29mdCBKYXZh
IEVuZ2luZWVyaW5nIDxqYXZhcGxhdGluZnJhQG1pY3Jvc29mdC5jb20+iQE4BBMB
CAAiBQJgIZVnAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRA1Ux0xWyHB
icwTCACJO2FGNocNvdUtAb+eDKuGwt0chAJdCES2ZtgBScwrwDyWpxpRznoXWBHL
MJeLyxJoKsCG3vVlY4uh48psCzVm3OKvi7MCPT955t8W6TzfSBxTpjR8zRgJkjPJ
EGhHTlusUfz7TtM5etJF0qscSJH1grcNsgtee97mk4QyEzT8Di83NQmYxKcBrliq
yK/SWWt8VkTyYAEO6L5PoB4L9r8ka27uQs+jgCw+/Z0JMtNmmhyNGY3+a1YtPeoy
JdQaI9LphfKGbVaz6SK2aol7vj+c2TG3TLUYdOYGMH1OZlri2GTkCVjwna2GC7p4
Fa133tP85xzJEq1XeXm8WeLFo2wV
=rHCS
-----END PGP PUBLIC KEY BLOCK-----`;
// EXTERNAL MODULE: ./src/constants.ts
var constants = __webpack_require__(7242);
// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js + 7 modules
var core = __webpack_require__(3838);
// EXTERNAL MODULE: ./node_modules/@actions/tool-cache/lib/tool-cache.js + 2 modules
var tool_cache = __webpack_require__(9805);
// EXTERNAL MODULE: external "fs"
var external_fs_ = __webpack_require__(9896);
var external_fs_default = /*#__PURE__*/__webpack_require__.n(external_fs_);
// EXTERNAL MODULE: external "path"
var external_path_ = __webpack_require__(6928);
var external_path_default = /*#__PURE__*/__webpack_require__.n(external_path_);
;// CONCATENATED MODULE: ./src/distributions/microsoft/installer.ts
class MicrosoftDistributions extends base_installer/* JavaBase */.O {
constructor(installerOptions) {
super('Microsoft', installerOptions);
}
async downloadTool(javaRelease) {
core/* info */.pq(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
let javaArchivePath = await this.downloadAndVerify(javaRelease);
if (this.verifySignature) {
try {
if (!javaRelease.signatureUrl) {
throw new Error(`Input 'verify-signature' is enabled, but no signature URL was found for Microsoft Build of OpenJDK version ${javaRelease.version}.`);
}
core/* info */.pq(`Verifying Java package signature...`);
try {
await gpg/* verifyPackageSignature */.Yi(javaArchivePath, javaRelease.signatureUrl, this.verifySignaturePublicKey ?? MICROSOFT_PUBLIC_KEY);
}
catch (error) {
throw new Error(`Failed to verify signature for Microsoft Build of OpenJDK version ${javaRelease.version}. Signature URL: ${javaRelease.signatureUrl}. Error: ${error.message} ${constants/* SIGNATURE_VERIFICATION_FAILURE_HELP */.kQ}`, { cause: error });
}
}
catch (error) {
if (this.verifySignatureExplicitlyRequested) {
throw error;
}
core/* warning */.$e(error instanceof Error ? error.message : `Unknown error: ${error}`);
}
}
core/* info */.pq(`Extracting Java archive...`);
const extension = (0,util/* getDownloadArchiveExtension */.ag)();
if (process.platform === 'win32') {
javaArchivePath = (0,util/* renameWinArchive */.n2)(javaArchivePath);
}
const extractedJavaPath = await (0,util/* extractJdkFile */.PE)(javaArchivePath, extension);
const archiveName = external_fs_default().readdirSync(extractedJavaPath)[0];
const archivePath = external_path_default().join(extractedJavaPath, archiveName);
const javaPath = await (0,util/* cacheJdkDir */.Vj)(archivePath, this.toolcacheFolderName, this.getToolcacheVersionName(javaRelease.version), this.architecture);
return { version: javaRelease.version, path: javaPath };
}
async findPackageForDownload(range) {
const arch = this.distributionArchitecture();
if (arch !== 'x64' && arch !== 'aarch64') {
throw new Error(`Unsupported architecture: ${this.architecture}`);
}
if (!this.stable) {
throw new Error('Early access versions are not supported');
}
if (this.packageType !== 'jdk') {
throw new Error('Microsoft Build of OpenJDK provides only the `jdk` package type');
}
const manifest = await this.getAvailableVersions();
if (!manifest) {
throw new Error('Could not load manifest for Microsoft Build of OpenJDK');
}
const foundRelease = await tool_cache/* findFromManifest */.DC(range, true, manifest, arch);
if (!foundRelease) {
const availableVersionStrings = manifest.map(item => item.version);
throw this.createVersionNotFoundError(range, availableVersionStrings);
}
const file = foundRelease.files[0];
const signatureUrl = file.signature_url ?? `${file.download_url}.sig`;
return {
url: file.download_url,
signatureUrl,
version: foundRelease.version,
checksum: await this.fetchChecksum(`${file.download_url}.sha256sum.txt`, 'sha256')
};
}
supportsSignatureVerification() {
return true;
}
async getAvailableVersions() {
let releases = null;
const fileUrl = `https://aka.ms/download-jdk/microsoft-openjdk-versions.json`;
// Avoid leaking the GitHub token to a non-GitHub host (aka.ms redirects to a CDN).
const headers = { accept: 'application/json' };
let response = null;
if (core/* isDebug */._o()) {
console.time('Retrieving available versions for Microsoft took'); // eslint-disable-line no-console
}
try {
response = await this.http.getJson(fileUrl, headers);
if (!response.result) {
return null;
}
}
catch (err) {
core/* debug */.Yz(`Http request for microsoft-openjdk-versions.json failed with status code: ${response?.statusCode}. Error: ${err}`);
return null;
}
if (response.result) {
releases = response.result;
}
if (core/* isDebug */._o() && releases) {
core/* startGroup */.Oh('Print information about available versions');
console.timeEnd('Retrieving available versions for Microsoft took'); // eslint-disable-line no-console
core/* debug */.Yz(`Available versions: [${releases.length}]`);
core/* debug */.Yz(releases.map(item => item.version).join(', '));
core/* endGroup */.N4();
}
return releases;
}
}
/***/ }),
/***/ 8343:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Fh: () => (/* binding */ importKey),
/* harmony export */ Yi: () => (/* binding */ verifyPackageSignature),
/* harmony export */ mS: () => (/* binding */ removeGpgHome),
/* harmony export */ nY: () => (/* binding */ toGpgPath),
/* harmony export */ o6: () => (/* binding */ isGpgAvailable)
/* harmony export */ });
/* unused harmony export GPG_HOME_PREFIX */
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9896);
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6928);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6982);
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _actions_io__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8701);
/* harmony import */ var _actions_exec__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5260);
/* harmony import */ var _actions_tool_cache__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9805);
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4527);
const GPG_HOME_PREFIX = 'setup-java-gpg-';
const VERIFY_GPG_HOME_PREFIX = 'verify-signature-gpg-home-';
async function isGpgAvailable() {
return Boolean(await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .which */ .K7('gpg', false));
}
// Convert a Windows path (D:\a\_temp\...) to a POSIX path (/d/a/_temp/...).
// The Git-bundled GPG on Windows (MSYS2-based) uses POSIX path conventions
// internally. Passing Windows paths with backslashes can cause fatal GPG errors
// (exit code 2), so all paths passed to GPG must be in POSIX format on Windows.
function toGpgPath(p) {
if (process.platform !== 'win32')
return p;
return p
.replace(/\\/g, '/')
.replace(/^([A-Za-z]):\//, (_, drive) => `/${drive.toLowerCase()}/`);
}
function createGpgHome(prefix, tempDir = _util_js__WEBPACK_IMPORTED_MODULE_6__/* .getTempDir */ .G4()) {
const gpgHome = fs__WEBPACK_IMPORTED_MODULE_0__.mkdtempSync(path__WEBPACK_IMPORTED_MODULE_1__.join(tempDir, prefix));
if (process.platform !== 'win32') {
fs__WEBPACK_IMPORTED_MODULE_0__.chmodSync(gpgHome, 0o700);
}
return gpgHome;
}
async function importKey(privateKey) {
const gpgHome = createGpgHome(GPG_HOME_PREFIX);
const privateKeyFile = path__WEBPACK_IMPORTED_MODULE_1__.join(gpgHome, `private-key-${(0,crypto__WEBPACK_IMPORTED_MODULE_2__.randomUUID)()}.asc`);
try {
fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(privateKeyFile, privateKey, {
encoding: 'utf-8',
flag: 'wx',
mode: 0o600
});
try {
await _actions_exec__WEBPACK_IMPORTED_MODULE_4__/* .exec */ .m('gpg', [
'--homedir',
toGpgPath(gpgHome),
'--batch',
'--import',
toGpgPath(privateKeyFile)
], { silent: true });
}
finally {
fs__WEBPACK_IMPORTED_MODULE_0__.rmSync(privateKeyFile, { force: true });
}
return gpgHome;
}
catch (error) {
await removeGpgHome(gpgHome);
throw error;
}
}
async function removeGpgHome(gpgHome) {
if (!gpgHome) {
return;
}
const resolvedGpgHome = path__WEBPACK_IMPORTED_MODULE_1__.resolve(gpgHome);
const resolvedTempDir = path__WEBPACK_IMPORTED_MODULE_1__.resolve(_util_js__WEBPACK_IMPORTED_MODULE_6__/* .getTempDir */ .G4());
if (path__WEBPACK_IMPORTED_MODULE_1__.dirname(resolvedGpgHome) !== resolvedTempDir ||
!path__WEBPACK_IMPORTED_MODULE_1__.basename(resolvedGpgHome).startsWith(GPG_HOME_PREFIX)) {
throw new Error(`Refusing to remove unexpected GPG home: ${gpgHome}`);
}
if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(resolvedGpgHome)) {
return;
}
await stopGpgAgent(resolvedGpgHome);
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(resolvedGpgHome);
}
async function stopGpgAgent(gpgHome) {
try {
await _actions_exec__WEBPACK_IMPORTED_MODULE_4__/* .exec */ .m('gpgconf', ['--homedir', toGpgPath(gpgHome), '--kill', 'gpg-agent'], { silent: true, ignoreReturnCode: true });
}
catch {
// gpgconf may be unavailable, but directory removal must still be attempted.
}
}
async function verifyPackageSignature(archivePath, signatureUrl, publicKeyContent) {
const signaturePath = await _actions_tool_cache__WEBPACK_IMPORTED_MODULE_5__/* .downloadTool */ .bq(signatureUrl);
let gpgHome;
try {
// Both RUNNER_TEMP and TMPDIR can exceed macOS's 104-byte agent socket limit.
const tempDir = process.platform === 'darwin' ? '/tmp' : _util_js__WEBPACK_IMPORTED_MODULE_6__/* .getTempDir */ .G4();
gpgHome = createGpgHome(VERIFY_GPG_HOME_PREFIX, tempDir);
}
catch (error) {
try {
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(signaturePath);
}
catch {
// ignore cleanup failures
}
throw new Error(`Failed to create temporary GPG home directory for signature verification: ${error.message}`, { cause: error });
}
try {
const publicKeys = Array.isArray(publicKeyContent)
? publicKeyContent
: [publicKeyContent];
const publicKeyFiles = publicKeys.map((publicKey, index) => {
const publicKeyFile = path__WEBPACK_IMPORTED_MODULE_1__.join(gpgHome, `public-key-${index}.asc`);
fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(publicKeyFile, publicKey, { encoding: 'utf-8' });
return toGpgPath(publicKeyFile);
});
const options = { silent: true };
await _actions_exec__WEBPACK_IMPORTED_MODULE_4__/* .exec */ .m('gpg', [
'--homedir',
toGpgPath(gpgHome),
'--batch',
'--import',
...publicKeyFiles
], options);
await _actions_exec__WEBPACK_IMPORTED_MODULE_4__/* .exec */ .m('gpg', [
'--homedir',
toGpgPath(gpgHome),
'--batch',
'--verify',
toGpgPath(signaturePath),
toGpgPath(archivePath)
], options);
}
finally {
await stopGpgAgent(gpgHome);
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(signaturePath);
await _actions_io__WEBPACK_IMPORTED_MODULE_3__/* .rmRF */ .Yz(gpgHome);
}
}
/***/ })
};

View File

@@ -360,7 +360,7 @@ class JavaBase {
? await this.createJdkCache(javaRelease)
: undefined;
if (!this.forceDownload && jdkCache) {
const { restoreJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
const { restoreJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
const restored = await restoreJdk(jdkCache);
if (restored) {
const restoredPath = this.getRestoredJdkPath(javaRelease.version);
@@ -392,7 +392,7 @@ class JavaBase {
// Register after the installation exists so its identity is
// captured; the post-job save refuses to upload a path whose
// installation was replaced afterwards.
const { registerJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
const { registerJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
registerJdk(jdkCache);
}
}
@@ -441,7 +441,7 @@ class JavaBase {
const release = await this.findPackageForDownload(this.version);
return this.restoreFloatingResolution(release);
}
const { restoreJdkResolution, registerJdkResolution } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(348)]).then(__webpack_require__.bind(__webpack_require__, 967));
const { restoreJdkResolution, registerJdkResolution } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(348)]).then(__webpack_require__.bind(__webpack_require__, 967));
const request = {
distribution: this.distribution,
packageType: this.packageType,
@@ -477,7 +477,7 @@ class JavaBase {
return false;
}
async createJdkCache(javaRelease) {
const { getJdkVerificationIdentity } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
const { getJdkVerificationIdentity } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
return {
distribution: this.distribution,
packageType: this.packageType,
@@ -495,7 +495,7 @@ class JavaBase {
this.forceDownload) {
return javaRelease;
}
const { restoreJdkResolution } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(348)]).then(__webpack_require__.bind(__webpack_require__, 967));
const { restoreJdkResolution } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(348)]).then(__webpack_require__.bind(__webpack_require__, 967));
const restored = await restoreJdkResolution(this.getFloatingResolutionRequest(javaRelease));
if (!restored) {
return javaRelease;
@@ -515,7 +515,7 @@ class JavaBase {
this.forceDownload) {
return;
}
const { registerJdkResolution } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(971), __webpack_require__.e(348)]).then(__webpack_require__.bind(__webpack_require__, 967));
const { registerJdkResolution } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(348)]).then(__webpack_require__.bind(__webpack_require__, 967));
registerJdkResolution(this.getFloatingResolutionRequest(javaRelease), javaRelease);
}
getFloatingResolutionRequest(javaRelease) {

View File

@@ -34,16 +34,16 @@ class JetBrainsDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_
async findPackageForDownload(range) {
const versionsRaw = await this.getAvailableVersions();
const versions = versionsRaw.map(v => {
const formattedVersion = `${v.semver}+${v.build}`;
const formattedVersion = (0,_util_js__WEBPACK_IMPORTED_MODULE_5__/* .normalizeJavaVersionToSemver */ .zZ)(`${v.semver}+${v.build}`);
return {
version: formattedVersion,
url: v.url
};
});
const satisfiedVersions = versions
.filter(item => (0,_util_js__WEBPACK_IMPORTED_MODULE_5__/* .isVersionSatisfies */ .y)(range, item.version))
.filter(item => this.isVersionSatisfied(range, item.version))
.sort((a, b) => {
return -semver__WEBPACK_IMPORTED_MODULE_3___default().compareBuild(a.version, b.version);
return -this.compareVersions(a.version, b.version);
});
const resolvedFullVersion = satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
if (!resolvedFullVersion) {
@@ -59,6 +59,44 @@ class JetBrainsDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_
checksum: await this.fetchChecksum(`${resolvedFullVersion.url}.checksum`, ['sha512', 'sha256'])
};
}
normalizeVersion(version) {
const normalized = super.normalizeVersion(version);
if (/^\d+\.\d+\.\d+(?:\.\d+)+(?:-ea)?$/.test(version)) {
// A patch-only request must match any JBR build of that patch.
normalized.version = version.replace(/-ea$/, '');
}
return normalized;
}
isVersionSatisfied(range, version) {
const patchRequest = range.match(/^(\d+\.\d+\.\d+)((?:\.\d+)+)$/);
if (patchRequest) {
const candidate = semver__WEBPACK_IMPORTED_MODULE_3___default().parse(version);
return (candidate !== null &&
semver__WEBPACK_IMPORTED_MODULE_3___default().eq(patchRequest[1], candidate) &&
(candidate.build.slice(0, -2).join('.') || '0') ===
patchRequest[2].slice(1));
}
return super.isVersionSatisfied(range, version);
}
compareVersions(a, b) {
const mainComparison = semver__WEBPACK_IMPORTED_MODULE_3___default().compare(a, b);
if (mainComparison !== 0) {
return mainComparison;
}
// JBR builds have two components (one in older releases). Any preceding
// metadata components are Java patch fields and take priority over builds.
const first = new (semver__WEBPACK_IMPORTED_MODULE_3___default().SemVer)(a).build;
const second = new (semver__WEBPACK_IMPORTED_MODULE_3___default().SemVer)(b).build;
const firstPatch = first.slice(0, -2);
const secondPatch = second.slice(0, -2);
for (let index = 0; index < Math.max(firstPatch.length, secondPatch.length); index++) {
const patchComparison = semver__WEBPACK_IMPORTED_MODULE_3___default().compareIdentifiers(firstPatch[index] ?? '0', secondPatch[index] ?? '0');
if (patchComparison !== 0) {
return patchComparison;
}
}
return semver__WEBPACK_IMPORTED_MODULE_3___default().compareBuild(first.length ? `0.0.0+${first.slice(-2).join('.')}` : '0.0.0', second.length ? `0.0.0+${second.slice(-2).join('.')}` : '0.0.0');
}
async downloadTool(javaRelease) {
_actions_core__WEBPACK_IMPORTED_MODULE_0__/* .info */ .pq(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
const javaArchivePath = await this.downloadAndVerify(javaRelease);

View File

@@ -16,7 +16,7 @@ export const modules = {
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6928);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6971);
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4219);
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3838);

View File

@@ -14,7 +14,7 @@ export const modules = {
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(857);
/* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(os__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6971);
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4219);
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3838);
/* harmony import */ var _actions_glob__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2377);
/**

View File

@@ -8,7 +8,7 @@ export const modules = {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ isCacheFeatureAvailable: () => (/* binding */ isCacheFeatureAvailable)
/* harmony export */ });
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6971);
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4219);
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3838);
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4527);

View File

@@ -62,21 +62,23 @@ class LibericaDistributions extends _base_installer_js__WEBPACK_IMPORTED_MODULE_
}
normalizeVersion(version) {
const normalized = super.normalizeVersion(version);
if (/^\d+\.\d+\.\d+\.\d+(?:-ea)?$/.test(version)) {
if (/^\d+\.\d+\.\d+(?:\.\d+)+(?:-ea)?$/.test(version)) {
// Keep patch-only requests distinct from exact SDKMAN build requests.
normalized.version = version.replace(/-ea$/, '');
}
return normalized;
}
isVersionSatisfied(range, version) {
const patchRequest = range.match(/^(\d+\.\d+\.\d+)\.(\d+)$/);
const patchRequest = range.match(/^(\d+\.\d+\.\d+)((?:\.\d+)+)$/);
if (patchRequest) {
const candidate = semver__WEBPACK_IMPORTED_MODULE_1___default().parse(version);
if (!candidate || !semver__WEBPACK_IMPORTED_MODULE_1___default().eq(patchRequest[1], candidate)) {
return false;
}
const patch = candidate.build.length > 1 ? candidate.build[0] : '0';
return patch === patchRequest[2];
const patch = candidate.build.length > 1
? candidate.build.slice(0, -1).join('.')
: '0';
return patch === patchRequest[2].slice(1);
}
return super.isVersionSatisfied(range, version);
}
@@ -85,12 +87,22 @@ class LibericaDistributions extends _base_installer_js__WEBPACK_IMPORTED_MODULE_
if (mainComparison !== 0) {
return mainComparison;
}
// SDKMAN encodes patch.build, but unpatched releases contain only build.
const patchAndBuild = (version) => {
const getPatchAndBuild = (version) => {
const build = new (semver__WEBPACK_IMPORTED_MODULE_1___default().SemVer)(version).build;
return (build.length > 1 ? build : ['0', ...build]).join('.');
return build.length > 1
? { patch: build.slice(0, -1), build: build[build.length - 1] }
: { patch: [], build: build[0] ?? '0' };
};
return semver__WEBPACK_IMPORTED_MODULE_1___default().compareBuild(`0.0.0+${patchAndBuild(a)}`, `0.0.0+${patchAndBuild(b)}`);
const first = getPatchAndBuild(a);
const second = getPatchAndBuild(b);
const compareNumericIdentifiers = (left, right) => semver__WEBPACK_IMPORTED_MODULE_1___default().compareBuild(`0.0.0+${left}`, `0.0.0+${right}`);
for (let index = 0; index < Math.max(first.patch.length, second.patch.length); index++) {
const patchComparison = compareNumericIdentifiers(first.patch[index] ?? '0', second.patch[index] ?? '0');
if (patchComparison !== 0) {
return patchComparison;
}
}
return compareNumericIdentifiers(first.build, second.build);
}
async getAvailableVersions() {
if (_actions_core__WEBPACK_IMPORTED_MODULE_3__/* .isDebug */ ._o()) {
@@ -163,7 +175,11 @@ class LibericaDistributions extends _base_installer_js__WEBPACK_IMPORTED_MODULE_
const { featureVersion, interimVersion, updateVersion } = version;
const buildVersion = version.version.split('+')[1] || version.buildVersion;
const mainVersion = [featureVersion, interimVersion, updateVersion].join('.');
const patchVersion = version.version.split('+')[0].split('.')[3];
const patchVersion = version.version
.split('+')[0]
.split('.')
.slice(3)
.join('.');
if (patchVersion) {
return `${mainVersion}+${patchVersion}.${buildVersion}`;
}

343
dist/setup/772.index.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -8,7 +8,7 @@ export const modules = {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ isCacheFeatureAvailable: () => (/* binding */ isCacheFeatureAvailable)
/* harmony export */ });
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6971);
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4219);
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3838);
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4527);
@@ -46,7 +46,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6928);
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6971);
/* harmony import */ var _actions_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4219);
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3838);
/* harmony import */ var _cache_feature_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1394);

View File

@@ -14,6 +14,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ getInputWithDeprecatedAlias: () => (/* binding */ getInputWithDeprecatedAlias),
/* harmony export */ getMavenRepositorySettings: () => (/* binding */ getMavenRepositorySettings),
/* harmony export */ getMavenServerSettings: () => (/* binding */ getMavenServerSettings),
/* harmony export */ parseMavenMirrors: () => (/* binding */ parseMavenMirrors),
/* harmony export */ parseMavenRepositories: () => (/* binding */ parseMavenRepositories),
/* harmony export */ parseMavenServerCredentials: () => (/* binding */ parseMavenServerCredentials)
/* harmony export */ });
@@ -42,6 +43,7 @@ const MAVEN_REPOSITORY_ORIGIN = /^[A-Za-z][A-Za-z0-9+.-]*:\/\/[^/?#@]+\/?$/;
async function configureAuthentication() {
const servers = getMavenServerSettings();
const repositorySettings = getMavenRepositorySettings();
const mirrors = parseMavenMirrors(_actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getMultilineInput */ .q3(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_MVN_MIRRORS */ .K));
const settingsDirectory = _actions_core__WEBPACK_IMPORTED_MODULE_1__/* .getInput */ .V4(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_SETTINGS_PATH */ .Xh) ||
path__WEBPACK_IMPORTED_MODULE_0__.join(os__WEBPACK_IMPORTED_MODULE_4__.homedir(), _constants_js__WEBPACK_IMPORTED_MODULE_7__/* .M2_DIR */ .iT);
const overwriteSettings = (0,_util_js__WEBPACK_IMPORTED_MODULE_6__/* .getBooleanInput */ .Vt)(_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .INPUT_OVERWRITE_SETTINGS */ .TS, true);
@@ -51,7 +53,7 @@ async function configureAuthentication() {
if (gpgPrivateKey) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__/* .setSecret */ .Pq(gpgPrivateKey);
}
await createAuthenticationSettings(servers, settingsDirectory, overwriteSettings, gpgPassphraseEnvVar, repositorySettings);
await createAuthenticationSettings(servers, settingsDirectory, overwriteSettings, gpgPassphraseEnvVar, repositorySettings, mirrors);
if (gpgPrivateKey) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__/* .info */ .pq('Importing private gpg key');
const gpgHome = await _gpg_js__WEBPACK_IMPORTED_MODULE_5__/* .importKey */ .Fh(gpgPrivateKey);
@@ -222,6 +224,37 @@ function parseMavenRepositories(entries, includeCentral, inputName = _constants_
});
return repositories;
}
// only exported for testing purposes
function parseMavenMirrors(entries) {
const mirrors = [];
const mirrorIds = new Set();
entries.forEach((entry, index) => {
if (!entry.trim()) {
return;
}
const separator = entry.indexOf(':');
const remainder = entry.slice(separator + 1).trim();
// Protect scheme/authority colons (including IPv6 and ports) before
// finding the selector, which may itself contain external:http:*.
const urlPrefix = /^[A-Za-z][A-Za-z0-9+.-]*:(?:\/\/(?:[^/?#@\s]*@)?(?:\[[^\]]+\]|[^:/?#\s]+)(?::\d+(?=[/?#:\s]|$))?)?/.exec(remainder)?.[0] ?? '';
const fields = /^(.*?):((?:\s*!?external:(?:http:)?\*\s*|[^:,]*)(?:,(?:\s*!?external:(?:http:)?\*\s*|[^:,]*))*)$/.exec(remainder.slice(urlPrefix.length));
if (separator < 0 || !fields) {
throw new Error(`Invalid mvn-mirrors entry at line ${index + 1}. Expected format: mirror-id:mirror-url:mirror-of`);
}
const id = entry.slice(0, separator).trim();
const url = `${urlPrefix}${fields[1]}`.trim();
const mirrorOf = fields[2].trim();
if (!id || !url || !mirrorOf) {
throw new Error(`Invalid mvn-mirrors entry at line ${index + 1}. mirror-id, mirror URL, and mirror-of are required`);
}
if (mirrorIds.has(id)) {
throw new Error(`Duplicate mirror-id '${id}' in mvn-mirrors input at line ${index + 1}`);
}
mirrorIds.add(id);
mirrors.push({ id, url, mirrorOf });
});
return mirrors;
}
function generateRepositorySection(customRepositories, settings, element) {
if (!customRepositories.length && settings.includeCentral) {
return [];
@@ -253,15 +286,15 @@ function generateRepositorySection(customRepositories, settings, element) {
lines.push(` </${container}>`);
return lines;
}
async function createAuthenticationSettings(servers, settingsDirectory, overwriteSettings, gpgPassphraseEnvVar = undefined, repositorySettings = undefined) {
async function createAuthenticationSettings(servers, settingsDirectory, overwriteSettings, gpgPassphraseEnvVar = undefined, repositorySettings = undefined, mirrors = []) {
_actions_core__WEBPACK_IMPORTED_MODULE_1__/* .info */ .pq(`Creating ${_constants_js__WEBPACK_IMPORTED_MODULE_7__/* .MVN_SETTINGS_FILE */ .vO} with server-id: ${servers.map(server => server.id).join(', ')}`);
// when an alternate m2 location is specified use only that location (no .m2 directory)
// otherwise use the home/.m2/ path
await _actions_io__WEBPACK_IMPORTED_MODULE_2__/* .mkdirP */ .U$(settingsDirectory);
await write(settingsDirectory, generate(servers, gpgPassphraseEnvVar, repositorySettings), overwriteSettings);
await write(settingsDirectory, generate(servers, gpgPassphraseEnvVar, repositorySettings, mirrors), overwriteSettings);
}
// only exported for testing purposes
function generate(servers, gpgPassphraseEnvVar, repositorySettings) {
function generate(servers, gpgPassphraseEnvVar, repositorySettings, mirrors = []) {
// The maven-gpg-plugin reads the passphrase from the environment variable
// named by the `gpg.passphraseEnvName` property (default MAVEN_GPG_PASSPHRASE).
// Only configure it when the requested env var name differs from that default;
@@ -289,6 +322,13 @@ function generate(servers, gpgPassphraseEnvVar, repositorySettings) {
lines.push(' </server>');
}
lines.push(' </servers>');
if (mirrors.length) {
lines.push(' <mirrors>');
for (const mirror of mirrors) {
lines.push(' <mirror>', ` <id>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(mirror.id)}</id>`, ` <url>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(mirror.url)}</url>`, ` <mirrorOf>${(0,_xml_js__WEBPACK_IMPORTED_MODULE_8__/* .escapeXmlText */ .I)(mirror.mirrorOf)}</mirrorOf>`, ' </mirror>');
}
lines.push(' </mirrors>');
}
if (repositorySettings || includeGpgPassphraseProfile) {
lines.push(' <profiles>');
if (repositorySettings) {

View File

@@ -10,7 +10,7 @@ export const modules = {
/* harmony export */ i: () => (/* binding */ XMLValidator)
/* harmony export */ });
/* harmony import */ var _validator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1176);
/* harmony import */ var _xmlparser_XMLParser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6009);
/* harmony import */ var _xmlparser_XMLParser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1143);
@@ -627,7 +627,7 @@ function getPositionFromMatch(match) {
/***/ }),
/***/ 6009:
/***/ 1143:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
@@ -1582,8 +1582,10 @@ function toNumber(str, options = {}) {
return parse_int(trimmedStr, 2);
} else if (options.octal && octRegex.test(trimmedStr)) {
return parse_int(trimmedStr, 8);
} else if (!isFinite(trimmedStr)) { //Infinity
return handleInfinity(str, Number(trimmedStr), options);
} else if (!isFinite(trimmedStr)) { //Infinity or not a number
const num = Number(trimmedStr);
if (Number.isNaN(num)) return str; //not a number: always the original string
return handleInfinity(str, num, options); //only +/-Infinity reaches here
} else if (trimmedStr.includes('e') || trimmedStr.includes('E')) { //eNotation
return resolveEnotation(str, trimmedStr, options);
} else {
@@ -1595,8 +1597,8 @@ function toNumber(str, options = {}) {
const leadingZeros = match[2];
let numTrimmedByZeros = trimZeros(match[3]); //complete num without leading zeros
const decimalAdjacentToLeadingZeros = sign ? // 0., -00., 000.
str[leadingZeros.length + 1] === "."
: str[leadingZeros.length] === ".";
trimmedStr[leadingZeros.length + 1] === "."
: trimmedStr[leadingZeros.length] === ".";
//trim ending zeros for floating number
if (!options.leadingZeros //leading zeros are not allowed
@@ -1644,8 +1646,8 @@ function resolveEnotation(str, trimmedStr, options) {
const eChar = notation[3].indexOf("e") === -1 ? "E" : "e";
const leadingZeros = notation[2];
const eAdjacentToLeadingZeros = sign ? // 0E.
str[leadingZeros.length + 1] === eChar
: str[leadingZeros.length] === eChar;
trimmedStr[leadingZeros.length + 1] === eChar
: trimmedStr[leadingZeros.length] === eChar;
if (leadingZeros.length > 1 && eAdjacentToLeadingZeros) return str;
else if (leadingZeros.length === 1
@@ -1654,8 +1656,7 @@ function resolveEnotation(str, trimmedStr, options) {
} else if (leadingZeros.length > 0) {
// Has leading zeros — only accept if leadingZeros option allows it
if (options.leadingZeros && !eAdjacentToLeadingZeros) {
trimmedStr = (notation[1] || "") + notation[3];
return Number(trimmedStr);
return Number(trimmedStr); // Number() accepts leading zeros; stripping can leave a mantissa-less ".e0"
} else return str;
} else {
// No leading zeros — always valid e-notation, parse it
@@ -1718,6 +1719,7 @@ function handleInfinity(str, num, options) {
return str; // Return original string like "1e1000"
}
}
;// CONCATENATED MODULE: ./node_modules/fast-xml-parser/src/ignoreAttributes.js
function getIgnoreAttributesFn(ignoreAttributes) {
if (typeof ignoreAttributes === 'function') {
@@ -3899,6 +3901,56 @@ const SQL_STRICT_PATTERNS = [...sql, ...SQL_STRICT_EXTRA];
/* harmony default export */ const sql_strict = (SQL_STRICT_PATTERNS);
;// CONCATENATED MODULE: ./node_modules/is-unsafe/src/util/decode-entities.js
/**
* Decode the HTML character references that matter for markup-context
* detection.
*
* Browsers decode character references in attribute values before they
* interpret a URL, so `javascript&#58;alert(1)` in an href is the
* `javascript:` scheme. The HTML/XML/SVG rules match literal characters, so
* without this step such payloads slip through.
*
* Deliberately NOT a full entity decoder. It decodes only:
* - decimal refs &#58; &#058; &#00000058; &#58 (any leading zeros,
* trailing ; optional — browsers accept both)
* - hex refs &#x3a; &#X3A; &#x0000003a; &#x3a (same)
* - named refs &colon; &Tab; &NewLine;
* Named refs are CASE-SENSITIVE and REQUIRE the trailing ';', exactly
* like a browser (so `&COLON;` and `&colon` are not decoded).
* &Tab; / &NewLine; matter because the URL parser strips tab/newline,
* so `java&Tab;script:` is still a javascript: URL.
*
* It does NOT decode &amp; (single pass only), so double-encoded text such as
* "&amp;lt;script&amp;gt;" stays literal — a browser renders that as text.
*
* All quantifiers are bounded; no ReDoS risk.
*
* @param {string} input
* @returns {string}
*/
const NAMED = Object.freeze({
colon: ':',
Tab: '\t',
NewLine: '\n',
});
const ENTITY_RE =
/&(?:#[xX]0*([0-9a-fA-F]{1,6});?|#0*([0-9]{1,7});?|([a-zA-Z][a-zA-Z0-9]{1,15});)/g;
function decodeEntities(input) {
if (input.indexOf('&') === -1) return input;
return input.replace(ENTITY_RE, (match, hex, dec, name) => {
if (name !== undefined) {
return Object.prototype.hasOwnProperty.call(NAMED, name) ? NAMED[name] : match;
}
const cp = hex !== undefined ? parseInt(hex, 16) : parseInt(dec, 10);
if (!Number.isFinite(cp) || cp > 0x10ffff) return match;
return String.fromCodePoint(cp);
});
}
;// CONCATENATED MODULE: ./node_modules/is-unsafe/src/contexts/html.js
/**
* HTML context patterns.
@@ -4062,7 +4114,8 @@ const XML_PATTERNS = [
{
id: 'xml-namespace-confusion',
description: 'xmlns: attribute injection — can redefine namespaces to confuse parsers',
pattern: /\bxmlns\s*(?::\w{1,40})?\s*=/i,
// pattern: /\bxmlns\s*(?::\w{1,40})?\s*=/i,
pattern: /\bxmlns(?::\w{1,40})?\s*=/i,
},
{
id: 'xml-comment-injection',
@@ -4581,6 +4634,11 @@ const LOG_PATTERNS = [
// Markup contexts are also matched against an entity-decoded copy of the input,
// because browsers decode HTML character references before interpreting a URL
// scheme (e.g. javascript&#58;… is a javascript: URL).
// ─── VALID_CONTEXTS convenience re-export ─────────────────────────────────
// Importing this pulls in ALL contexts. Use it only when you need all of them
// (e.g. for validation UI, tooling, or exhaustive audits).
@@ -4603,6 +4661,12 @@ const LOG_PATTERNS = [
html.label = 'HTML';
xml.label = 'XML';
svg.label = 'SVG';
// Markup contexts: also test an entity-decoded copy (see util/decode-entities.js).
// Non-markup contexts (SQL, SHELL, LOG, …) are matched byte-for-byte as supplied.
html.decodeEntities = true;
xml.decodeEntities = true;
svg.decodeEntities = true;
sql.label = 'SQL';
sql_strict.label = 'SQL-STRICT';
shell.label = 'SHELL';
@@ -4697,6 +4761,20 @@ function normalise(context) {
return { lists: [context], regex: null };
}
/**
* For markup contexts, return an entity-decoded copy of `value` to test
* alongside the raw input, or null when there is nothing extra to test.
*
* @param {string} value
* @param {Rule[]} list
* @returns {string|null}
*/
function decodedCopy(value, list) {
if (!list.decodeEntities) return null;
const decoded = decodeEntities(value);
return decoded === value ? null : decoded;
}
/**
* Test value against a single PatternList. Returns the first MatchResult or null.
*
@@ -4706,8 +4784,9 @@ function normalise(context) {
*/
function matchList(value, list) {
const label = list.label ?? 'CUSTOM';
const decoded = decodedCopy(value, list);
for (const rule of list) {
if (rule.pattern.test(value)) {
if (rule.pattern.test(value) || (decoded !== null && rule.pattern.test(decoded))) {
return { context: label, id: rule.id, description: rule.description, pattern: rule.pattern };
}
}
@@ -4805,8 +4884,9 @@ function allUnsafe(value, context) {
for (const list of lists) {
const label = list.label ?? 'CUSTOM';
const decoded = decodedCopy(value, list);
for (const rule of list) {
if (rule.pattern.test(value)) {
if (rule.pattern.test(value) || (decoded !== null && rule.pattern.test(decoded))) {
results.push({ context: label, id: rule.id, description: rule.description, pattern: rule.pattern });
}
}
@@ -5104,7 +5184,15 @@ function buildAttributesMap(attrStr, jPath, tagName, force = false) {
}
}
const parseXml = function (xmlData) {
xmlData = xmlData.replace(/\r\n?/g, "\n"); //TODO: remove this line
const options = this.options;
const crlfPositions = options.captureMetaData ? [] : undefined;
xmlData = xmlData.replace(/\r\n?/g, options.captureMetaData ? (newline, index) => {
if (newline.length === 2) {
// Store the position after earlier CRLF pairs have been normalized.
crlfPositions.push(index - crlfPositions.length);
}
return "\n";
} : "\n");
const xmlObj = new XmlNode('!xml');
let currentNode = xmlObj;
let textData = "";
@@ -5117,7 +5205,6 @@ const parseXml = function (xmlData) {
this.entityExpansionCount = 0;
this.currentExpandedLength = 0;
this.doctypefound = false;
const options = this.options;
const docTypeReader = new DocTypeReader(options.processEntities);
const xmlLen = xmlData.length;
for (let i = 0; i < xmlLen; i++) {//for each char in XML data
@@ -5161,7 +5248,7 @@ const parseXml = function (xmlData) {
currentNode = this.tagsNodeStack.pop() || xmlObj;//avoid recursion, set the parent tag scope
if (options.captureMetaData && currentNode) {
currentNode.addEndIndex(closeIndex + 1);
currentNode.addEndIndex(getOriginalIndex(closeIndex + 1, crlfPositions));
}
textData = "";
i = closeIndex;
@@ -5187,11 +5274,12 @@ const parseXml = function (xmlData) {
if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent && options.ignoreAttributes !== true) {
childNode[":@"] = attsMap
}
this.addChild(currentNode, childNode, this.readonlyMatcher, i);
const startIndex = options.captureMetaData ? getOriginalIndex(i, crlfPositions) : i;
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
if (options.captureMetaData) {
// closeIndex points at '?' of the closing '?>'
currentNode.addEndIndex(tagData.closeIndex + 2);
currentNode.addEndIndex(getOriginalIndex(tagData.closeIndex + 2, crlfPositions));
}
}
@@ -5323,7 +5411,7 @@ const parseXml = function (xmlData) {
this.isCurrentNodeStopNode = this.isItStopNode();
}
const startIndex = i;
const startIndex = options.captureMetaData ? getOriginalIndex(i, crlfPositions) : i;
if (this.isCurrentNodeStopNode) {
let tagContent = "";
@@ -5359,7 +5447,7 @@ const parseXml = function (xmlData) {
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
if (options.captureMetaData) {
currentNode.addEndIndex(i + 1);
currentNode.addEndIndex(getOriginalIndex(i + 1, crlfPositions));
}
} else {
//selfClosing tag
@@ -5373,7 +5461,7 @@ const parseXml = function (xmlData) {
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
if (options.captureMetaData) {
currentNode.addEndIndex(closeIndex + 1);
currentNode.addEndIndex(getOriginalIndex(closeIndex + 1, crlfPositions));
}
this.matcher.pop(); // Pop self-closing tag
this.isCurrentNodeStopNode = false; // Reset flag
@@ -5386,7 +5474,7 @@ const parseXml = function (xmlData) {
this.addChild(currentNode, childNode, this.readonlyMatcher, startIndex);
if (options.captureMetaData) {
currentNode.addEndIndex(result.closeIndex + 1);
currentNode.addEndIndex(getOriginalIndex(result.closeIndex + 1, crlfPositions));
}
this.matcher.pop(); // Pop unpaired tag
this.isCurrentNodeStopNode = false; // Reset flag
@@ -5419,6 +5507,17 @@ const parseXml = function (xmlData) {
return xmlObj.child;
}
function getOriginalIndex(index, crlfPositions) {
let low = 0;
let high = crlfPositions.length;
while (low < high) {
const middle = Math.floor((low + high) / 2);
if (crlfPositions[middle] < index) low = middle + 1;
else high = middle;
}
return index + low;
}
function addChild(currentNode, childNode, matcher, startIndex) {
// unset startIndex if not requested
if (!this.options.captureMetaData) startIndex = undefined;
@@ -5597,6 +5696,8 @@ function readStopNodeData(xmlData, tagName, i) {
const startIndex = i;
// Starting at 1 since we already have an open tag
let openTagCount = 1;
let lenient = false; // set once a quote-aware tag scan fails
let nextGt = -1; // cached index of the next '>'
const xmllen = xmlData.length;
for (; i < xmllen; i++) {
@@ -5628,14 +5729,29 @@ function readStopNodeData(xmlData, tagName, i) {
const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2;
i = closeIndex;
} else {
const tagData = readTagExp(xmlData, i, false)
const tagData = lenient ? undefined : readTagExp(xmlData, i, false);
if (tagData) {
const openTagName = tagData && tagData.tagName;
const openTagName = tagData.tagName;
if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") {
openTagCount++;
}
i = tagData.closeIndex;
} else {
// no closing '>'. use lenient approach to find '<' instead of readTagExp, to avoid repeated rescans.
lenient = true;
if (nextGt < i) {
nextGt = xmlData.indexOf(">", i);
if (nextGt === -1) return; // no '>' left, so no closing tag can follow
}
const nextLt = xmlData.indexOf("<", i + 1);
if (nextLt === -1 || nextLt > nextGt) { // looks like a real tag
const exp = xmlData.substring(i + 1, nextGt);
const sep = exp.search(/\s/);
const name = sep === -1 ? exp : exp.substring(0, sep);
if (name === tagName && exp[exp.length - 1] !== "/") openTagCount++;
i = nextGt;
} // else: treat this '<' as plain text
}
}
}
@@ -5871,6 +5987,7 @@ function isLeafTag(obj, options) {
// EXTERNAL MODULE: ./node_modules/fast-xml-parser/src/validator.js
var validator = __webpack_require__(1176);
;// CONCATENATED MODULE: ./node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
/* global Uint8Array */
@@ -5891,7 +6008,12 @@ class XMLParser {
*/
parse(xmlData, validationOption) {
if (typeof xmlData !== "string" && xmlData.toString) {
xmlData = xmlData.toString();
if (xmlData instanceof Uint8Array &&
!(typeof Buffer !== "undefined" && Buffer.isBuffer(xmlData))) {
xmlData = new TextDecoder("utf-8", { ignoreBOM: true }).decode(xmlData);
} else {
xmlData = xmlData.toString();
}
} else if (typeof xmlData !== "string") {
throw new Error("XML data is accepted in String or Bytes[] form.")
}

53
dist/setup/index.js vendored
View File

@@ -31144,6 +31144,7 @@ module.exports = {
/* harmony export */ GL: () => (/* binding */ INPUT_CACHE_JDK),
/* harmony export */ H5: () => (/* binding */ INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL),
/* harmony export */ I9: () => (/* binding */ INPUT_FORCE_DOWNLOAD),
/* harmony export */ K: () => (/* binding */ INPUT_MVN_MIRRORS),
/* harmony export */ K$: () => (/* binding */ GPG_PASSPHRASE_PROFILE_ID),
/* harmony export */ LS: () => (/* binding */ INPUT_ARCHITECTURE),
/* harmony export */ MM: () => (/* binding */ INPUT_MVN_SERVER_CREDENTIALS),
@@ -31215,6 +31216,7 @@ const INPUT_MVN_SERVER_CREDENTIALS = 'mvn-server-credentials';
const INPUT_MVN_SERVER_REPOSITORY_ORIGINS = 'mvn-server-repository-origins';
const INPUT_MVN_REPOSITORIES = 'mvn-repositories';
const INPUT_MVN_PLUGIN_REPOSITORIES = 'mvn-plugin-repositories';
const INPUT_MVN_MIRRORS = 'mvn-mirrors';
const INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL = 'mvn-repositories-include-central';
const INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL = 'mvn-repositories-prioritize-central';
const INPUT_SERVER_ID = 'server-id';
@@ -31543,6 +31545,8 @@ const CANONICAL_ARCHITECTURES = [
'riscv64',
's390x'
];
// Used in environment-variable names and tool-cache paths.
const ARCHITECTURE_TOKEN = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
const PLATFORM_ALIASES = {
darwin: 'macos',
linux: 'linux',
@@ -31552,10 +31556,17 @@ const PLATFORM_ALIASES = {
function normalizeArchitecture(architecture) {
const trimmedArchitecture = architecture.trim();
const normalizedArchitecture = trimmedArchitecture.toLowerCase();
return (ARCHITECTURE_ALIASES[normalizedArchitecture] ??
const alias = Object.prototype.hasOwnProperty.call(ARCHITECTURE_ALIASES, normalizedArchitecture)
? ARCHITECTURE_ALIASES[normalizedArchitecture]
: undefined;
const result = alias ??
(CANONICAL_ARCHITECTURES.includes(normalizedArchitecture)
? normalizedArchitecture
: trimmedArchitecture));
: trimmedArchitecture);
if (!ARCHITECTURE_TOKEN.test(result)) {
throw new Error(`Unsupported architecture value: ${JSON.stringify(architecture)}`);
}
return result;
}
function normalizePlatform(platform) {
return PLATFORM_ALIASES[platform];
@@ -31674,6 +31685,7 @@ function validateToolchainIds(versions, versionFile, toolchainIds) {
/* harmony export */ ZY: () => (/* binding */ convertVersionToSemver),
/* harmony export */ aT: () => (/* binding */ isGhes),
/* harmony export */ ag: () => (/* binding */ getDownloadArchiveExtension),
/* harmony export */ kI: () => (/* binding */ isExactCorrettoVersion),
/* harmony export */ lK: () => (/* binding */ getGitHubToken),
/* harmony export */ lN: () => (/* binding */ isJdkCacheEnabled),
/* harmony export */ n2: () => (/* binding */ renameWinArchive),
@@ -31990,6 +32002,15 @@ function getVersionFromFileContent(content, distributionName, versionFile) {
}
const tentativeVersion = avoidOldNotation(capturedVersion);
const rawVersion = tentativeVersion.split('-')[0];
// Preserve Corretto's full vendor release before generic coercion drops its extra numeric fields.
if ((extractedDistribution || distributionName) === 'corretto' &&
capturedVersion === tentativeVersion &&
isExactCorrettoVersion(tentativeVersion)) {
return {
version: tentativeVersion,
distribution: extractedDistribution
};
}
let version = semver__WEBPACK_IMPORTED_MODULE_3__.validRange(rawVersion)
? tentativeVersion
: semver__WEBPACK_IMPORTED_MODULE_3__.coerce(tentativeVersion);
@@ -32073,6 +32094,10 @@ function mapAsdfDistribution(asdfDist) {
function avoidOldNotation(content) {
return content.startsWith('1.') ? content.substring(2) : content;
}
function isExactCorrettoVersion(version) {
// Java 8 releases have a nonzero update field; later releases use five numeric fields.
return /^(?:8\.(?!0+(?:\.|$))\d+(?:\.\d+){2}|(?!8\.)\d+(?:\.\d+){4})$/.test(version.replace('+', '.'));
}
function convertVersionToSemver(version) {
// Some distributions may use semver-like notation (12.10.2.1, 12.10.2.1.1)
const versionArray = Array.isArray(version) ? version : version.split('.');
@@ -32357,13 +32382,6 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:https")
/***/ }),
/***/ 8995:
/***/ ((module) => {
module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:module");
/***/ }),
/***/ 7030:
/***/ ((module) => {
@@ -32378,13 +32396,6 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os");
/***/ }),
/***/ 6760:
/***/ ((module) => {
module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
/***/ }),
/***/ 643:
/***/ ((module) => {
@@ -36679,7 +36690,7 @@ async function getJavaDistribution(distributionName, installerOptions, jdkFile)
return new LibericaNikDistributions(normalizedInstallerOptions);
}
case package_types/* JavaDistribution */.zS.Microsoft: {
const { MicrosoftDistributions } = await Promise.all(/* import() */[__nccwpck_require__.e(242), __nccwpck_require__.e(220)]).then(__nccwpck_require__.bind(__nccwpck_require__, 3220));
const { MicrosoftDistributions } = await Promise.all(/* import() */[__nccwpck_require__.e(242), __nccwpck_require__.e(772)]).then(__nccwpck_require__.bind(__nccwpck_require__, 4772));
return new MicrosoftDistributions(normalizedInstallerOptions);
}
case package_types/* JavaDistribution */.zS.Semeru: {
@@ -36736,7 +36747,7 @@ async function getJavaDistribution(distributionName, installerOptions, jdkFile)
function configureProblemMatcher(matcherPath) {
const problemMatcherEnabled = (0,util/* getBooleanInput */.Vt)(constants/* INPUT_PROBLEM_MATCHER */.Wt, true);
const problemMatcherEnabled = (0,util/* getBooleanInput */.Vt)(constants/* INPUT_PROBLEM_MATCHER */.Wt, false);
if (!problemMatcherEnabled) {
setup_java_core/* debug */.Yz('Java problem matcher is disabled');
return;
@@ -36891,7 +36902,7 @@ async function validateCacheInput(cache) {
if (!cache) {
return;
}
const { validatePackageManager } = await Promise.all(/* import() */[__nccwpck_require__.e(824), __nccwpck_require__.e(971), __nccwpck_require__.e(377)]).then(__nccwpck_require__.bind(__nccwpck_require__, 7377));
const { validatePackageManager } = await Promise.all(/* import() */[__nccwpck_require__.e(824), __nccwpck_require__.e(219), __nccwpck_require__.e(377)]).then(__nccwpck_require__.bind(__nccwpck_require__, 7377));
validatePackageManager(cache);
}
function settle(promise) {
@@ -36970,11 +36981,11 @@ async function configureInstalledToolchains(toolchainConfigurations) {
}
}
async function startCacheRestore(cache, cacheDependencyPath, cachePath) {
const { isCacheFeatureAvailable } = await Promise.all(/* import() */[__nccwpck_require__.e(824), __nccwpck_require__.e(971), __nccwpck_require__.e(394)]).then(__nccwpck_require__.bind(__nccwpck_require__, 1394));
const { isCacheFeatureAvailable } = await Promise.all(/* import() */[__nccwpck_require__.e(824), __nccwpck_require__.e(219), __nccwpck_require__.e(394)]).then(__nccwpck_require__.bind(__nccwpck_require__, 1394));
if (!isCacheFeatureAvailable()) {
return;
}
const { restore } = await Promise.all(/* import() */[__nccwpck_require__.e(824), __nccwpck_require__.e(971), __nccwpck_require__.e(377)]).then(__nccwpck_require__.bind(__nccwpck_require__, 7377));
const { restore } = await Promise.all(/* import() */[__nccwpck_require__.e(824), __nccwpck_require__.e(219), __nccwpck_require__.e(377)]).then(__nccwpck_require__.bind(__nccwpck_require__, 7377));
await restore(cache, cacheDependencyPath, cachePath);
}

View File

@@ -28,6 +28,7 @@
- [Testing against different platforms](#Testing-against-different-platforms)
- [Publishing using Apache Maven](#Publishing-using-Apache-Maven)
- [Publishing to multiple Maven servers](#publishing-to-multiple-maven-servers)
- [Redirecting Maven repositories with mirrors](#redirecting-maven-repositories-with-mirrors)
- [Apache Maven with a settings path](#apache-maven-with-a-settings-path)
- [Maven transfer progress (download logs)](#Maven-transfer-progress-download-logs)
- [Java problem matcher (compiler annotations)](#java-problem-matcher-compiler-annotations)
@@ -157,7 +158,16 @@ steps:
```
### Amazon Corretto
**NOTE:** Amazon Corretto only supports the major version specification.
Amazon Corretto supports major versions (for example, `25`) and full release numbers
(for example, `25.0.5.0.10`). Full release numbers select the versioned archive directly,
including older releases no longer listed in the latest-version feed. SHA-256 checksums
for exact releases come from Amazon's current download catalog or GitHub release notes.
Historical releases without a published SHA-256 cannot be downloaded.
Full Corretto release numbers supplied through `java-version-file` now select that exact
release; previously they selected the latest matching major. Update MD5-only file pins
to a release with a published SHA-256. Partial version-file values keep their existing
major-version behavior.
```yaml
steps:
@@ -165,7 +175,7 @@ steps:
- uses: actions/setup-java@v6
with:
distribution: 'corretto'
java-version: '25'
java-version: '25.0.5.0.10'
- run: java --version
```
@@ -336,7 +346,7 @@ The package types have these meanings:
| `liberica-nik` | `jdk`, `jdk+fx` | `java-version` selects the embedded JDK version, not the NIK/GraalVM release number. BellSoft currently publishes matching standard and JavaFX "full" bundles for JDK 11 and later, with gaps between feature releases. Any other `java-package` value is rejected. |
| `microsoft` | `jdk` | Stable builds only. The bundled manifest contains Java 11, 16, 17, 21, and 25 releases; platform availability varies by release. |
| `semeru` | `jdk`, `jre` | Stable OpenJ9 builds only. IBM publishes both image types for the supported release lines (currently 8, 11, 17, 21, and 25), subject to platform availability. |
| `corretto` | `jdk`, `jre` | Accepts major versions only. JDK availability follows Amazon's platform catalog. For the operating systems directly selected by `setup-java`, JRE downloads are limited to Java 8 on Windows; Linux and macOS use `jdk`. |
| `corretto` | `jdk`, `jre` | Accepts major versions and full Corretto release numbers. JDK availability follows Amazon's platform catalog. For the operating systems directly selected by `setup-java`, JRE downloads are limited to Java 8 on Windows; Linux and macOS use `jdk`. |
| `oracle` | `jdk` | Stable Oracle JDK 17 and later only. |
| `oracle-openjdk` | `jdk` | Installs the GA or early-access JDK builds currently listed or archived on `jdk.java.net`; use a `-ea` version such as `27-ea` for early access. |
| `redhat` | `jdk`, `jre` | Stable builds only. Version availability follows the Foojay Disco catalog for Red Hat Build of OpenJDK and can lag Red Hat's downloads page. |
@@ -649,9 +659,10 @@ runner, distribution, JDK size, network, and cache eviction pressure.
The `architecture` input is normalized before setup-java checks the tool cache
or contacts a vendor. `amd64`, `ia32`, `arm`, and `arm64` are accepted aliases
for `x64`, `x86`, `armv7`, and `aarch64`. The table lists the combinations
setup-java validates up front; an individual Java patch release can still be
absent from a vendor catalog.
for `x64`, `x86`, `armv7`, and `aarch64`. Every value must be one token that
starts with a letter or digit and contains only letters, digits, `_`, or `-`.
The table lists the combinations setup-java validates up front; an individual
Java patch release can still be absent from a vendor catalog.
| Distribution | Linux | macOS | Windows | Other / version restrictions |
| --- | --- | --- | --- | --- |
@@ -1096,6 +1107,76 @@ default; `mvn-repositories-prioritize-central: false` places it after them.
All repository generation respects `settings-path` and `overwrite-settings`;
an existing settings file is left untouched when `overwrite-settings: false`.
### Redirecting Maven repositories with mirrors
Use `mvn-mirrors` to redirect matching dependency and plugin repositories,
including Maven Central and repositories declared in project or parent POMs.
Unlike repository profiles, mirrors replace the destination Maven contacts.
The Central controls described above do not redirect arbitrary POM repositories.
Each nonblank line has the format `mirror-id:mirror-url:mirror-of`. IDs must be
unique within this input. `mirror-url` must be an absolute URL that includes a
scheme, such as `https://`. URL schemes, ports, IPv6 addresses, and colons in
`mirrorOf` selectors are preserved. An explicit `mirror-of` field is required
after the complete URL, including any port. Percent-encode colons in the URL
path, query, or fragment as `%3A`. Otherwise, text after the last unencoded
colon may be read as the `mirror-of` value. For example:
```yaml
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
distribution: 'temurin'
java-version: '21'
mvn-server-credentials: |
private:PRIVATE_REPOSITORY_USERNAME:PRIVATE_REPOSITORY_TOKEN
mvn-mirrors: |
private:https://maven.example.com/releases:*
- run: mvn --batch-mode verify
env:
PRIVATE_REPOSITORY_USERNAME: ${{ secrets.PRIVATE_REPOSITORY_USERNAME }}
PRIVATE_REPOSITORY_TOKEN: ${{ secrets.PRIVATE_REPOSITORY_TOKEN }}
```
This adds the following directly under `<settings>`, not inside a profile:
```xml
<mirrors>
<mirror>
<id>private</id>
<url>https://maven.example.com/releases</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
```
For authentication, the mirror ID must match a server ID configured through
`mvn-server-credentials` or the single-server inputs. Public mirrors do not need
matching credentials. Credentials remain environment-variable references in the
generated settings; do not put credential values in `mvn-mirrors`.
Mirrors can be used alone, as above, or alongside `mvn-repositories` and
`mvn-plugin-repositories`. They do not change those inputs or the Central
controls. Omitting `mvn-mirrors`, or supplying only blank lines, adds no
`<mirrors>` section or repository profile.
Maven interprets `mirrorOf`: `*` matches every repository, `central` matches
only that repository ID, `external:*` matches external repositories, and
`external:http:*` matches external HTTP repositories. Comma-separated patterns
such as `external:*,!internal` exclude specific IDs. Selector text and mirror
order are retained; Maven applies its own matching and precedence rules.
For example, a public mirror needs no additional repository or credential input:
```yaml
mvn-mirrors: |
public:https://mirror.example.com:8443/maven:external:*,!internal
```
Mirror generation respects `settings-path` and `overwrite-settings`. An existing
settings file is left untouched when `overwrite-settings: false`; this input
does not merge mirrors into that file.
### GPG
The example above uses the [Maven GPG Plugin](https://maven.apache.org/plugins/maven-gpg-plugin/)'s Bouncy Castle signer (`-Dgpg.signer=bc`, available since `maven-gpg-plugin` 3.2.0). It is a pure-Java signer that reads the key directly from the `MAVEN_GPG_KEY` environment variable, so it does **not** require the `gpg` executable, importing the key into a GPG keychain, or the `--pinentry-mode loopback` workaround in your `pom.xml`. The key must be an ASCII-armored secret key (transferable secret key format).
@@ -1229,7 +1310,7 @@ jobs:
## Java problem matcher (compiler annotations)
By default, `setup-java` registers a [problem matcher](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md) for Java after installing the JDK. It scans the log output of subsequent steps and turns Java diagnostics into GitHub [annotations](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message) that appear in the run summary and inline on the affected files. It matches three kinds of lines:
Java [problem matcher](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md) registration is disabled by default. Set `problem-matcher: true` to have `setup-java` register the matcher after installing the JDK. When enabled, it scans the log output of subsequent steps and turns Java diagnostics into GitHub [annotations](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message) that appear in the run summary and inline on the affected files. It matches three kinds of lines:
- Compiler errors and warnings, e.g. `App.java:12: error: cannot find symbol` (owner `javac`).
- Maven compiler errors and warnings, e.g. `[ERROR] /path/App.java:[12,5] cannot find symbol` (owner `maven-javac`).
@@ -1237,9 +1318,9 @@ By default, `setup-java` registers a [problem matcher](https://github.com/action
GitHub Actions limits problem matcher annotations to 10 of each severity per step and 50 annotations per job. Additional diagnostics remain available in the build log. Log grouping does not change these limits because every matched diagnostic still counts as an annotation.
### Disabling the problem matcher
### Enabling the problem matcher
Set `problem-matcher` to `false` to prevent the matcher from being registered:
Set `problem-matcher` to `true` to enable annotations, including in workflows that previously relied on default registration:
```yaml
jobs:
@@ -1252,13 +1333,13 @@ jobs:
with:
distribution: '<distribution>'
java-version: '21'
problem-matcher: false
problem-matcher: true
- name: Build with Maven
run: mvn package --file pom.xml
```
Disabling the matcher only stops annotations from being created. Compiler output remains in the log, and compilation errors still fail the build step.
Omit `problem-matcher` or set it to `false` to prevent this action invocation from registering the matcher. Compiler output remains in the log, and compilation errors still fail the build step. This does not unregister matchers already registered by other steps or earlier action invocations.
## Publishing using Gradle
```yaml
@@ -1571,4 +1652,4 @@ Notes and caveats:
- On **self-hosted runners**, importing into a tool-cache JDK persists for as long as that cached version remains on the runner; if you want it to survive JDK reinstalls, pre-seed the CA into your runner image or re-run the import step each time.
- Prefer giving the certificate a stable, descriptive `-alias` so re-runs are idempotent (re-importing the same alias will fail; add `keytool -delete -alias internal-ca ...` first if you re-run within a long-lived runner).
This documents the post-install workflow; there is no dedicated action input for supplying a custom `cacerts` file.
This documents the post-install workflow; there is no dedicated action input for supplying a custom `cacerts` file.

712
package-lock.json generated
View File

@@ -9,34 +9,34 @@
"version": "6.0.0",
"license": "MIT",
"dependencies": {
"@actions/cache": "^6.2.0",
"@actions/cache": "^6.3.0",
"@actions/core": "^3.0.1",
"@actions/exec": "^3.0.0",
"@actions/glob": "^0.7.0",
"@actions/http-client": "^4.0.1",
"@actions/io": "^3.0.2",
"@actions/tool-cache": "^4.0.0",
"fast-xml-parser": "^5.11.1",
"fast-xml-parser": "^5.12.0",
"semver": "^7.8.5"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@jest/globals": "^30.5.2",
"@types/node": "^26.6.2",
"@types/node": "^26.6.5",
"@types/semver": "^7.8.0",
"@typescript-eslint/eslint-plugin": "^8.70.1",
"@typescript-eslint/eslint-plugin": "^8.72.0",
"@typescript-eslint/parser": "^8.65.0",
"@vercel/ncc": "^0.45.0",
"eslint": "^10.11.0",
"eslint": "^10.13.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-jest": "^29.16.6",
"eslint-plugin-n": "^18.3.0",
"globals": "^17.12.0",
"eslint-plugin-jest": "^29.17.0",
"eslint-plugin-n": "^18.5.0",
"globals": "^17.13.0",
"husky": "^9.1.7",
"jest": "^30.5.2",
"lint-staged": "^17.5.1",
"prettier": "^3.9.9",
"ts-jest": "^29.4.13",
"lint-staged": "^17.6.0",
"prettier": "^3.9.10",
"ts-jest": "^29.4.15",
"typescript": "^6.0.3"
},
"engines": {
@@ -44,20 +44,20 @@
}
},
"node_modules/@actions/cache": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-6.2.0.tgz",
"integrity": "sha512-Nv0xWRmbxfDbAn/70flO/F6tj2Nv4XTYMAsQHiDFSojCDfso/Zni+fRKa14ToI9hnmOW/rQcY1WYb6wsM7Pgwg==",
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-6.3.0.tgz",
"integrity": "sha512-SJKaVMqTgetQgJF0wifi5N2+2mffCLy/D4w/3sJtRanBBGECdi1/OD0wswyLVmqEmPbYB/rVJk41Qn/xEbFjAw==",
"license": "MIT",
"dependencies": {
"@actions/core": "^3.0.1",
"@actions/exec": "^3.0.0",
"@actions/glob": "^0.6.1",
"@actions/glob": "^0.7.0",
"@actions/http-client": "^4.0.1",
"@actions/io": "^3.0.2",
"@azure/core-rest-pipeline": "^1.23.0",
"@azure/storage-blob": "^12.31.0",
"@azure/core-rest-pipeline": "~1.23.0",
"@azure/storage-blob": "~12.31.0",
"@protobuf-ts/runtime-rpc": "^2.11.1",
"semver": "^7.7.4"
"semver": "^7.8.5"
}
},
"node_modules/@actions/core": {
@@ -145,9 +145,9 @@
}
},
"node_modules/@azure/core-client": {
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.11.0.tgz",
"integrity": "sha512-JjQWO6akOck45PH/XBrxzsQGAiKrfFl4m5iggJ0ItMIz5omRufOXWpqCPpdjKN3vKDzlSUvFjaMb7Zwf0gvAdA==",
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.11.1.tgz",
"integrity": "sha512-2QygG2F76ZpMP2eMztiJvAiFMu71M9rDeU7vO/QKg5Css7MgM4frUOslFjhVjRhbGaCNPtz/S8M6y46/fFKVuQ==",
"license": "MIT",
"dependencies": {
"@azure/abort-controller": "^2.1.2",
@@ -206,9 +206,9 @@
}
},
"node_modules/@azure/core-rest-pipeline": {
"version": "1.25.0",
"resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.25.0.tgz",
"integrity": "sha512-bMs8ekJLjX8wPV+9IPBges1SLPyuDtE9g5gLDWOpxzKcoOFQnpLGkbcT1tdw3FaAmDS1gnPmMmJ6y/T5B96kIA==",
"version": "1.23.0",
"resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.23.0.tgz",
"integrity": "sha512-Evs1INHo+jUjwHi1T6SG6Ua/LHOQBCLuKEEE6efIpt4ZOoNonaT1kP32GoOcdNDbfqsD2445CPri3MubBy5DEQ==",
"license": "MIT",
"dependencies": {
"@azure/abort-controller": "^2.1.2",
@@ -220,7 +220,7 @@
"tslib": "^2.6.2"
},
"engines": {
"node": ">=22.0.0"
"node": ">=20.0.0"
}
},
"node_modules/@azure/core-tracing": {
@@ -276,9 +276,9 @@
}
},
"node_modules/@azure/storage-blob": {
"version": "12.33.0",
"resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.33.0.tgz",
"integrity": "sha512-2SX8oP8PyblUcAFZSg39c8Ls+tFjavM6sBeV+qpw33mRzRhI/5hrFJmJ/x0H9xx5l6ECPvgSP8uPxqTeVbHNIA==",
"version": "12.31.0",
"resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.31.0.tgz",
"integrity": "sha512-DBgNv10aCSxopt92DkTDD0o9xScXeBqPKGmR50FPZQaEcH4JLQ+GEOGEDv19V5BMkB7kxr+m4h6il/cCDPvmHg==",
"license": "MIT",
"dependencies": {
"@azure/abort-controller": "^2.1.2",
@@ -292,23 +292,23 @@
"@azure/core-util": "^1.11.0",
"@azure/core-xml": "^1.4.5",
"@azure/logger": "^1.1.4",
"@azure/storage-common": "^12.4.1",
"@azure/storage-common": "^12.3.0",
"events": "^3.0.0",
"tslib": "^2.8.1"
},
"engines": {
"node": ">=22.0.0"
"node": ">=20.0.0"
}
},
"node_modules/@azure/storage-common": {
"version": "12.4.1",
"resolved": "https://registry.npmjs.org/@azure/storage-common/-/storage-common-12.4.1.tgz",
"integrity": "sha512-t14unw/WofGDUi7TKJrsyXyPsN+NLgRm7hMaq0llxNmTIzt7f257+6LE6FKIJPh88zLj6M7LPvzve0fEYg/L3A==",
"version": "12.5.0",
"resolved": "https://registry.npmjs.org/@azure/storage-common/-/storage-common-12.5.0.tgz",
"integrity": "sha512-bttzuhQiCIwrkzjPDA+AtAR7dg19L/CC6ztcqJ5LfvWpXuys9mHp0UQ0udYnoUvv9SCT9KTR5kqFvFr0e6k0lQ==",
"license": "MIT",
"dependencies": {
"@azure/abort-controller": "^2.1.2",
"@azure/core-auth": "^1.9.0",
"@azure/core-http-compat": "^2.2.0",
"@azure/core-http-compat": "^2.4.0",
"@azure/core-rest-pipeline": "^1.24.0",
"@azure/core-tracing": "^1.2.0",
"@azure/core-util": "^1.11.0",
@@ -317,7 +317,25 @@
"tslib": "^2.8.1"
},
"engines": {
"node": ">=20.0.0"
"node": ">=22.0.0"
}
},
"node_modules/@azure/storage-common/node_modules/@azure/core-rest-pipeline": {
"version": "1.25.0",
"resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.25.0.tgz",
"integrity": "sha512-bMs8ekJLjX8wPV+9IPBges1SLPyuDtE9g5gLDWOpxzKcoOFQnpLGkbcT1tdw3FaAmDS1gnPmMmJ6y/T5B96kIA==",
"license": "MIT",
"dependencies": {
"@azure/abort-controller": "^2.1.2",
"@azure/core-auth": "^1.10.0",
"@azure/core-tracing": "^1.3.0",
"@azure/core-util": "^1.13.0",
"@azure/logger": "^1.3.0",
"@typespec/ts-http-runtime": "^0.3.4",
"tslib": "^2.6.2"
},
"engines": {
"node": ">=22.0.0"
}
},
"node_modules/@babel/code-frame": {
@@ -1623,9 +1641,9 @@
}
},
"node_modules/@nodable/entities": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-3.0.0.tgz",
"integrity": "sha512-8L9xFeTYKhm49xfIypoe2W5wV1m/3Z58kT+7kR9A8OyFxcPduI4VmxaUMQyKYrRjUoLLSXv6EKKID5Tvj9cUVw==",
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@nodable/entities/-/entities-3.1.0.tgz",
"integrity": "sha512-LsS/DjHr+uDM647Gru/cA8+J3a3HfhttwCKLyuoyN7yXTFCxKBtSgMQBvrW9yNPa2/zDRUNuGPaH5QUFoa4arQ==",
"funding": [
{
"type": "github",
@@ -2099,9 +2117,9 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.2.tgz",
"integrity": "sha512-X1P21scMv4zGKLYqjdGjaKa7COa0RKVYYZZN/NfvLQ1JegxFhdhpZG/Lyn8AXx6CDUavKAd11v6BvfpkDByK8g==",
"version": "26.6.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.5.tgz",
"integrity": "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2140,17 +2158,17 @@
"license": "MIT"
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.70.1.tgz",
"integrity": "sha512-nDNrUQ/4ruSNYbu749TRY7cfrzPtoLHEXSNBI8aaNY32LlZCajixqRf3FqcKC4p5Cam4VOHYx/t+i5+nKXvrqA==",
"version": "8.72.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.72.0.tgz",
"integrity": "sha512-aysKgysPX9XOv/dk95UkvUDe++Q3n3dJPG9CEWT3RUccxfkPJ+Qn6nhKPDhZXU6Ofo9kgwGWwKyQCnZIXTgngg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/regexpp": "^4.12.2",
"@typescript-eslint/scope-manager": "8.70.1",
"@typescript-eslint/type-utils": "8.70.1",
"@typescript-eslint/utils": "8.70.1",
"@typescript-eslint/visitor-keys": "8.70.1",
"@typescript-eslint/scope-manager": "8.72.0",
"@typescript-eslint/type-utils": "8.72.0",
"@typescript-eslint/utils": "8.72.0",
"@typescript-eslint/visitor-keys": "8.72.0",
"ignore": "^7.0.5",
"natural-compare": "^1.4.0",
"ts-api-utils": "^2.5.0"
@@ -2163,205 +2181,22 @@
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"@typescript-eslint/parser": "^8.70.1",
"@typescript-eslint/parser": "^8.72.0",
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.70.1.tgz",
"integrity": "sha512-7zKTnyvaVWqzLZHPFQtX1hVHqgkMC+WebPWakNCSyrQVbIP1AM0L0TlBZtACldIRb6PptI8Odk+jyZ5kP3B1VA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.70.1",
"@typescript-eslint/typescript-estree": "8.70.1",
"@typescript-eslint/utils": "8.70.1",
"debug": "^4.4.3",
"ts-api-utils": "^2.5.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.70.1.tgz",
"integrity": "sha512-TU8PwyGN0PQJUcE96mw8eCQ44SmxGdQlJmlWakHaHQ15eIuuvye5yNtmh/i6oS88jzXVQB71xdNkbkB/fMwL0g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/project-service": "8.70.1",
"@typescript-eslint/tsconfig-utils": "8.70.1",
"@typescript-eslint/types": "8.70.1",
"@typescript-eslint/visitor-keys": "8.70.1",
"debug": "^4.4.3",
"minimatch": "^10.2.2",
"semver": "^7.7.3",
"tinyglobby": "^0.2.15",
"ts-api-utils": "^2.5.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/project-service": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.70.1.tgz",
"integrity": "sha512-62xOgboPfwc3/IgPSX/W6oQR3ZbF04194FPGUGH8HL8iLFHbt/456/8Ph1wLNUgVF+s94FlHoipBsz+v7+LMnA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.70.1",
"@typescript-eslint/types": "^8.70.1",
"debug": "^4.4.3"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.70.1.tgz",
"integrity": "sha512-jumze1fPI+sDOaM2TWGQdn39PDxTr7TZGeuyLkAbNyx2vtMT3uRnVKChN0hfht5V2TugphJzF6bYXvBcE09qqg==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.70.1.tgz",
"integrity": "sha512-Esgul8MsnKnRLdYU2Eb2cRV9bS5HJYtKj1ByJnOzzG2M58DGdSUQ1jUuILxipqcpB2h9WLrbD5GijIWUjX/Tqw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.9.1",
"@typescript-eslint/scope-manager": "8.70.1",
"@typescript-eslint/types": "8.70.1",
"@typescript-eslint/typescript-estree": "8.70.1"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.70.1.tgz",
"integrity": "sha512-TU8PwyGN0PQJUcE96mw8eCQ44SmxGdQlJmlWakHaHQ15eIuuvye5yNtmh/i6oS88jzXVQB71xdNkbkB/fMwL0g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/project-service": "8.70.1",
"@typescript-eslint/tsconfig-utils": "8.70.1",
"@typescript-eslint/types": "8.70.1",
"@typescript-eslint/visitor-keys": "8.70.1",
"debug": "^4.4.3",
"minimatch": "^10.2.2",
"semver": "^7.7.3",
"tinyglobby": "^0.2.15",
"ts-api-utils": "^2.5.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/project-service": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.70.1.tgz",
"integrity": "sha512-62xOgboPfwc3/IgPSX/W6oQR3ZbF04194FPGUGH8HL8iLFHbt/456/8Ph1wLNUgVF+s94FlHoipBsz+v7+LMnA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.70.1",
"@typescript-eslint/types": "^8.70.1",
"debug": "^4.4.3"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.70.1.tgz",
"integrity": "sha512-jumze1fPI+sDOaM2TWGQdn39PDxTr7TZGeuyLkAbNyx2vtMT3uRnVKChN0hfht5V2TugphJzF6bYXvBcE09qqg==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/parser": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.70.1.tgz",
"integrity": "sha512-nO974WLllwhSFWQXnMLj6nDGa8f0khKEz1JzpPJ1u7Vm/4X1X6ZHajpoknU4bb41vJyMB0HHVyS2GqdhWfIXZw==",
"version": "8.72.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.0.tgz",
"integrity": "sha512-0O+x3ynciD6zuXb1CKSu165haQV6ey53DKhHHUnujP7U+XlltJG+/keT0Xhd1HXCze+IHf7Tvt39ovyepX/LNw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/scope-manager": "8.70.1",
"@typescript-eslint/types": "8.70.1",
"@typescript-eslint/typescript-estree": "8.70.1",
"@typescript-eslint/visitor-keys": "8.70.1",
"@typescript-eslint/scope-manager": "8.72.0",
"@typescript-eslint/types": "8.72.0",
"@typescript-eslint/typescript-estree": "8.72.0",
"@typescript-eslint/visitor-keys": "8.72.0",
"debug": "^4.4.3"
},
"engines": {
@@ -2376,43 +2211,15 @@
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.70.1.tgz",
"integrity": "sha512-TU8PwyGN0PQJUcE96mw8eCQ44SmxGdQlJmlWakHaHQ15eIuuvye5yNtmh/i6oS88jzXVQB71xdNkbkB/fMwL0g==",
"node_modules/@typescript-eslint/project-service": {
"version": "8.72.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.0.tgz",
"integrity": "sha512-bzHngBbmIgzj6TsTjVUCntGx6FFLgE7mPjpO0PzHycOaZHXqS43XnrkFIHRS16LLr/xO6FHSXG3GJFo/F4bSBQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/project-service": "8.70.1",
"@typescript-eslint/tsconfig-utils": "8.70.1",
"@typescript-eslint/types": "8.70.1",
"@typescript-eslint/visitor-keys": "8.70.1",
"debug": "^4.4.3",
"minimatch": "^10.2.2",
"semver": "^7.7.3",
"tinyglobby": "^0.2.15",
"ts-api-utils": "^2.5.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/project-service": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.70.1.tgz",
"integrity": "sha512-62xOgboPfwc3/IgPSX/W6oQR3ZbF04194FPGUGH8HL8iLFHbt/456/8Ph1wLNUgVF+s94FlHoipBsz+v7+LMnA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.70.1",
"@typescript-eslint/types": "^8.70.1",
"@typescript-eslint/tsconfig-utils": "^8.72.0",
"@typescript-eslint/types": "^8.72.0",
"debug": "^4.4.3"
},
"engines": {
@@ -2426,32 +2233,15 @@
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.70.1.tgz",
"integrity": "sha512-jumze1fPI+sDOaM2TWGQdn39PDxTr7TZGeuyLkAbNyx2vtMT3uRnVKChN0hfht5V2TugphJzF6bYXvBcE09qqg==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.70.1.tgz",
"integrity": "sha512-Pa0EeSeAusQc1WbjQMac+YfenewYTBu0KjgYvkUKwhXaHUKbFog23Dm/rp0DX/6tyYOQ3Xl1a+3EcFNZynGHCw==",
"version": "8.72.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.0.tgz",
"integrity": "sha512-JewPyJOYcXBSAS7PIgufscHOwZqhTGyBRiQJhhuDln66tMchxvvt7nJ90JKKIoOelmdHA3kAQbm9cEUHc4JSEA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.70.1",
"@typescript-eslint/visitor-keys": "8.70.1"
"@typescript-eslint/types": "8.72.0",
"@typescript-eslint/visitor-keys": "8.72.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2461,10 +2251,52 @@
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.72.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.0.tgz",
"integrity": "sha512-0vbxCf7xLVPSjcOdm6eQbgViH8EDJ8xnl1laLT9yoqSz2YmcSfSg5Vdl0JUvZf6rcuJ0ZivJIuMD4edTg8obaA==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/type-utils": {
"version": "8.72.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.0.tgz",
"integrity": "sha512-gEXxmmbSTSOVTC37IYYvremOM31v+UN2W772bJxmVYPhAOPSUxtacyb7wkm1EhkYKU6KzFJsdU44DCV4to0LWw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.72.0",
"@typescript-eslint/typescript-estree": "8.72.0",
"@typescript-eslint/utils": "8.72.0",
"debug": "^4.4.3",
"ts-api-utils": "^2.5.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/types": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.70.1.tgz",
"integrity": "sha512-Dm1ypdhhrGCTyyehxElhgJ6kgk8MVCv5qXdoOVqPr1uqk42jX8KjrZqhROvdShczA8qrDoYiOWn1ykWlx2k81Q==",
"version": "8.72.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.0.tgz",
"integrity": "sha512-Adfoy59kxNEjT5E5fnyrp7GpHYuWs8ONbdohu4ez6IU46qDq8LltG90tLmkucZB2uhYL8mqBjtXqGd8yhfjXqQ==",
"dev": true,
"license": "MIT",
"engines": {
@@ -2475,14 +2307,66 @@
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.70.1.tgz",
"integrity": "sha512-Vwj9lUIW5Xq3wQ9w6gv3R86g1hMK8f2zNOdGTAgeXUMMXFK78G9ruCjjqutHMNJc0+CH7LYRnHeUB9IT8wFmcw==",
"node_modules/@typescript-eslint/typescript-estree": {
"version": "8.72.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.0.tgz",
"integrity": "sha512-gwLfFgWcw15tN2KXDCJvxEOQjPn+P3j/n3eSqkZ5sX4VpW9Cosodr+tWwBZRvJT3TcKx6HnPRGZMCNAiP1Xhug==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.70.1",
"@typescript-eslint/project-service": "8.72.0",
"@typescript-eslint/tsconfig-utils": "8.72.0",
"@typescript-eslint/types": "8.72.0",
"@typescript-eslint/visitor-keys": "8.72.0",
"debug": "^4.4.3",
"minimatch": "^10.2.2",
"semver": "^7.7.3",
"tinyglobby": "^0.2.15",
"ts-api-utils": "^2.5.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/utils": {
"version": "8.72.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.0.tgz",
"integrity": "sha512-0up3oArJZBYnzOaEXKo8DmI43QvMZyPoFEt9LWzRJcyl/RcJjfKKPebknN1VbTgXBf3M/KggUh5uUMdURLnseg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.9.1",
"@typescript-eslint/scope-manager": "8.72.0",
"@typescript-eslint/types": "8.72.0",
"@typescript-eslint/typescript-estree": "8.72.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "8.72.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.0.tgz",
"integrity": "sha512-E2mroviasaWecDzTGiGMtuEguuLVOeRggnrIn93CJuxYJzQBHbyymlT08aVQydbBal5538o+JkBKXh2sRuCyIA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.72.0",
"eslint-visitor-keys": "^5.0.0"
},
"engines": {
@@ -2507,9 +2391,9 @@
}
},
"node_modules/@typespec/ts-http-runtime": {
"version": "0.3.7",
"resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.7.tgz",
"integrity": "sha512-JVUD8X2tfDMWjcjLs4yVxxVrS8yR5vnh386GAXT9Qj79nBxxXSaHFQZg5FweLmT8HlPQ3kii6noUB+Z9RN7DvQ==",
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.9.tgz",
"integrity": "sha512-edSdeAqkdxBVzA1yL1LrLCml1YjyCVvPMtMqJpbF+6K609tHe8V6sQUzFQSGcYNhcuhOceZtjvN32+mpIth30A==",
"license": "MIT",
"dependencies": {
"http-proxy-agent": "^7.0.0",
@@ -3541,9 +3425,9 @@
}
},
"node_modules/eslint": {
"version": "10.11.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.11.0.tgz",
"integrity": "sha512-P7a6UEEqb9G95MYAtqkmsTbVXIYyzIfl6NGOIJk162PaahFxFyeGcrlXYFSiagECg4sEm8IseJdZBKR3rx6MsQ==",
"version": "10.13.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.13.0.tgz",
"integrity": "sha512-UohDjD4zSzEwhf58M3O7vc/ycc8O1I7dNlhtD0WxE8Px8EHNJKtUwzBqrzeGhisRuv2ag4sAYswszCJRgKXYUg==",
"dev": true,
"license": "MIT",
"workspaces": [
@@ -3654,9 +3538,9 @@
}
},
"node_modules/eslint-plugin-jest": {
"version": "29.16.6",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.16.6.tgz",
"integrity": "sha512-q8TVr0rlNvUD0XnafGWkwtPeX+tTl2llP86EDl3sJtwWrQA/JT9SIu2hLLZbhhX6fT5SDE4O0gIKyZUujKnkYA==",
"version": "29.17.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.17.0.tgz",
"integrity": "sha512-6jtpU6MhYKbagkES02TupWAUUooJpZtKg94Ax0b8HhUorv3InSTBU8RRtlSBe0LocOcShXOpyec3PHzPDkJCSg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -3683,101 +3567,10 @@
}
}
},
"node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/utils": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.70.1.tgz",
"integrity": "sha512-Esgul8MsnKnRLdYU2Eb2cRV9bS5HJYtKj1ByJnOzzG2M58DGdSUQ1jUuILxipqcpB2h9WLrbD5GijIWUjX/Tqw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.9.1",
"@typescript-eslint/scope-manager": "8.70.1",
"@typescript-eslint/types": "8.70.1",
"@typescript-eslint/typescript-estree": "8.70.1"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.70.1.tgz",
"integrity": "sha512-TU8PwyGN0PQJUcE96mw8eCQ44SmxGdQlJmlWakHaHQ15eIuuvye5yNtmh/i6oS88jzXVQB71xdNkbkB/fMwL0g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/project-service": "8.70.1",
"@typescript-eslint/tsconfig-utils": "8.70.1",
"@typescript-eslint/types": "8.70.1",
"@typescript-eslint/visitor-keys": "8.70.1",
"debug": "^4.4.3",
"minimatch": "^10.2.2",
"semver": "^7.7.3",
"tinyglobby": "^0.2.15",
"ts-api-utils": "^2.5.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/project-service": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.70.1.tgz",
"integrity": "sha512-62xOgboPfwc3/IgPSX/W6oQR3ZbF04194FPGUGH8HL8iLFHbt/456/8Ph1wLNUgVF+s94FlHoipBsz+v7+LMnA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.70.1",
"@typescript-eslint/types": "^8.70.1",
"debug": "^4.4.3"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.70.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.70.1.tgz",
"integrity": "sha512-jumze1fPI+sDOaM2TWGQdn39PDxTr7TZGeuyLkAbNyx2vtMT3uRnVKChN0hfht5V2TugphJzF6bYXvBcE09qqg==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/eslint-plugin-n": {
"version": "18.3.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-18.3.0.tgz",
"integrity": "sha512-cPVguuDe6DrIPb/qUXHf8P89MaVTUmiYWwpt5gX5AILsvRIiZAxMFXcFR6QHYBksqKJpjfUBlL/RleCJUWcD7w==",
"version": "18.5.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-18.5.0.tgz",
"integrity": "sha512-M7uF6MTN/An+AXqvyIbXq7npJIZOkd5eKo8iMMvWrcDVNyZVdA6TF2lw01aKQfCEidRfpnR78GhAjZorlXNHiw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -3788,6 +3581,7 @@
"globals": "^15.11.0",
"globrex": "^0.1.2",
"ignore": "^5.3.2",
"js-yaml": "^5.4.1",
"semver": "^7.6.3"
},
"engines": {
@@ -3810,6 +3604,23 @@
}
}
},
"node_modules/eslint-plugin-n/node_modules/argparse": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-3.0.4.tgz",
"integrity": "sha512-fwWK3Zq22l4XJJjx5mcBHGikIk+hJqO+32dPm0Jur7+rtG5x1scOjSfdT9ZKeWHPpsya/l0HHK4tDImBkTrtvA==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/puzrin"
},
{
"type": "github",
"url": "https://github.com/sponsors/nodeca"
}
],
"license": "PSF-2.0"
},
"node_modules/eslint-plugin-n/node_modules/globals": {
"version": "15.15.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz",
@@ -3833,6 +3644,29 @@
"node": ">= 4"
}
},
"node_modules/eslint-plugin-n/node_modules/js-yaml": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.5.0.tgz",
"integrity": "sha512-paNr4LFIFPjeeSmwNYdrb8FafLLG/Cr2Af3GjbsHJ5CxIjH4r0c2emlmRdAtpPAieP1gRVzk6buBbVP5gBMGAg==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/puzrin"
},
{
"type": "github",
"url": "https://github.com/sponsors/nodeca"
}
],
"license": "MIT",
"dependencies": {
"argparse": "^3.0.3"
},
"bin": {
"js-yaml": "bin/js-yaml.mjs"
}
},
"node_modules/eslint-scope": {
"version": "9.1.2",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz",
@@ -4069,9 +3903,9 @@
"license": "MIT"
},
"node_modules/fast-xml-builder": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.3.0.tgz",
"integrity": "sha512-F74cZEdCvuw9P41GAC3rod4X04jjWGM1JPEv/GWSqFTWLsdyMSBMBMlm9Hk3GLBgLBbdBNY8yee0pQh2RBVESQ==",
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/fast-xml-builder/-/fast-xml-builder-1.3.1.tgz",
"integrity": "sha512-pIM/1n3ntFXKYrUZwW7QCK0gAW7XY+wzj1YMIV3tLDvPj/V+zTGJK5e3/4WJfwj0qWw2ElNXiTixda/R+3YSug==",
"funding": [
{
"type": "github",
@@ -4085,9 +3919,9 @@
}
},
"node_modules/fast-xml-parser": {
"version": "5.11.1",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.11.1.tgz",
"integrity": "sha512-TBw6K/fxoQGGjCmZDw9w/ZwP3uDcnTM4YH/g+PFRWr8sbe5idXtxNN6vITh4+1ruCZaho6uBFurElsA7F0zzgw==",
"version": "5.12.0",
"resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.12.0.tgz",
"integrity": "sha512-/pXxRBtwxY9w8z7YbgsvIPPcPvFDsTbIkWwTQJhzNJPokj+TbN6ftmcv4j/pEQDvOCNnKGDzuk5Bo2oogIOiFg==",
"funding": [
{
"type": "github",
@@ -4096,11 +3930,11 @@
],
"license": "MIT",
"dependencies": {
"@nodable/entities": "^3.0.0",
"fast-xml-builder": "^1.2.0",
"is-unsafe": "^2.0.0",
"@nodable/entities": "^3.1.0",
"fast-xml-builder": "^1.3.1",
"is-unsafe": "^2.0.3",
"path-expression-matcher": "^1.6.2",
"strnum": "^2.4.2",
"strnum": "^2.5.1",
"xml-naming": "^0.3.0"
},
"bin": {
@@ -4293,9 +4127,9 @@
}
},
"node_modules/globals": {
"version": "17.12.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-17.12.0.tgz",
"integrity": "sha512-cezEd/DTyyht9cvSSURyygXPfy04GtWO/5e6ZPvH7fCtjKz9PYOmuawphw1Ctd1f6C+5JypXfGD7ahNMXvevBA==",
"version": "17.13.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-17.13.0.tgz",
"integrity": "sha512-RwMTC61u7hrG3ZJMkZQOK4JLJrKS8QtoTii63EmWvFXHqycY9FObBJQCbsLxSO8kjKhWE5kV1GC+Vb1g3RI0Zg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -4534,9 +4368,9 @@
}
},
"node_modules/is-unsafe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-unsafe/-/is-unsafe-2.0.0.tgz",
"integrity": "sha512-2LdV822R+wmI86unXA93WCFpL6g+av8ynWk0nrHyJqGop5VoocYsSLFgN8jrfalT6iGeLNM4KXuVSsULP53kEA==",
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/is-unsafe/-/is-unsafe-2.0.3.tgz",
"integrity": "sha512-ZBllczCCO267vgdFb6Tq3pv+LhHaCiGMdr+ZsuL+OopruAg7S+3ZDs1vD0RPC0uSrkjzbraxaGjtX1YBxjPeFQ==",
"funding": [
{
"type": "github",
@@ -5311,9 +5145,9 @@
"license": "MIT"
},
"node_modules/lint-staged": {
"version": "17.5.1",
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-17.5.1.tgz",
"integrity": "sha512-7EDuco1xnBMeVpvAbeMq1U5KXwJGLmY8q6l+Ye78r36C4mPc+Vg1Z2SK8gHyRTyvPro90A0q5/FAZ+Au23d6QQ==",
"version": "17.6.0",
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-17.6.0.tgz",
"integrity": "sha512-nOhBfYkZEwkFtNzD5pK9s9LkcWoxJ+whLzEnhqi9nl7zTB5n7tg8+9iYgMGx2Wm3VlLu8cbNj0RACzY+nWi5iQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -5331,7 +5165,7 @@
"url": "https://opencollective.com/lint-staged"
},
"optionalDependencies": {
"yaml": "^2.9.0"
"yaml": "^2.9.1"
}
},
"node_modules/locate-path": {
@@ -5799,9 +5633,9 @@
}
},
"node_modules/prettier": {
"version": "3.9.9",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.9.tgz",
"integrity": "sha512-Z/CJHIkdujO/OtN7nXUii0Rf3VT5SRuhjBA82Xvu2XhBUgX3nhP67T0LHceBdQLex7OOFGTox+Q5Yg8Jk2Qivg==",
"version": "3.9.10",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.10.tgz",
"integrity": "sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==",
"dev": true,
"license": "MIT",
"bin": {
@@ -6117,9 +5951,9 @@
}
},
"node_modules/strnum": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/strnum/-/strnum-2.4.2.tgz",
"integrity": "sha512-rDG3Ah4TV0k1hWvLSzkZtMmLN9+eS+h3knq4MP6A42Y3Yh5qGNnOUs1jJkoSr8FG5dsL28c7KgkIBzSEykqtuw==",
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/strnum/-/strnum-2.5.1.tgz",
"integrity": "sha512-UM4nTLWzQiDBseVxUGxN0wJzIk0UU89Qi7pKXz9qISo+lhviJikTuikBsK/oFRlpvYHvSdz0TVoLyQ+sEpYwxA==",
"funding": [
{
"type": "github",
@@ -6230,15 +6064,15 @@
}
},
"node_modules/ts-jest": {
"version": "29.4.13",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.13.tgz",
"integrity": "sha512-rUQG+Ar95cNQf//KvsSjvabLpCTbwk+vKGWkAgiKFugqVwmOpGR7n7xa3S68/AB21Wn0KNhIAVxmxrUsz0L1AQ==",
"version": "29.4.15",
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.15.tgz",
"integrity": "sha512-s2qmEUYFRqbjz1wv0EmccNPVOb45HOFpFuhzQJLKShYVisuTbCFPIIAIV2EuK5rIxb4BejLDbH7dnBZfYjybUQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"bs-logger": "^0.2.6",
"fast-json-stable-stringify": "^2.1.0",
"handlebars": "^4.7.9",
"handlebars": "^4.7.10",
"json5": "^2.2.3",
"lodash.memoize": "^4.1.2",
"make-error": "^1.3.6",
@@ -6582,9 +6416,9 @@
"license": "ISC"
},
"node_modules/yaml": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",
"integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz",
"integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==",
"dev": true,
"license": "ISC",
"optional": true,

View File

@@ -14,6 +14,7 @@
"format-check": "prettier --no-error-on-unmatched-pattern --check \"**/*.{ts,yml,yaml}\"",
"lint": "eslint \"**/*.ts\"",
"lint:fix": "eslint \"**/*.ts\" --fix",
"build:latest-versions-report": "ncc build -o lib/latest-versions-report src/reports/latest-versions.ts",
"check": "npm run format-check && npm run lint && npm run build && npm test",
"fix": "npm run format && npm run lint:fix && npm run build",
"prepare": "husky install",
@@ -42,34 +43,34 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/cache": "^6.2.0",
"@actions/cache": "^6.3.0",
"@actions/core": "^3.0.1",
"@actions/exec": "^3.0.0",
"@actions/glob": "^0.7.0",
"@actions/http-client": "^4.0.1",
"@actions/io": "^3.0.2",
"@actions/tool-cache": "^4.0.0",
"fast-xml-parser": "^5.11.1",
"fast-xml-parser": "^5.12.0",
"semver": "^7.8.5"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@jest/globals": "^30.5.2",
"@types/node": "^26.6.2",
"@types/node": "^26.6.5",
"@types/semver": "^7.8.0",
"@typescript-eslint/eslint-plugin": "^8.70.1",
"@typescript-eslint/eslint-plugin": "^8.72.0",
"@typescript-eslint/parser": "^8.65.0",
"@vercel/ncc": "^0.45.0",
"eslint": "^10.11.0",
"eslint": "^10.13.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-jest": "^29.16.6",
"eslint-plugin-n": "^18.3.0",
"globals": "^17.12.0",
"eslint-plugin-jest": "^29.17.0",
"eslint-plugin-n": "^18.5.0",
"globals": "^17.13.0",
"husky": "^9.1.7",
"jest": "^30.5.2",
"lint-staged": "^17.5.1",
"prettier": "^3.9.9",
"ts-jest": "^29.4.13",
"lint-staged": "^17.6.0",
"prettier": "^3.9.10",
"ts-jest": "^29.4.15",
"typescript": "^6.0.3"
},
"bugs": {

View File

@@ -0,0 +1,96 @@
import fs from 'node:fs';
import path from 'node:path';
import {execFileSync} from 'node:child_process';
import {createRequire} from 'node:module';
const [checkout, ref, destination] = process.argv.slice(2);
if (!checkout || !ref || !destination) {
throw new Error(
'Usage: node scripts/build-report-resolver.mjs <checkout> <ref> <output-dir>'
);
}
const root = path.resolve(checkout);
const output = path.resolve(destination);
const ts = createRequire(path.join(root, 'package.json'))('typescript');
const packageJson = JSON.parse(
fs.readFileSync(path.join(root, 'package.json'), 'utf8')
);
const source = {
ref,
sha: execFileSync('git', ['rev-parse', 'HEAD'], {
cwd: root,
encoding: 'utf8'
}).trim(),
version: packageJson.version
};
const capabilityFile = path.join(root, 'src/distributions/platform-types.ts');
const packageFile = path.join(root, 'src/distributions/package-types.ts');
const enumFile = fs.existsSync(packageFile)
? packageFile
: path.join(root, 'src/distributions/distribution-factory.ts');
const syntax = ts.createSourceFile(
enumFile,
fs.readFileSync(enumFile, 'utf8'),
ts.ScriptTarget.Latest,
true
);
const declaration = syntax.statements.find(
statement =>
ts.isEnumDeclaration(statement) &&
statement.name.text === 'JavaDistribution'
);
if (!declaration) {
throw new Error(`Cannot find the distribution enum in ${enumFile}`);
}
const distributions = declaration.members
.map(member => {
if (!member.initializer || !ts.isStringLiteral(member.initializer)) {
throw new Error(`Expected a string-valued distribution in ${enumFile}`);
}
return member.initializer.text;
})
.filter(value => value !== 'jdkfile');
// Keep source and dependencies from the selected checkout. Only this small
// reporting entrypoint is injected; no installer or version matcher is replaced.
const entrypoint = path.join(root, 'report-resolver-entry.js');
fs.writeFileSync(
entrypoint,
`
export {getJavaDistribution} from './src/distributions/distribution-factory.ts';
import {LibericaDistributions} from './src/distributions/liberica/installer.ts';
${fs.existsSync(capabilityFile) ? "export {JAVA_PLATFORM_CAPABILITIES as capabilities} from './src/distributions/platform-types.ts';" : ''}
export const source = ${JSON.stringify(source)};
export const distributions = ${JSON.stringify(distributions)};
export function createSolarisInstaller(options) {
const installer = new LibericaDistributions(options);
const getPlatformOption = installer.getPlatformOption.bind(installer);
installer.getPlatformOption = () => getPlatformOption('sunos');
return installer;
}
`,
{flag: 'wx'}
);
try {
execFileSync(
process.execPath,
[
path.join(root, 'node_modules/@vercel/ncc/dist/ncc/cli.js'),
'build',
entrypoint,
'-o',
output
],
{cwd: root, stdio: 'inherit'}
);
// v5 is CommonJS even when the artifact is loaded from an ESM workspace.
fs.writeFileSync(
path.join(output, 'package.json'),
JSON.stringify({
type: packageJson.type ?? 'commonjs'
})
);
} finally {
fs.rmSync(entrypoint, {force: true});
}

View File

@@ -30,11 +30,20 @@ export interface MavenRepositorySettings {
prioritizeCentral: boolean;
}
export interface MavenMirror {
id: string;
url: string;
mirrorOf: string;
}
const MAVEN_REPOSITORY_ORIGIN = /^[A-Za-z][A-Za-z0-9+.-]*:\/\/[^/?#@]+\/?$/;
export async function configureAuthentication() {
const servers = getMavenServerSettings();
const repositorySettings = getMavenRepositorySettings();
const mirrors = parseMavenMirrors(
core.getMultilineInput(constants.INPUT_MVN_MIRRORS)
);
const settingsDirectory =
core.getInput(constants.INPUT_SETTINGS_PATH) ||
path.join(os.homedir(), constants.M2_DIR);
@@ -60,7 +69,8 @@ export async function configureAuthentication() {
settingsDirectory,
overwriteSettings,
gpgPassphraseEnvVar,
repositorySettings
repositorySettings,
mirrors
);
if (gpgPrivateKey) {
@@ -333,6 +343,55 @@ export function parseMavenRepositories(
return repositories;
}
// only exported for testing purposes
export function parseMavenMirrors(entries: string[]): MavenMirror[] {
const mirrors: MavenMirror[] = [];
const mirrorIds = new Set<string>();
entries.forEach((entry, index) => {
if (!entry.trim()) {
return;
}
const separator = entry.indexOf(':');
const remainder = entry.slice(separator + 1).trim();
// Protect scheme/authority colons (including IPv6 and ports) before
// finding the selector, which may itself contain external:http:*.
const urlPrefix =
/^[A-Za-z][A-Za-z0-9+.-]*:(?:\/\/(?:[^/?#@\s]*@)?(?:\[[^\]]+\]|[^:/?#\s]+)(?::\d+(?=[/?#:\s]|$))?)?/.exec(
remainder
)?.[0] ?? '';
const fields =
/^(.*?):((?:\s*!?external:(?:http:)?\*\s*|[^:,]*)(?:,(?:\s*!?external:(?:http:)?\*\s*|[^:,]*))*)$/.exec(
remainder.slice(urlPrefix.length)
);
if (separator < 0 || !fields) {
throw new Error(
`Invalid mvn-mirrors entry at line ${index + 1}. Expected format: mirror-id:mirror-url:mirror-of`
);
}
const id = entry.slice(0, separator).trim();
const url = `${urlPrefix}${fields[1]}`.trim();
const mirrorOf = fields[2].trim();
if (!id || !url || !mirrorOf) {
throw new Error(
`Invalid mvn-mirrors entry at line ${index + 1}. mirror-id, mirror URL, and mirror-of are required`
);
}
if (mirrorIds.has(id)) {
throw new Error(
`Duplicate mirror-id '${id}' in mvn-mirrors input at line ${index + 1}`
);
}
mirrorIds.add(id);
mirrors.push({id, url, mirrorOf});
});
return mirrors;
}
function generateRepositorySection(
customRepositories: MavenRepository[],
settings: MavenRepositorySettings,
@@ -388,7 +447,8 @@ export async function createAuthenticationSettings(
settingsDirectory: string,
overwriteSettings: boolean,
gpgPassphraseEnvVar: string | undefined = undefined,
repositorySettings: MavenRepositorySettings | undefined = undefined
repositorySettings: MavenRepositorySettings | undefined = undefined,
mirrors: MavenMirror[] = []
) {
core.info(
`Creating ${constants.MVN_SETTINGS_FILE} with server-id: ${servers.map(server => server.id).join(', ')}`
@@ -398,7 +458,7 @@ export async function createAuthenticationSettings(
await io.mkdirP(settingsDirectory);
await write(
settingsDirectory,
generate(servers, gpgPassphraseEnvVar, repositorySettings),
generate(servers, gpgPassphraseEnvVar, repositorySettings, mirrors),
overwriteSettings
);
}
@@ -407,7 +467,8 @@ export async function createAuthenticationSettings(
export function generate(
servers: MavenServerCredentials[],
gpgPassphraseEnvVar?: string | undefined,
repositorySettings?: MavenRepositorySettings | undefined
repositorySettings?: MavenRepositorySettings | undefined,
mirrors: MavenMirror[] = []
) {
// The maven-gpg-plugin reads the passphrase from the environment variable
// named by the `gpg.passphraseEnvName` property (default MAVEN_GPG_PASSPHRASE).
@@ -447,6 +508,20 @@ export function generate(
}
lines.push(' </servers>');
if (mirrors.length) {
lines.push(' <mirrors>');
for (const mirror of mirrors) {
lines.push(
' <mirror>',
` <id>${escapeXmlText(mirror.id)}</id>`,
` <url>${escapeXmlText(mirror.url)}</url>`,
` <mirrorOf>${escapeXmlText(mirror.mirrorOf)}</mirrorOf>`,
' </mirror>'
);
}
lines.push(' </mirrors>');
}
if (repositorySettings || includeGpgPassphraseProfile) {
lines.push(' <profiles>');
if (repositorySettings) {

View File

@@ -20,6 +20,7 @@ export const INPUT_MVN_SERVER_REPOSITORY_ORIGINS =
'mvn-server-repository-origins';
export const INPUT_MVN_REPOSITORIES = 'mvn-repositories';
export const INPUT_MVN_PLUGIN_REPOSITORIES = 'mvn-plugin-repositories';
export const INPUT_MVN_MIRRORS = 'mvn-mirrors';
export const INPUT_MVN_REPOSITORIES_INCLUDE_CENTRAL =
'mvn-repositories-include-central';
export const INPUT_MVN_REPOSITORIES_PRIORITIZE_CENTRAL =

View File

@@ -1,10 +1,13 @@
import * as core from '@actions/core';
import fs from 'fs';
import path from 'path';
import {HttpCodes} from '@actions/http-client';
import {
cacheJdkDir,
extractJdkFile,
getDownloadArchiveExtension,
getGitHubHttpHeaders,
isExactCorrettoVersion,
convertVersionToSemver,
renameWinArchive
} from '../../util.js';
@@ -24,8 +27,19 @@ const CORRETTO_VERSIONS_URL =
'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json';
export class CorrettoDistribution extends JavaBase {
private readonly requestedVersion: string;
constructor(installerOptions: JavaInstallerOptions) {
super('Corretto', installerOptions);
super('Corretto', {
...installerOptions,
// Java 8 releases use zero-padded fields, e.g. 8.472.08.1.
version: isExactCorrettoVersion(installerOptions.version)
? installerOptions.version.replace(/(^|\.)0+(?=\d)/g, '$1')
: installerOptions.version
});
this.requestedVersion = installerOptions.version
.replace('+', '.')
.replace(/^8\.(\d+)\.(\d)\./, '8.$1.0$2.');
}
protected async downloadTool(
@@ -63,6 +77,9 @@ export class CorrettoDistribution extends JavaBase {
if (!this.stable) {
throw new Error('Early access versions are not supported');
}
if (isExactCorrettoVersion(this.requestedVersion)) {
return this.findExactRelease();
}
const availableVersions = await this.getAvailableVersions();
// The `latest` alias is normalized to the SemVer wildcard, but Corretto
@@ -83,7 +100,9 @@ export class CorrettoDistribution extends JavaBase {
}
if (version.includes('.')) {
throw new Error('Only major versions are supported');
throw new Error(
'Specify a major version or a full Corretto release, such as 25.0.5.0.10'
);
}
const matchingVersions = availableVersions
.filter(item => item.version == version)
@@ -110,6 +129,91 @@ export class CorrettoDistribution extends JavaBase {
return resolvedVersion;
}
private async findExactRelease(): Promise<JavaDownloadRelease> {
const version = this.requestedVersion;
const major = version.split('.')[0];
const platform = this.getPlatformOption();
const arch = this.architecture;
if (platform !== 'windows' && this.packageType !== 'jdk') {
throw new Error('Corretto JRE archives are only available for Windows');
}
const os =
platform === 'macos'
? 'macosx'
: platform === 'alpine'
? 'alpine-linux'
: platform;
const suffix =
platform === 'windows' ? `-${this.packageType}.zip` : '.tar.gz';
const url = `https://corretto.aws/downloads/resources/${version}/amazon-corretto-${version}-${os}-${arch}${suffix}`;
// Versioned archives have no checksum sidecar; Amazon publishes their SHA-256s in the release notes.
const source = `https://api.github.com/repos/corretto/corretto-${major}/releases/tags/${version}`;
const findCatalogRelease = async (): Promise<
JavaDownloadRelease | undefined
> => {
const archive = (await this.getAvailableVersions()).find(
item => item.downloadLink === url
);
if (!archive) {
return undefined;
}
return {
version: this.version,
url,
checksum: {
algorithm: 'sha256',
value: archive.checksum_sha256,
source: CORRETTO_VERSIONS_URL
}
};
};
let response;
try {
response = await this.http.getJson<{body: string | null}>(source, {
...getGitHubHttpHeaders(),
accept: 'application/vnd.github+json'
});
} catch (error) {
const catalogRelease = await findCatalogRelease();
if (catalogRelease) {
return catalogRelease;
}
throw error;
}
const row = response.result?.body
?.split(/\r?\n/)
.find(line => line.includes(`](${url})`));
const checksum = row?.match(/`([a-fA-F0-9]{64})`/)?.[1];
if (checksum) {
return {
version: this.version,
url,
checksum: {algorithm: 'sha256', value: checksum, source}
};
}
// The current catalog also covers releases missing from GitHub, such as Corretto 15 and 16.
const catalogRelease = await findCatalogRelease();
if (catalogRelease) {
return catalogRelease;
}
if (response.statusCode === HttpCodes.NotFound) {
throw new Error(
`Corretto release ${version} was not found in Amazon's GitHub releases or current download catalog`
);
}
if (!row) {
throw new Error(
`No ${platform}/${arch} ${this.packageType} archive is listed for Corretto ${version}`
);
}
throw new Error(
`No SHA-256 checksum is published for Corretto ${version} (${platform}, ${arch}, ${this.packageType})`
);
}
private async getAvailableVersions(): Promise<ICorrettoAvailableVersions[]> {
const platform = this.getPlatformOption();
const arch = this.distributionArchitecture();

View File

@@ -16,8 +16,8 @@ import {
extractJdkFile,
getGitHubToken,
getNextPageUrlFromLinkHeader,
isVersionSatisfies,
MAX_PAGINATION_PAGES,
normalizeJavaVersionToSemver,
validatePaginationUrl
} from '../../util.js';
import {OutgoingHttpHeaders} from 'http';
@@ -38,7 +38,9 @@ export class JetBrainsDistribution extends JavaBase {
const versionsRaw = await this.getAvailableVersions();
const versions = versionsRaw.map(v => {
const formattedVersion = `${v.semver}+${v.build}`;
const formattedVersion = normalizeJavaVersionToSemver(
`${v.semver}+${v.build}`
);
return {
version: formattedVersion,
@@ -47,9 +49,9 @@ export class JetBrainsDistribution extends JavaBase {
});
const satisfiedVersions = versions
.filter(item => isVersionSatisfies(range, item.version))
.filter(item => this.isVersionSatisfied(range, item.version))
.sort((a, b) => {
return -semver.compareBuild(a.version, b.version);
return -this.compareVersions(a.version, b.version);
});
const resolvedFullVersion =
@@ -74,6 +76,61 @@ export class JetBrainsDistribution extends JavaBase {
};
}
protected normalizeVersion(version: string) {
const normalized = super.normalizeVersion(version);
if (/^\d+\.\d+\.\d+(?:\.\d+)+(?:-ea)?$/.test(version)) {
// A patch-only request must match any JBR build of that patch.
normalized.version = version.replace(/-ea$/, '');
}
return normalized;
}
protected isVersionSatisfied(range: string, version: string): boolean {
const patchRequest = range.match(/^(\d+\.\d+\.\d+)((?:\.\d+)+)$/);
if (patchRequest) {
const candidate = semver.parse(version);
return (
candidate !== null &&
semver.eq(patchRequest[1], candidate) &&
(candidate.build.slice(0, -2).join('.') || '0') ===
patchRequest[2].slice(1)
);
}
return super.isVersionSatisfied(range, version);
}
protected compareVersions(a: string, b: string): number {
const mainComparison = semver.compare(a, b);
if (mainComparison !== 0) {
return mainComparison;
}
// JBR builds have two components (one in older releases). Any preceding
// metadata components are Java patch fields and take priority over builds.
const first = new semver.SemVer(a).build;
const second = new semver.SemVer(b).build;
const firstPatch = first.slice(0, -2);
const secondPatch = second.slice(0, -2);
for (
let index = 0;
index < Math.max(firstPatch.length, secondPatch.length);
index++
) {
const patchComparison = semver.compareIdentifiers(
firstPatch[index] ?? '0',
secondPatch[index] ?? '0'
);
if (patchComparison !== 0) {
return patchComparison;
}
}
return semver.compareBuild(
first.length ? `0.0.0+${first.slice(-2).join('.')}` : '0.0.0',
second.length ? `0.0.0+${second.slice(-2).join('.')}` : '0.0.0'
);
}
protected async downloadTool(
javaRelease: JavaDownloadRelease
): Promise<JavaInstallerResults> {

View File

@@ -80,7 +80,7 @@ export class LibericaDistributions extends JavaBase {
protected normalizeVersion(version: string) {
const normalized = super.normalizeVersion(version);
if (/^\d+\.\d+\.\d+\.\d+(?:-ea)?$/.test(version)) {
if (/^\d+\.\d+\.\d+(?:\.\d+)+(?:-ea)?$/.test(version)) {
// Keep patch-only requests distinct from exact SDKMAN build requests.
normalized.version = version.replace(/-ea$/, '');
}
@@ -88,14 +88,17 @@ export class LibericaDistributions extends JavaBase {
}
protected isVersionSatisfied(range: string, version: string): boolean {
const patchRequest = range.match(/^(\d+\.\d+\.\d+)\.(\d+)$/);
const patchRequest = range.match(/^(\d+\.\d+\.\d+)((?:\.\d+)+)$/);
if (patchRequest) {
const candidate = semver.parse(version);
if (!candidate || !semver.eq(patchRequest[1], candidate)) {
return false;
}
const patch = candidate.build.length > 1 ? candidate.build[0] : '0';
return patch === patchRequest[2];
const patch =
candidate.build.length > 1
? candidate.build.slice(0, -1).join('.')
: '0';
return patch === patchRequest[2].slice(1);
}
return super.isVersionSatisfied(range, version);
}
@@ -106,15 +109,32 @@ export class LibericaDistributions extends JavaBase {
return mainComparison;
}
// SDKMAN encodes patch.build, but unpatched releases contain only build.
const patchAndBuild = (version: string): string => {
const getPatchAndBuild = (version: string) => {
const build = new semver.SemVer(version).build;
return (build.length > 1 ? build : ['0', ...build]).join('.');
return build.length > 1
? {patch: build.slice(0, -1), build: build[build.length - 1]}
: {patch: [], build: build[0] ?? '0'};
};
return semver.compareBuild(
`0.0.0+${patchAndBuild(a)}`,
`0.0.0+${patchAndBuild(b)}`
);
const first = getPatchAndBuild(a);
const second = getPatchAndBuild(b);
const compareNumericIdentifiers = (left: string, right: string) =>
semver.compareBuild(`0.0.0+${left}`, `0.0.0+${right}`);
for (
let index = 0;
index < Math.max(first.patch.length, second.patch.length);
index++
) {
const patchComparison = compareNumericIdentifiers(
first.patch[index] ?? '0',
second.patch[index] ?? '0'
);
if (patchComparison !== 0) {
return patchComparison;
}
}
return compareNumericIdentifiers(first.build, second.build);
}
private async getAvailableVersions(): Promise<LibericaVersion[]> {
@@ -183,7 +203,7 @@ export class LibericaDistributions extends JavaBase {
}
}
private getPlatformOption(
protected getPlatformOption(
platform: NodeJS.Platform = process.platform
): OsVersions {
switch (platform) {
@@ -209,7 +229,11 @@ export class LibericaDistributions extends JavaBase {
const mainVersion = [featureVersion, interimVersion, updateVersion].join(
'.'
);
const patchVersion = version.version.split('+')[0].split('.')[3];
const patchVersion = version.version
.split('+')[0]
.split('.')
.slice(3)
.join('.');
if (patchVersion) {
return `${mainVersion}+${patchVersion}.${buildVersion}`;
}

View File

@@ -8,10 +8,12 @@ import {
cacheJdkDir,
extractJdkFile,
getDownloadArchiveExtension,
normalizeJavaVersionToSemver,
renameWinArchive
} from '../../util.js';
import * as gpg from '../../gpg.js';
import {MICROSOFT_PUBLIC_KEY} from './microsoft-key.js';
import bundledVersions from './microsoft-openjdk-versions.json' with {type: 'json'};
import {SIGNATURE_VERIFICATION_FAILURE_HELP} from '../../constants.js';
import * as core from '@actions/core';
import * as tc from '@actions/tool-cache';
@@ -108,7 +110,20 @@ export class MicrosoftDistributions extends JavaBase {
throw new Error('Could not load manifest for Microsoft Build of OpenJDK');
}
const foundRelease = await tc.findFromManifest(range, true, manifest, arch);
const findMatchingRelease = async (releases: tc.IToolRelease[]) => {
const matchingReleases = releases
.map(release => ({
...release,
version: normalizeJavaVersionToSemver(release.version)
}))
.filter(release => this.isVersionSatisfied(range, release.version));
return tc.findFromManifest(range, true, matchingReleases, arch);
};
const foundRelease =
(await findMatchingRelease(manifest)) ??
(await findMatchingRelease(bundledVersions));
if (!foundRelease) {
const availableVersionStrings = manifest.map(item => item.version);

View File

@@ -1,4 +1,47 @@
[
{
"version": "25.0.5+0.2",
"stable": true,
"release_url": "https://aka.ms/download-jdk",
"files": [
{
"filename": "microsoft-jdk-25.0.5.0.2-macos-x64.tar.gz",
"arch": "x64",
"platform": "darwin",
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.5.0.2-macos-x64.tar.gz"
},
{
"filename": "microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz",
"arch": "x64",
"platform": "linux",
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.5.0.2-linux-x64.tar.gz"
},
{
"filename": "microsoft-jdk-25.0.5.0.2-windows-x64.zip",
"arch": "x64",
"platform": "win32",
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.5.0.2-windows-x64.zip"
},
{
"filename": "microsoft-jdk-25.0.5.0.2-macos-aarch64.tar.gz",
"arch": "aarch64",
"platform": "darwin",
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.5.0.2-macos-aarch64.tar.gz"
},
{
"filename": "microsoft-jdk-25.0.5.0.2-linux-aarch64.tar.gz",
"arch": "aarch64",
"platform": "linux",
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.5.0.2-linux-aarch64.tar.gz"
},
{
"filename": "microsoft-jdk-25.0.5.0.2-windows-aarch64.zip",
"arch": "aarch64",
"platform": "win32",
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.5.0.2-windows-aarch64.zip"
}
]
},
{
"version": "25.0.3",
"stable": true,

View File

@@ -109,6 +109,7 @@ export class OracleDistribution extends JavaBase {
);
}
const floatingUrl = isOnlyMajorProvided ? possibleUrls[0] : undefined;
let latestUrlNotFound = false;
possibleUrls.push(
`${ORACLE_DL_BASE}/${major}/archive/jdk-${range}_${platform}-${arch}_bin.${extension}`
@@ -123,6 +124,11 @@ export class OracleDistribution extends JavaBase {
if (response.message.statusCode === HttpCodes.OK) {
const floating = url === floatingUrl;
if (latestUrlNotFound) {
core.warning(
`Oracle JDK ${major} is no longer available from the latest endpoint. Falling back to its archived GA release, which may not include security updates.`
);
}
return {
url,
version: range,
@@ -134,6 +140,10 @@ export class OracleDistribution extends JavaBase {
};
}
if (url === floatingUrl) {
latestUrlNotFound = true;
}
if (response.message.statusCode !== HttpCodes.NotFound) {
throw new Error(
`Http request for Oracle JDK failed with status code: ${response.message.statusCode}`

View File

@@ -192,6 +192,9 @@ const CANONICAL_ARCHITECTURES: readonly JavaArchitecture[] = [
's390x'
];
// Used in environment-variable names and tool-cache paths.
const ARCHITECTURE_TOKEN = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
const PLATFORM_ALIASES: Readonly<
Partial<Record<NodeJS.Platform, JavaPlatform>>
> = {
@@ -204,14 +207,27 @@ const PLATFORM_ALIASES: Readonly<
export function normalizeArchitecture(architecture: string): string {
const trimmedArchitecture = architecture.trim();
const normalizedArchitecture = trimmedArchitecture.toLowerCase();
return (
ARCHITECTURE_ALIASES[normalizedArchitecture] ??
const alias = Object.prototype.hasOwnProperty.call(
ARCHITECTURE_ALIASES,
normalizedArchitecture
)
? ARCHITECTURE_ALIASES[normalizedArchitecture]
: undefined;
const result =
alias ??
(CANONICAL_ARCHITECTURES.includes(
normalizedArchitecture as JavaArchitecture
)
? normalizedArchitecture
: trimmedArchitecture)
);
: trimmedArchitecture);
if (!ARCHITECTURE_TOKEN.test(result)) {
throw new Error(
`Unsupported architecture value: ${JSON.stringify(architecture)}`
);
}
return result;
}
export function normalizePlatform(

View File

@@ -3,7 +3,7 @@ import {INPUT_PROBLEM_MATCHER} from './constants.js';
import {getBooleanInput} from './util.js';
export function configureProblemMatcher(matcherPath: string): void {
const problemMatcherEnabled = getBooleanInput(INPUT_PROBLEM_MATCHER, true);
const problemMatcherEnabled = getBooleanInput(INPUT_PROBLEM_MATCHER, false);
if (!problemMatcherEnabled) {
core.debug('Java problem matcher is disabled');

View File

@@ -0,0 +1,882 @@
import * as core from '@actions/core';
import * as httpm from '@actions/http-client';
import fs from 'fs';
import path from 'path';
import type {JavaDownloadRelease} from '../distributions/base-models.js';
import {JavaDistribution} from '../distributions/package-types.js';
import {
isAlpineLinux,
normalizePlatform
} from '../distributions/platform-types.js';
import {isMainModule} from '../is-main-module.js';
import {RetryingHttpClient} from '../retrying-http-client.js';
import {getLatestMajorVersion} from '../util.js';
import {
type ActionSource,
type MetadataResolver,
currentResolver,
getResolverArchitectures,
loadMetadataResolver
} from './resolver.js';
/**
* Reports the exact JDK version each distribution currently resolves for a set
* of version specs, using the installers' own metadata resolution. Nothing is
* downloaded: resolution stops where `setup-java` would start the download.
*/
// Zulu's supported JDK catalog starts at Java 6, including non-LTS releases.
const FIRST_MAJOR_VERSION = 6;
export const REPORTED_DISTRIBUTIONS = currentResolver.distributions;
const PACKAGE_TYPE = 'jdk';
const CONCURRENCY = 6;
const METADATA_TIMEOUT_MS = 60_000;
const ORACLE_RELEASES_URL = 'https://java.oraclecloud.com/currentJavaReleases';
const MUSL_PLATFORM = 'linux-musl';
const PLATFORM_LABELS: Record<string, string> = {
linux: 'Linux',
[MUSL_PLATFORM]: 'Alpine Linux',
macos: 'macOS',
windows: 'Windows',
solaris: 'Solaris'
};
const PLATFORM_ORDER = Object.keys(PLATFORM_LABELS);
const ARCHITECTURE_ORDER = [
'x64',
'aarch64',
'x86',
'armv7',
'ppc64le',
'ppc64',
'riscv64',
's390x'
];
/**
* - `unsupported`: excluded by the action's package/platform capability maps.
* - `unavailable`: the vendor's metadata has no matching release.
* - `error`: the metadata lookup failed.
*/
export type ResolutionStatus =
'resolved' | 'unsupported' | 'unavailable' | 'error';
export interface VersionResolution {
distribution: string;
versionSpec: string;
platform: string;
architecture: string;
status: ResolutionStatus;
version?: string;
/** The release URL serves whatever build the vendor last published. */
floating?: boolean;
/** `Last-Modified` date of a floating artifact, from a HEAD request. */
publishedAt?: string;
/** Version the vendor currently advertises for a floating artifact. */
advertisedVersion?: string;
message?: string;
}
export interface ResolutionReport {
source: ActionSource;
platform: string;
generatedAt: string;
/** Expected platform/architecture probes, from this revision rather than main. */
targets?: Record<string, Record<string, string[]>>;
results: VersionResolution[];
}
interface ReleaseResolver {
version: string;
http: httpm.HttpClient;
findPackageForDownload(range: string): Promise<JavaDownloadRelease>;
}
/** Alpine is reported separately because installers pick musl builds there. */
export function getReportPlatform(
platform: NodeJS.Platform = process.platform,
alpine = isAlpineLinux(platform)
): string {
if (alpine) {
return MUSL_PLATFORM;
}
return normalizePlatform(platform) ?? platform;
}
/**
* Architectures `setup-java` supports for a distribution on a report
* platform, including ones restricted to some Java versions.
*/
export function getSupportedArchitectures(
distribution: string,
platform: string,
resolver: MetadataResolver = currentResolver
): string[] {
return getResolverArchitectures(resolver, distribution, platform);
}
export function classifyResolutionError(error: unknown): ResolutionStatus {
const message = error instanceof Error ? error.message : String(error);
if (
/not supported|only supported|does not support|unsupported|not valid SemVer/i.test(
message
)
) {
return 'unsupported';
}
if (
(error instanceof Error && error.name === 'VersionNotFoundError') ||
/no matching version|no \w+ release for|could not determine the latest available|not supported|only supported|does not support|not available|could not find|unsupported/i.test(
message
)
) {
return 'unavailable';
}
return 'error';
}
/**
* Shares metadata responses between installer instances. Most installers
* fetch a vendor's whole release list for every request, and JetBrains probes
* each release URL with HEAD, so resolving many version/architecture
* combinations would otherwise repeat identical requests and exhaust API rate
* limits. Failed requests are also retained for this snapshot so an obsolete
* endpoint does not stall every major-version probe. Installers only read the
* status and headers of HEAD responses.
*/
function shareMetadataResponses(
http: httpm.HttpClient,
cache: Map<string, Promise<unknown>>
): void {
const share = <T>(key: string, request: () => Promise<T>): Promise<T> => {
let response = cache.get(key) as Promise<T> | undefined;
if (!response) {
response = new Promise<T>((resolve, reject) => {
const timer = setTimeout(() => {
http.dispose();
reject(
new Error(
`Metadata request timed out after ${METADATA_TIMEOUT_MS} ms: ${key.split('\n')[0]}`
)
);
}, METADATA_TIMEOUT_MS);
Promise.resolve()
.then(request)
.then(
value => {
clearTimeout(timer);
resolve(value);
},
error => {
clearTimeout(timer);
reject(error);
}
);
});
cache.set(key, response);
}
return response;
};
const getJson = http.getJson.bind(http);
http.getJson = (async (requestUrl: string, additionalHeaders?: object) =>
structuredClone(
await share(
`GET ${requestUrl}\n${JSON.stringify(additionalHeaders ?? {})}`,
() => getJson(requestUrl, additionalHeaders as never)
)
)) as typeof http.getJson;
const head = http.head.bind(http);
http.head = (requestUrl, additionalHeaders) =>
share(
`HEAD ${requestUrl}\n${JSON.stringify(additionalHeaders ?? {})}`,
() => head(requestUrl, additionalHeaders)
);
}
async function describeFloatingRelease(
http: httpm.HttpClient,
distribution: string,
release: JavaDownloadRelease
): Promise<Pick<VersionResolution, 'publishedAt' | 'advertisedVersion'>> {
const details: Pick<VersionResolution, 'publishedAt' | 'advertisedVersion'> =
{};
try {
const response = await http.head(release.url);
const lastModified = response.message.headers['last-modified'];
if (lastModified && !Number.isNaN(Date.parse(lastModified))) {
details.publishedAt = new Date(lastModified).toISOString().slice(0, 10);
}
} catch (error) {
core.debug(`HEAD ${release.url} failed: ${error}`);
}
// Oracle's `/latest/` artifacts carry the NFTC license; only then is the
// release advertised by the Java Releases API the one being served.
if (distribution === JavaDistribution.Oracle) {
try {
const response = await http.getJson<{
releaseVersion?: string;
licenseDetails?: {licenseType?: string};
}>(`${ORACLE_RELEASES_URL}/${release.version.split('.')[0]}`);
if (
response.result?.releaseVersion &&
response.result.licenseDetails?.licenseType === 'NFTC'
) {
details.advertisedVersion = response.result.releaseVersion;
}
} catch (error) {
core.debug(`Oracle Java Releases API lookup failed: ${error}`);
}
}
return details;
}
async function resolveOne(
distributionName: string,
versionSpec: string,
platform: string,
architecture: string,
cache: Map<string, Promise<unknown>>,
http: httpm.HttpClient,
metadataResolver: MetadataResolver
): Promise<VersionResolution> {
const base = {
distribution: distributionName,
versionSpec,
platform,
architecture
};
let installer: unknown;
try {
const installerOptions = {
version: versionSpec,
architecture,
packageType: PACKAGE_TYPE,
checkLatest: true
};
if (platform === 'solaris') {
if (distributionName !== JavaDistribution.Liberica) {
return {
...base,
status: 'error',
message: `No Solaris metadata resolver for '${distributionName}'.`
};
}
installer =
await metadataResolver.createSolarisInstaller(installerOptions);
} else {
installer = await metadataResolver.getJavaDistribution(
distributionName,
installerOptions
);
}
} catch (error) {
return {
...base,
status: classifyResolutionError(error),
message: error instanceof Error ? error.message : String(error)
};
}
if (!installer) {
return {...base, status: 'error', message: 'Unknown distribution'};
}
// `findPackageForDownload` is the metadata step `setupJava` runs right
// before downloading; it is protected because the action never needs it on
// its own.
if (!isReleaseResolver(installer)) {
throw new Error(`Invalid metadata resolver for '${distributionName}'.`);
}
const resolver = installer;
// Fail closed if a resolver ever crosses the metadata/download boundary.
const forbidInstall = () => {
throw new Error(
'JDK download/install is forbidden in the versions report.'
);
};
Object.defineProperties(installer, {
setupJava: {value: forbidInstall},
downloadTool: {value: forbidInstall}
});
shareMetadataResponses(resolver.http, cache);
try {
const release = await resolver.findPackageForDownload(resolver.version);
// Older releases returned the requested major without a floating marker.
const floating =
release.floating || new URL(release.url).pathname.includes('/latest/');
return {
...base,
status: 'resolved',
version: release.version,
...(floating
? {
floating: true,
...(await describeFloatingRelease(http, distributionName, release))
}
: {})
};
} catch (error) {
return {
...base,
status: classifyResolutionError(error),
message: error instanceof Error ? error.message : String(error)
};
}
}
function isReleaseResolver(value: unknown): value is ReleaseResolver {
return (
typeof value === 'object' &&
value !== null &&
'version' in value &&
typeof value.version === 'string' &&
'http' in value &&
typeof value.http === 'object' &&
value.http !== null &&
'getJson' in value.http &&
typeof value.http.getJson === 'function' &&
'head' in value.http &&
typeof value.http.head === 'function' &&
'findPackageForDownload' in value &&
typeof value.findPackageForDownload === 'function'
);
}
async function runWithConcurrency<T>(
tasks: (() => Promise<T>)[],
limit: number
): Promise<T[]> {
const results: T[] = new Array(tasks.length);
let next = 0;
const worker = async () => {
while (next < tasks.length) {
const index = next++;
results[index] = await tasks[index]();
}
};
await Promise.all(
Array.from({length: Math.min(limit, tasks.length)}, worker)
);
return results;
}
/** Every supported stable major through the newest GA release, plus `latest`. */
export async function getDefaultVersions(
http: httpm.HttpClient
): Promise<string[]> {
shareMetadataResponses(http, new Map());
const latestMajor = await getLatestMajorVersion(http);
if (!Number.isSafeInteger(latestMajor) || latestMajor < FIRST_MAJOR_VERSION) {
throw new Error(
`Invalid newest Java feature release in vendor metadata: ${latestMajor}`
);
}
const versions = Array.from(
{length: latestMajor - FIRST_MAJOR_VERSION + 1},
(_, index) => String(FIRST_MAJOR_VERSION + index)
);
return [...versions, 'latest'];
}
/**
* Distributions for which vendor metadata matched nothing at all. Missing
* every requested version on every platform signals an unreachable or changed
* metadata source rather than genuinely unavailable releases.
*/
export function findSilentDistributions(
results: VersionResolution[]
): string[] {
const distributions = [...new Set(results.map(r => r.distribution))];
return distributions.filter(distribution => {
const distributionResults = results.filter(
r => r.distribution === distribution
);
return (
!distributionResults.some(r => r.status === 'resolved') &&
distributionResults.some(r => r.status === 'unavailable')
);
});
}
export async function resolveLatestVersions(options: {
distributions: string[];
versions: string[];
/** Restricts the architectures; defaults to all supported ones. */
architectures?: string[];
/** Solaris metadata can be resolved on any host; other targets use the host. */
platform?: string;
resolver?: MetadataResolver;
}): Promise<ResolutionReport> {
const resolver = options.resolver ?? currentResolver;
const http = new RetryingHttpClient('actions/setup-java');
shareMetadataResponses(http, new Map());
const hostPlatform = getReportPlatform();
const platform = options.platform || hostPlatform;
if (platform !== hostPlatform && platform !== 'solaris') {
throw new Error(
`Cannot resolve '${platform}' metadata on '${hostPlatform}'; use a matching runner.`
);
}
const tasks = options.distributions.map(distribution => async () => {
const architectures = getSupportedArchitectures(
distribution,
platform,
resolver
).filter(
architecture =>
!options.architectures?.length ||
options.architectures.includes(architecture)
);
// Each distribution resolves sequentially so its shared metadata is
// fetched once and requests to a single vendor API are not bursty.
const cache = new Map<string, Promise<unknown>>();
const results: VersionResolution[] = [];
const startedAt = Date.now();
for (const versionSpec of options.versions) {
for (const architecture of architectures) {
const result = await resolveOne(
distribution,
versionSpec,
platform,
architecture,
cache,
http,
resolver
);
core.info(
`${distribution} ${versionSpec} (${formatPlatform(result)}): ${
result.status === 'resolved'
? `${result.version}${result.floating ? ' (floating)' : ''}`
: `${result.status} - ${result.message?.split('\n')[0]}`
}`
);
results.push(result);
}
}
core.info(
`${distribution}: ${results.length} lookups in ${Math.round((Date.now() - startedAt) / 1000)}s`
);
return results;
});
const results = (await runWithConcurrency(tasks, CONCURRENCY)).flat();
return {
source: resolver.source,
platform,
generatedAt: new Date().toISOString(),
targets: Object.fromEntries(
options.distributions.map(distribution => [
distribution,
Object.fromEntries(
PLATFORM_ORDER.map(target => [
target,
getSupportedArchitectures(distribution, target, resolver)
]).filter(([, architectures]) => architectures.length > 0)
)
])
),
results
};
}
function formatPlatform(
result: Pick<VersionResolution, 'platform' | 'architecture'>
): string {
return `${PLATFORM_LABELS[result.platform] ?? result.platform} ${result.architecture}`;
}
function comparePlatforms(
a: Pick<VersionResolution, 'platform' | 'architecture'>,
b: Pick<VersionResolution, 'platform' | 'architecture'>
): number {
const rank = (order: string[], value: string) => {
const index = order.indexOf(value);
return index === -1 ? order.length : index;
};
return (
rank(PLATFORM_ORDER, a.platform) - rank(PLATFORM_ORDER, b.platform) ||
a.platform.localeCompare(b.platform) ||
rank(ARCHITECTURE_ORDER, a.architecture) -
rank(ARCHITECTURE_ORDER, b.architecture) ||
a.architecture.localeCompare(b.architecture)
);
}
function formatCell(result: VersionResolution | undefined): string {
switch (result?.status) {
case undefined:
return '';
case 'resolved':
if (!result.floating) {
return `\`${result.version}\``;
}
return (
`\`${result.advertisedVersion ?? result.version}\` ¹` +
(result.publishedAt ? ` (published ${result.publishedAt})` : '')
);
case 'unavailable':
return '—';
case 'unsupported':
return 'n/a';
case 'error':
return '❗ error';
}
}
interface Problem {
distribution: string;
versionSpec?: string;
platform?: string;
message: string;
}
function getProblems(results: VersionResolution[]): Problem[] {
return [
...findSilentDistributions(results).map(distribution => ({
distribution,
message:
'No release matched any requested version on any platform. The vendor metadata may be unreachable or its format may have changed.'
})),
...results
.filter(r => r.status === 'error')
.map(r => ({
distribution: r.distribution,
versionSpec: r.versionSpec,
platform: formatPlatform(r),
message: r.message?.split('\n')[0] ?? 'Unknown error'
}))
];
}
/** Supported operating systems for which no runner produced a report. */
function getUncheckedPlatforms(
distribution: string,
reportedPlatforms: Set<string>,
targets?: Record<string, Record<string, string[]>>
): string[] {
const platforms =
targets?.[distribution] ??
Object.fromEntries(
PLATFORM_ORDER.map(platform => [
platform,
getSupportedArchitectures(distribution, platform)
])
);
return Object.entries(platforms)
.filter(
([platform, architectures]) =>
architectures.length > 0 && !reportedPlatforms.has(platform)
)
.map(
([platform, architectures]) =>
`${PLATFORM_LABELS[platform] ?? platform} (${architectures.join(', ')})`
);
}
function escapeTableText(text: string): string {
return text.replace(/\|/g, '\\|').replace(/\r?\n/g, ' ');
}
function renderSourceReport(
reports: ResolutionReport[],
options: {runUrl?: string} = {}
): string {
const results = reports.flatMap(report => report.results);
const distributions = [...new Set(results.map(r => r.distribution))].sort();
const versionSpecs = [...new Set(results.map(r => r.versionSpec))];
const reportedPlatforms = new Set(reports.map(report => report.platform));
const generatedAt = reports
.map(report => report.generatedAt)
.sort()
.at(-1);
const silentDistributions = findSilentDistributions(results);
const lines: string[] = [`## setup-java@${reports[0].source.ref}`, ''];
lines.push(
`Generated ${generatedAt ? `${generatedAt.replace('T', ' ').slice(0, 16)} UTC` : 'now'} for package type \`${PACKAGE_TYPE}\` on ${PLATFORM_ORDER.filter(
p => reportedPlatforms.has(p)
)
.map(p => PLATFORM_LABELS[p])
.join(', ')}.` +
(options.runUrl ? ` [Workflow run](${options.runUrl}).` : ''),
'',
'For each distribution, the table lists platform/architecture probes and the exact version this revision resolves from the distribution’s metadata today for each `java-version`. That is what a job installs on a tool-cache miss or with `check-latest: true`. Vendors publish builds per platform, so the same request can resolve to different versions on different platforms. No JDK was downloaded to produce this report.',
'',
'`—` no matching release is published for this platform · `n/a` `setup-java` does not support this version on this platform · ❗ the lookup failed',
''
);
const problems = getProblems(results);
if (problems.length > 0) {
lines.push(
'## Needs attention',
'',
'| Distribution | Version | Platform | Problem |',
'| --- | --- | --- | --- |'
);
for (const problem of problems) {
lines.push(
`| \`${problem.distribution}\` | ${problem.versionSpec ? `\`${problem.versionSpec}\`` : 'all'} | ${problem.platform ?? 'all'} | ${escapeTableText(problem.message)} |`
);
}
lines.push('');
}
for (const distribution of distributions) {
const distributionResults = results.filter(
r => r.distribution === distribution
);
const platforms = distributionResults
.filter(
(result, index) =>
distributionResults.findIndex(
other =>
other.platform === result.platform &&
other.architecture === result.architecture
) === index
)
.sort(comparePlatforms);
lines.push(
`## \`${distribution}\`${silentDistributions.includes(distribution) ? ' ❗' : ''}`,
'',
`| Platform | ${versionSpecs.map(v => `\`${v}\``).join(' | ')} |`,
`| --- | ${versionSpecs.map(() => '---').join(' | ')} |`
);
for (const platform of platforms) {
const cells = versionSpecs.map(versionSpec =>
formatCell(
distributionResults.find(
r =>
r.versionSpec === versionSpec &&
r.platform === platform.platform &&
r.architecture === platform.architecture
)
)
);
lines.push(`| ${formatPlatform(platform)} | ${cells.join(' | ')} |`);
}
lines.push('');
const unchecked = getUncheckedPlatforms(
distribution,
reportedPlatforms,
reports[0]?.targets
);
if (unchecked.length > 0) {
lines.push(
`Not checked, because no runner reported these platforms: ${unchecked.join(', ')}.`,
''
);
}
}
if (results.some(r => r.status === 'resolved' && r.floating)) {
lines.push(
'---',
'',
'¹ Major-only requests download the vendor’s mutable `/latest/` artifact, so the exact version is only known after download. The version the vendor advertises is shown when available.',
''
);
}
return lines.join('\n');
}
export function renderMarkdownReport(
reports: ResolutionReport[],
options: {
runUrl?: string;
expectedRefs?: string[];
overviewOnly?: boolean;
} = {}
): string {
const refs = [
...new Set([
...(options.expectedRefs ?? []),
...reports.map(report => report.source.ref)
])
];
const lines = [
'# Latest JDK versions by setup-java revision',
'',
"Each section uses that revision's own installers and dependencies. `v6` and `v5` track the latest major tags, pinned to the commits below for this run. No JDKs are downloaded.",
'',
"Older revisions may support different distributions, platforms or version syntax. In particular, `latest` is reported as `n/a` when that revision rejects it; it is not substituted with main's behavior. Revisions without capability maps probe all candidate architectures, leaving unsupported or unpublished combinations visible.",
'',
'| setup-java | Package version | Commit | Result |',
'| --- | --- | --- | --- |'
];
for (const ref of refs) {
const group = reports.filter(report => report.source.ref === ref);
if (!group.length) {
lines.push(`| \`${ref}\` | - | - | Not checked: no reports received |`);
continue;
}
const source = group[0].source;
if (
group.some(
report =>
report.source.sha !== source.sha ||
report.source.version !== source.version
)
) {
throw new Error(
`Reports for '${ref}' were produced from different revisions.`
);
}
const problems = getProblems(group.flatMap(report => report.results));
const platforms = new Set(group.map(report => report.platform));
const missing = PLATFORM_ORDER.filter(platform => !platforms.has(platform));
lines.push(
`| \`${ref}\` | ${source.version ?? 'local'} | ${source.sha ? `[\`${source.sha.slice(0, 12)}\`](https://github.com/actions/setup-java/commit/${source.sha})` : 'local checkout'} | ${platforms.size}/${PLATFORM_ORDER.length} platforms${missing.length ? `; not checked: ${missing.map(platform => PLATFORM_LABELS[platform]).join(', ')}` : ''}${problems.length ? `; ${problems.length} lookup problems` : ''} |`
);
}
if (options.overviewOnly) {
return lines.join('\n');
}
for (const ref of refs) {
const group = reports.filter(report => report.source.ref === ref);
if (!group.length) {
continue;
}
lines.push(
'',
'<details>',
`<summary>setup-java@${ref}</summary>`,
'',
renderSourceReport(group, options),
'</details>',
''
);
}
return lines.join('\n');
}
function parseList(value: string | undefined, fallback: string[]): string[] {
const items = (value ?? '')
.split(/[,\s]+/)
.map(item => item.trim())
.filter(Boolean);
return items.length > 0 ? items : fallback;
}
function readReports(inputDir: string): ResolutionReport[] {
return fs
.readdirSync(inputDir, {recursive: true, encoding: 'utf8'})
.filter(file => file.endsWith('.json'))
.sort()
.map(
file =>
JSON.parse(
fs.readFileSync(path.join(inputDir, file), 'utf8')
) as ResolutionReport
);
}
export async function run(args: string[]): Promise<void> {
const [command, target, markdownOutput] = args;
if (command === 'resolve' && target) {
const resolver = process.env.REPORT_RESOLVER
? await loadMetadataResolver(process.env.REPORT_RESOLVER)
: currentResolver;
const versions = parseList(process.env.REPORT_VERSIONS, []);
const report = await resolveLatestVersions({
distributions: parseList(
process.env.REPORT_DISTRIBUTIONS,
resolver.distributions
),
versions:
versions.length > 0
? versions
: await getDefaultVersions(
new RetryingHttpClient('actions/setup-java')
),
architectures: parseList(process.env.REPORT_ARCHITECTURES, []),
platform: process.env.REPORT_PLATFORM,
resolver
});
fs.mkdirSync(path.dirname(path.resolve(target)), {recursive: true});
fs.writeFileSync(target, JSON.stringify(report, null, 2));
return;
}
if (command === 'summarize' && target) {
const expectedRefs = parseList(process.env.REPORT_REFS, []);
const reports = fs.existsSync(target) ? readReports(target) : [];
if (reports.length === 0 && expectedRefs.length === 0) {
throw new Error(`No resolution reports found in '${target}'.`);
}
const {GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_RUN_ID} = process.env;
const runUrl =
GITHUB_SERVER_URL && GITHUB_REPOSITORY && GITHUB_RUN_ID
? `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}`
: undefined;
const markdown = renderMarkdownReport(reports, {
runUrl,
expectedRefs
});
if (markdownOutput) {
fs.writeFileSync(markdownOutput, markdown);
}
if (process.env.GITHUB_STEP_SUMMARY) {
// GitHub limits a step summary to 1 MiB. Keep the complete report in the
// artifact even when many legacy lookup errors make it too large.
if (Buffer.byteLength(markdown, 'utf8') > 1_000_000) {
core.warning(
'The full report exceeds the job summary size limit; showing its overview.'
);
const overview = renderMarkdownReport(reports, {
runUrl,
expectedRefs,
overviewOnly: true
});
await core.summary
.addRaw(
`${overview}\n\nFull per-platform tables are in the \`latest-jdk-versions-report\` artifact${runUrl ? ` on the [workflow run](${runUrl})` : ''}. The full report exceeded GitHub's summary size limit.\n`
)
.write();
} else {
await core.summary.addRaw(markdown).write();
}
} else {
core.info(markdown);
}
for (const ref of expectedRefs) {
if (!reports.some(report => report.source.ref === ref)) {
core.warning(
`${ref}: not checked because no resolution reports were received.`
);
}
}
for (const ref of new Set(reports.map(report => report.source.ref))) {
for (const problem of getProblems(
reports
.filter(report => report.source.ref === ref)
.flatMap(report => report.results)
)) {
const scope = [problem.versionSpec, problem.platform]
.filter(Boolean)
.join(', ');
core.warning(
`${ref}: ${problem.distribution}${scope ? ` (${scope})` : ''}: ${problem.message}`
);
}
}
return;
}
throw new Error(
'Usage: resolve <output.json> | summarize <input-dir> [output.md]'
);
}
if (isMainModule(import.meta.url)) {
run(process.argv.slice(2)).catch(error => {
core.setFailed(error instanceof Error ? error.message : String(error));
});
}

125
src/reports/resolver.ts Normal file
View File

@@ -0,0 +1,125 @@
import {pathToFileURL} from 'url';
import path from 'path';
import {getJavaDistribution} from '../distributions/distribution-factory.js';
import type {JavaInstallerOptions} from '../distributions/base-models.js';
import {LibericaDistributions} from '../distributions/liberica/installer.js';
import {JavaDistribution} from '../distributions/package-types.js';
import {
JAVA_PLATFORM_CAPABILITIES,
type JavaPlatformCapability
} from '../distributions/platform-types.js';
export interface ActionSource {
ref: string;
sha?: string;
version?: string;
}
export interface MetadataResolver {
source: ActionSource;
distributions: string[];
capabilities?: Record<string, JavaPlatformCapability>;
getJavaDistribution(
distribution: string,
options: JavaInstallerOptions
): unknown;
createSolarisInstaller(options: JavaInstallerOptions): unknown;
}
class SolarisLibericaDistribution extends LibericaDistributions {
protected override getPlatformOption() {
return super.getPlatformOption('sunos');
}
}
export const currentResolver: MetadataResolver = {
source: {ref: 'main'},
distributions: Object.values(JavaDistribution).filter(
distribution => distribution !== JavaDistribution.JdkFile
),
capabilities: JAVA_PLATFORM_CAPABILITIES,
getJavaDistribution,
createSolarisInstaller: options => new SolarisLibericaDistribution(options)
};
const LEGACY_ARCHITECTURES = [
'x64',
'aarch64',
'x86',
'armv7',
'ppc64le',
'ppc64',
'riscv64',
's390x'
];
export function getResolverArchitectures(
resolver: MetadataResolver,
distribution: string,
platform: string
): string[] {
if (!resolver.distributions.includes(distribution)) {
return [];
}
// v5 has no centralized capability map. Probe candidates with its own
// installer instead of imposing main's newer support restrictions on it.
if (!resolver.capabilities) {
if (platform === 'solaris' && distribution !== 'liberica') {
return [];
}
return [...LEGACY_ARCHITECTURES];
}
const capability = resolver.capabilities[distribution];
if (!capability || capability.unrestricted) {
return [];
}
const os = platform === 'linux-musl' ? 'linux' : platform;
const architectures = Object.entries(capability.platforms).find(
([name]) => name === os
)?.[1];
return [
...new Set(
(architectures ?? []).map(item =>
typeof item === 'string' ? item : item.architecture
)
)
];
}
/** Load the separately bundled checkout, including that revision's dependencies. */
export async function loadMetadataResolver(
directory: string
): Promise<MetadataResolver> {
const module: unknown = await import(
/* webpackIgnore: true */ pathToFileURL(
path.join(path.resolve(directory), 'index.js')
).href
);
// NCC emits ESM for v6/main and CommonJS for v5.
const candidate =
isRecord(module) && isRecord(module.default) ? module.default : module;
if (!isMetadataResolver(candidate)) {
throw new Error(`Invalid metadata resolver bundle in '${directory}'.`);
}
return candidate;
}
function isMetadataResolver(value: unknown): value is MetadataResolver {
return (
isRecord(value) &&
isRecord(value.source) &&
typeof value.source.ref === 'string' &&
typeof value.source.sha === 'string' &&
/^[a-f0-9]{40}$/.test(value.source.sha) &&
typeof value.source.version === 'string' &&
Array.isArray(value.distributions) &&
value.distributions.every(item => typeof item === 'string') &&
(value.capabilities === undefined || isRecord(value.capabilities)) &&
typeof value.getJavaDistribution === 'function' &&
typeof value.createSolarisInstaller === 'function'
);
}
function isRecord(value: unknown): value is Record<string, unknown> {
return typeof value === 'object' && value !== null;
}

View File

@@ -397,6 +397,18 @@ export function getVersionFromFileContent(
const tentativeVersion = avoidOldNotation(capturedVersion);
const rawVersion = tentativeVersion.split('-')[0];
// Preserve Corretto's full vendor release before generic coercion drops its extra numeric fields.
if (
(extractedDistribution || distributionName) === 'corretto' &&
capturedVersion === tentativeVersion &&
isExactCorrettoVersion(tentativeVersion)
) {
return {
version: tentativeVersion,
distribution: extractedDistribution
};
}
let version = semver.validRange(rawVersion)
? tentativeVersion
: semver.coerce(tentativeVersion);
@@ -500,6 +512,13 @@ function avoidOldNotation(content: string): string {
return content.startsWith('1.') ? content.substring(2) : content;
}
export function isExactCorrettoVersion(version: string): boolean {
// Java 8 releases have a nonzero update field; later releases use five numeric fields.
return /^(?:8\.(?!0+(?:\.|$))\d+(?:\.\d+){2}|(?!8\.)\d+(?:\.\d+){4})$/.test(
version.replace('+', '.')
);
}
export function convertVersionToSemver(version: number[] | string) {
// Some distributions may use semver-like notation (12.10.2.1, 12.10.2.1.1)
const versionArray = Array.isArray(version) ? version : version.split('.');