mirror of
https://github.com/actions/setup-java.git
synced 2025-11-20 15:24:07 +00:00
Update advanced-usage.md
Add example step/file for `.sdkmanrc`
This commit is contained in:
parent
dd4a6bdd7b
commit
54b5143470
@ -602,16 +602,26 @@ steps:
|
|||||||
If the `java-version-file` input is specified, the action will extract the version from the file and install it.
|
If the `java-version-file` input is specified, the action will extract the version from the file and install it.
|
||||||
|
|
||||||
Supported files are `.java-version`, `.tool-versions` and `.sdkmanrc`.
|
Supported files are `.java-version`, `.tool-versions` and `.sdkmanrc`.
|
||||||
In `.java-version` file, only the version should be specified (e.g., 17.0.7).
|
* In `.java-version` file, only the version should be specified (e.g., 17.0.7). The `.java-version` file recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv).
|
||||||
In `.tool-versions` file, java version should be preceded by the java keyword (e.g., java 17.0.7).
|
* In `.tool-versions` file, java version should be preceded by the java keyword (e.g., java 17.0.7). The `.tool-versions` file supports version specifications in accordance with [asdf](https://github.com/asdf-vm/asdf) standards, adhering to Semantic Versioning ([semver](https://semver.org/)).
|
||||||
In `.sdkmanrc` file, java version should be preceded by the `java=` prefix (e.g., java=17.0.7-tem) and include the distribution.
|
* (NEW) In `.sdkmanrc` file, java version should be preceded by the `java=` prefix (e.g., java=17.0.7-tem) and include the distribution. The `.sdkmanrc` file supports version specifications in accordance with [file format](https://sdkman.io/usage#env-command), see [Sdkman! documentation](https://sdkman.io/jdks) for more information.
|
||||||
The `.java-version` file recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv).
|
|
||||||
Similarly, the `.tool-versions` file supports version specifications in accordance with [asdf](https://github.com/asdf-vm/asdf)
|
|
||||||
standards, adhering to Semantic Versioning ([semver](https://semver.org/)).
|
|
||||||
The `.sdkmanrc` file supports version specifications in accordance with [file format](https://sdkman.io/usage#env-command),
|
|
||||||
see [Sdkman! documentation](https://sdkman.io/jdks) for more information.
|
|
||||||
|
|
||||||
If both java-version and java-version-file inputs are provided, the java-version input will be used.
|
|
||||||
|
If both `java-version` and `java-version-file` **inputs** are provided, the `java-version` input will be used.
|
||||||
|
|
||||||
|
**Example step using `Sdkman!`**:
|
||||||
|
```yml
|
||||||
|
- name: Setup java
|
||||||
|
uses: actions/setup-java@v5
|
||||||
|
with:
|
||||||
|
java-version-file: '.sdkmanrc'
|
||||||
|
distribution: 'temurin'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Example `.sdkmanrc`**:
|
||||||
|
```
|
||||||
|
java=17.0.7-tem
|
||||||
|
```
|
||||||
|
|
||||||
Valid entry options (does not apply to `.sdkmanrc`):
|
Valid entry options (does not apply to `.sdkmanrc`):
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user