mirror of
https://gitea.com/actions/setup-java.git
synced 2025-11-07 02:36:26 +08:00
Compare commits
1 Commits
main
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31c8ec4acf |
9
.github/workflows/e2e-versions.yml
vendored
9
.github/workflows/e2e-versions.yml
vendored
@@ -41,15 +41,6 @@ jobs:
|
|||||||
- distribution: dragonwell
|
- distribution: dragonwell
|
||||||
os: macos-13
|
os: macos-13
|
||||||
include:
|
include:
|
||||||
- distribution: microsoft
|
|
||||||
os: windows-latest
|
|
||||||
version: 25
|
|
||||||
- distribution: microsoft
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: 25
|
|
||||||
- distribution: microsoft
|
|
||||||
os: macos-latest
|
|
||||||
version: 25
|
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: macos-13
|
os: macos-13
|
||||||
version: 17
|
version: 17
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Update the ${{ env.TAG_NAME }} tag
|
- name: Update the ${{ env.TAG_NAME }} tag
|
||||||
id: update-major-tag
|
id: update-major-tag
|
||||||
uses: actions/publish-action@v0.3.0
|
uses: actions/publish-action@v0.4.0
|
||||||
with:
|
with:
|
||||||
source-tag: ${{ env.TAG_NAME }}
|
source-tag: ${{ env.TAG_NAME }}
|
||||||
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
|||||||
@@ -18,13 +18,6 @@ The `setup-java` action provides the following functionality for GitHub Actions
|
|||||||
|
|
||||||
This action allows you to work with Java and Scala projects.
|
This action allows you to work with Java and Scala projects.
|
||||||
|
|
||||||
## Breaking changes in V5
|
|
||||||
|
|
||||||
- Upgraded action from node20 to node24
|
|
||||||
> Make sure your runner is on version v2.327.1 or later to ensure compatibility with this release [Release Notes](https://github.com/actions/runner/releases/tag/v2.327.1)
|
|
||||||
|
|
||||||
For more details, see the full release notes on the [releases page](https://github.com/actions/setup-java/releases/tag/v5.0.0)
|
|
||||||
|
|
||||||
## V2 vs V1
|
## V2 vs V1
|
||||||
|
|
||||||
- V2 supports custom distributions and provides support for Azul Zulu OpenJDK, Eclipse Temurin and AdoptOpenJDK out of the box. V1 supports only Azul Zulu OpenJDK.
|
- V2 supports custom distributions and provides support for Azul Zulu OpenJDK, Eclipse Temurin and AdoptOpenJDK out of the box. V1 supports only Azul Zulu OpenJDK.
|
||||||
@@ -244,7 +237,7 @@ jobs:
|
|||||||
|
|
||||||
### Install multiple JDKs
|
### Install multiple JDKs
|
||||||
|
|
||||||
All configured Java versions are added to the PATH. The last one added to the PATH (i.e., the last JDK set up by this action) will be used as the default and available globally. Other Java versions can be accessed through environment variables such as 'JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }}'. To use a specific Java version, set the JAVA_HOME environment variable accordingly and prepend its bin directory to the PATH to ensure it takes priority during execution.
|
All versions are added to the PATH. The last version will be used and available globally. Other Java versions can be accessed through env variables with such specification as 'JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }}'.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -1,47 +1,4 @@
|
|||||||
[
|
[
|
||||||
{
|
|
||||||
"version": "25.0.0",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-25.0.0-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-25.0.0-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-25.0.0-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-25.0.0-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-25.0.0-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-linux-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-25.0.0-windows-aarch64.zip",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-windows-aarch64.zip"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"version": "21.0.0",
|
"version": "21.0.0",
|
||||||
"stable": true,
|
"stable": true,
|
||||||
|
|||||||
@@ -150,8 +150,9 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
mockPlatform(distribution, platform);
|
mockPlatform(distribution, platform);
|
||||||
|
|
||||||
const availableVersion =
|
const availableVersion = await distribution['findPackageForDownload'](
|
||||||
await distribution['findPackageForDownload'](version);
|
version
|
||||||
|
);
|
||||||
expect(availableVersion).not.toBeNull();
|
expect(availableVersion).not.toBeNull();
|
||||||
expect(availableVersion.url).toBe(expectedLink);
|
expect(availableVersion.url).toBe(expectedLink);
|
||||||
});
|
});
|
||||||
@@ -221,8 +222,9 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
const expectedLink = `https://corretto.aws/downloads/resources/17.0.2.8.1/amazon-corretto-17.0.2.8.1-macosx-${distroArch}.tar.gz`;
|
const expectedLink = `https://corretto.aws/downloads/resources/17.0.2.8.1/amazon-corretto-17.0.2.8.1-macosx-${distroArch}.tar.gz`;
|
||||||
|
|
||||||
const availableVersion =
|
const availableVersion = await distribution['findPackageForDownload'](
|
||||||
await distribution['findPackageForDownload']('17');
|
'17'
|
||||||
|
);
|
||||||
expect(availableVersion).not.toBeNull();
|
expect(availableVersion).not.toBeNull();
|
||||||
expect(availableVersion.url).toBe(expectedLink);
|
expect(availableVersion.url).toBe(expectedLink);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,8 +206,9 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
mockPlatform(distribution, platform);
|
mockPlatform(distribution, platform);
|
||||||
|
|
||||||
const availableVersion =
|
const availableVersion = await distribution['findPackageForDownload'](
|
||||||
await distribution['findPackageForDownload'](jdkVersion);
|
jdkVersion
|
||||||
|
);
|
||||||
expect(availableVersion).not.toBeNull();
|
expect(availableVersion).not.toBeNull();
|
||||||
expect(availableVersion.url).toBe(expectedLink);
|
expect(availableVersion.url).toBe(expectedLink);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,8 +76,9 @@ describe('findPackageForDownload', () => {
|
|||||||
checkLatest: false
|
checkLatest: false
|
||||||
});
|
});
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
distribution['getAvailableVersions'] = async () => manifestData as any;
|
||||||
const resolvedVersion =
|
const resolvedVersion = await distribution['findPackageForDownload'](
|
||||||
await distribution['findPackageForDownload'](input);
|
input
|
||||||
|
);
|
||||||
const url = resolvedVersion.url;
|
const url = resolvedVersion.url;
|
||||||
const options = {method: 'HEAD'};
|
const options = {method: 'HEAD'};
|
||||||
|
|
||||||
|
|||||||
@@ -29,11 +29,6 @@ describe('findPackageForDownload', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
|
||||||
'25.x',
|
|
||||||
'25.0.0',
|
|
||||||
'https://aka.ms/download-jdk/microsoft-jdk-25.0.0-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
'21.x',
|
'21.x',
|
||||||
'21.0.0',
|
'21.0.0',
|
||||||
|
|||||||
@@ -61,8 +61,9 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
mockPlatform(distribution, 'linux');
|
mockPlatform(distribution, 'linux');
|
||||||
|
|
||||||
const availableVersion =
|
const availableVersion = await distribution['findPackageForDownload'](
|
||||||
await distribution['findPackageForDownload'](version);
|
version
|
||||||
|
);
|
||||||
expect(availableVersion).not.toBeNull();
|
expect(availableVersion).not.toBeNull();
|
||||||
expect(availableVersion.url).toBe(
|
expect(availableVersion.url).toBe(
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-x64_bin.tar.gz'
|
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-x64_bin.tar.gz'
|
||||||
@@ -229,8 +230,9 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
mockPlatform(distribution, platform);
|
mockPlatform(distribution, platform);
|
||||||
|
|
||||||
const availableVersion =
|
const availableVersion = await distribution['findPackageForDownload'](
|
||||||
await distribution['findPackageForDownload'](normalizedVersion);
|
normalizedVersion
|
||||||
|
);
|
||||||
expect(availableVersion).not.toBeNull();
|
expect(availableVersion).not.toBeNull();
|
||||||
expect(availableVersion.url).toBe(expectedLink);
|
expect(availableVersion.url).toBe(expectedLink);
|
||||||
}
|
}
|
||||||
|
|||||||
2
dist/cleanup/index.js
vendored
2
dist/cleanup/index.js
vendored
@@ -94704,7 +94704,7 @@ function getVersionFromFileContent(content, distributionName, versionFile) {
|
|||||||
const versionFileName = getFileName(versionFile);
|
const versionFileName = getFileName(versionFile);
|
||||||
if (versionFileName == '.tool-versions') {
|
if (versionFileName == '.tool-versions') {
|
||||||
javaVersionRegExp =
|
javaVersionRegExp =
|
||||||
/^java\s+(?:\S*-)?(?<version>\d+(?:\.\d+)*([+_.-](?:openj9[-._]?\d[\w.-]*|java\d+|jre[-_\w]*|OpenJDK\d+[\w_.-]*|[a-z0-9]+))*)/im;
|
/^(java\s+)(?:\S*-)?v?(?<version>(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||||
|
|||||||
2
dist/setup/index.js
vendored
2
dist/setup/index.js
vendored
@@ -132739,7 +132739,7 @@ function getVersionFromFileContent(content, distributionName, versionFile) {
|
|||||||
const versionFileName = getFileName(versionFile);
|
const versionFileName = getFileName(versionFile);
|
||||||
if (versionFileName == '.tool-versions') {
|
if (versionFileName == '.tool-versions') {
|
||||||
javaVersionRegExp =
|
javaVersionRegExp =
|
||||||
/^java\s+(?:\S*-)?(?<version>\d+(?:\.\d+)*([+_.-](?:openj9[-._]?\d[\w.-]*|java\d+|jre[-_\w]*|OpenJDK\d+[\w_.-]*|[a-z0-9]+))*)/im;
|
/^(java\s+)(?:\S*-)?v?(?<version>(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||||
|
|||||||
@@ -614,9 +614,5 @@ major versions: 8, 11, 16, 17, 21
|
|||||||
more specific versions: 8.0.282+8, 8.0.232, 11.0, 11.0.4, 17.0
|
more specific versions: 8.0.282+8, 8.0.232, 11.0, 11.0.4, 17.0
|
||||||
early access (EA) versions: 15-ea, 15.0.0-ea
|
early access (EA) versions: 15-ea, 15.0.0-ea
|
||||||
versions with specified distribution: openjdk64-11.0.2
|
versions with specified distribution: openjdk64-11.0.2
|
||||||
LTS versions : temurin-21.0.5+11.0.LTS
|
|
||||||
```
|
```
|
||||||
If the file contains multiple versions, only the first one will be recognized.
|
If the file contains multiple versions, only the first one will be recognized.
|
||||||
|
|
||||||
***NOTE***:
|
|
||||||
For the tool-version file, ensure that you use standard semantic versioning (semver) formats, as non-standard formats (such as jetbrains-21b212.1) may not be parsed correctly. Additionally, for complex version strings containing multiple version-like segments (for example, java semeru-openj9-11.0.15+10_openj9-0.32.0), the extraction logic may incorrectly capture the last segment (0.32.0) instead of the main version (11.0.15+10).
|
|
||||||
14
package-lock.json
generated
14
package-lock.json
generated
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "setup-java",
|
"name": "setup-java",
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
@@ -33,7 +32,7 @@
|
|||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"jest-circus": "^29.7.0",
|
"jest-circus": "^29.7.0",
|
||||||
"prettier": "^3.6.2",
|
"prettier": "^2.8.4",
|
||||||
"ts-jest": "^29.3.0",
|
"ts-jest": "^29.3.0",
|
||||||
"typescript": "^5.3.3"
|
"typescript": "^5.3.3"
|
||||||
},
|
},
|
||||||
@@ -4877,16 +4876,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/prettier": {
|
"node_modules/prettier": {
|
||||||
"version": "3.6.2",
|
"version": "2.8.8",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
|
||||||
"integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==",
|
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"bin": {
|
"bin": {
|
||||||
"prettier": "bin/prettier.cjs"
|
"prettier": "bin-prettier.js"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": ">=10.13.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"description": "setup java action",
|
"description": "setup java action",
|
||||||
"main": "dist/setup/index.js",
|
"main": "dist/setup/index.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=24.0.0"
|
"node": ">=24.0.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"jest-circus": "^29.7.0",
|
"jest-circus": "^29.7.0",
|
||||||
"prettier": "^3.6.2",
|
"prettier": "^2.8.4",
|
||||||
"ts-jest": "^29.3.0",
|
"ts-jest": "^29.3.0",
|
||||||
"typescript": "^5.3.3"
|
"typescript": "^5.3.3"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,133 +1,90 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"version": "25.0.0",
|
"version": "21.0.2",
|
||||||
"stable": true,
|
"stable": true,
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
"release_url": "https://aka.ms/download-jdk",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-25.0.0-macos-x64.tar.gz",
|
"filename": "microsoft-jdk-21.0.2-macos-x64.tar.gz",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "darwin",
|
"platform": "darwin",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-macos-x64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-macos-x64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-25.0.0-linux-x64.tar.gz",
|
"filename": "microsoft-jdk-21.0.2-linux-x64.tar.gz",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "linux",
|
"platform": "linux",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-linux-x64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-linux-x64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-25.0.0-windows-x64.zip",
|
"filename": "microsoft-jdk-21.0.2-windows-x64.zip",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-windows-x64.zip"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-windows-x64.zip"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-25.0.0-macos-aarch64.tar.gz",
|
"filename": "microsoft-jdk-21.0.2-macos-aarch64.tar.gz",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "darwin",
|
"platform": "darwin",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-macos-aarch64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-macos-aarch64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-25.0.0-linux-aarch64.tar.gz",
|
"filename": "microsoft-jdk-21.0.2-linux-aarch64.tar.gz",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "linux",
|
"platform": "linux",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-linux-aarch64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-linux-aarch64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-25.0.0-windows-aarch64.zip",
|
"filename": "microsoft-jdk-21.0.2-windows-aarch64.zip",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-windows-aarch64.zip"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-windows-aarch64.zip"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "21.0.2",
|
"version": "21.0.1",
|
||||||
"stable": true,
|
"stable": true,
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
"release_url": "https://aka.ms/download-jdk",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.2-macos-x64.tar.gz",
|
"filename": "microsoft-jdk-21.0.1-macos-x64.tar.gz",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "darwin",
|
"platform": "darwin",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-macos-x64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-macos-x64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.2-linux-x64.tar.gz",
|
"filename": "microsoft-jdk-21.0.1-linux-x64.tar.gz",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "linux",
|
"platform": "linux",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-linux-x64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-linux-x64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.2-windows-x64.zip",
|
"filename": "microsoft-jdk-21.0.1-windows-x64.zip",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-windows-x64.zip"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-windows-x64.zip"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.2-macos-aarch64.tar.gz",
|
"filename": "microsoft-jdk-21.0.1-macos-aarch64.tar.gz",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "darwin",
|
"platform": "darwin",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-macos-aarch64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-macos-aarch64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.2-linux-aarch64.tar.gz",
|
"filename": "microsoft-jdk-21.0.1-linux-aarch64.tar.gz",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "linux",
|
"platform": "linux",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-linux-aarch64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-linux-aarch64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.2-windows-aarch64.zip",
|
"filename": "microsoft-jdk-21.0.1-windows-aarch64.zip",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-windows-aarch64.zip"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-windows-aarch64.zip"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"version": "21.0.1",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-21.0.1-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-21.0.1-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-21.0.1-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-21.0.1-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-21.0.1-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-linux-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-21.0.1-windows-aarch64.zip",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-windows-aarch64.zip"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"version": "21.0.0",
|
"version": "21.0.0",
|
||||||
"stable": true,
|
"stable": true,
|
||||||
@@ -219,42 +176,42 @@
|
|||||||
"stable": true,
|
"stable": true,
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
"release_url": "https://aka.ms/download-jdk",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-17.0.9-macos-x64.tar.gz",
|
"filename": "microsoft-jdk-17.0.9-macos-x64.tar.gz",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "darwin",
|
"platform": "darwin",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-macos-x64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-macos-x64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-17.0.9-linux-x64.tar.gz",
|
"filename": "microsoft-jdk-17.0.9-linux-x64.tar.gz",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "linux",
|
"platform": "linux",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-linux-x64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-linux-x64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-17.0.9-windows-x64.zip",
|
"filename": "microsoft-jdk-17.0.9-windows-x64.zip",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-windows-x64.zip"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-windows-x64.zip"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-17.0.9-macos-aarch64.tar.gz",
|
"filename": "microsoft-jdk-17.0.9-macos-aarch64.tar.gz",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "darwin",
|
"platform": "darwin",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-macos-aarch64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-macos-aarch64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-17.0.9-linux-aarch64.tar.gz",
|
"filename": "microsoft-jdk-17.0.9-linux-aarch64.tar.gz",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "linux",
|
"platform": "linux",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-linux-aarch64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-linux-aarch64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-17.0.9-windows-aarch64.zip",
|
"filename": "microsoft-jdk-17.0.9-windows-aarch64.zip",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-windows-aarch64.zip"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-windows-aarch64.zip"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,8 +59,9 @@ export async function createToolchainsSettings({
|
|||||||
// when an alternate m2 location is specified use only that location (no .m2 directory)
|
// when an alternate m2 location is specified use only that location (no .m2 directory)
|
||||||
// otherwise use the home/.m2/ path
|
// otherwise use the home/.m2/ path
|
||||||
await io.mkdirP(settingsDirectory);
|
await io.mkdirP(settingsDirectory);
|
||||||
const originalToolchains =
|
const originalToolchains = await readExistingToolchainsFile(
|
||||||
await readExistingToolchainsFile(settingsDirectory);
|
settingsDirectory
|
||||||
|
);
|
||||||
const updatedToolchains = generateToolchainDefinition(
|
const updatedToolchains = generateToolchainDefinition(
|
||||||
originalToolchains,
|
originalToolchains,
|
||||||
jdkInfo.version,
|
jdkInfo.version,
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ export function getVersionFromFileContent(
|
|||||||
const versionFileName = getFileName(versionFile);
|
const versionFileName = getFileName(versionFile);
|
||||||
if (versionFileName == '.tool-versions') {
|
if (versionFileName == '.tool-versions') {
|
||||||
javaVersionRegExp =
|
javaVersionRegExp =
|
||||||
/^java\s+(?:\S*-)?(?<version>\d+(?:\.\d+)*([+_.-](?:openj9[-._]?\d[\w.-]*|java\d+|jre[-_\w]*|OpenJDK\d+[\w_.-]*|[a-z0-9]+))*)/im;
|
/^(java\s+)(?:\S*-)?v?(?<version>(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m;
|
||||||
} else {
|
} else {
|
||||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user