mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 01:46:46 +00:00
resolve comments
This commit is contained in:
parent
c65c532df3
commit
7006d0be41
3 changed files with 27 additions and 28 deletions
10
README.md
10
README.md
|
@ -5,15 +5,15 @@
|
|||
</p>
|
||||
|
||||
This action provides the following functionality for GitHub Actions runners:
|
||||
- Downloading and setting up a requested version of Java. See [Usage](#Usage) section for the list of supported distributions
|
||||
- Extracting and caching custom version of Java from local file
|
||||
- Downloading and setting up a requested version of Java. See [Usage](#Usage) for a list of supported distributions
|
||||
- Extracting and caching custom version of Java from a local file
|
||||
- Configuring runner for publishing using Apache Maven
|
||||
- Configuring runner for publishing using Gradle
|
||||
- Configuring runner for using GPG private key
|
||||
- Registering problem matchers for error output
|
||||
|
||||
## V2 vs V1
|
||||
- V2 has support of custom distributions and provides support of Zulu OpenJDK and Adoptium (former AdoptOpenJDK) out of the box. V1 supports only Zulu OpenJDK
|
||||
- V2 has support of custom distributions and provides support of Zulu OpenJDK and Adoptium (formerly known as AdoptOpenJDK) out of the box. V1 supports only Zulu OpenJDK
|
||||
- V2 requires you to specify distribution along with the version. V1 defaults to Zulu OpenJDK, only version input is required. Follow [the migration guide](docs/switching-to-v2.md) to switch from V1 to V2
|
||||
|
||||
## Usage
|
||||
|
@ -31,10 +31,10 @@ steps:
|
|||
```
|
||||
|
||||
#### Supported version syntax
|
||||
Input `java-version` supports version range or exact version in [SemVer](https://semver.org/) format:
|
||||
The `java-version` input supports an exact version or a version range using [SemVer](https://semver.org/) notation:
|
||||
- major versions: `8`, `11`, `15`, `11.x`
|
||||
- more specific versions: `8.0.232`, `11.0.4`, `11.0`, `11.0.x`
|
||||
- an early access (EA) versions: `15-ea`, `15.0.0-ea`, `15.0.0-ea.2`
|
||||
- early access (EA) versions: `15-ea`, `15.0.0-ea`, `15.0.0-ea.2`
|
||||
|
||||
#### Supported distributions
|
||||
Currently, the following distributions are supported:
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
See [action.yml](../action.yml) for more details on task inputs.
|
||||
|
||||
## Selecting Java distribution
|
||||
Input `distribution` is mandatory and should be provided to use action. See [Supported distributions](../README.md#Supported-distributions) for the list of available options.
|
||||
Input `distribution` is mandatory and needs to be provided to use action. See [Supported distributions](../README.md#Supported-distributions) for a list of available options.
|
||||
|
||||
### Adoptium
|
||||
```yaml
|
||||
|
@ -65,7 +65,7 @@ steps:
|
|||
```
|
||||
|
||||
## Installing Java from local file
|
||||
If your use-case requires custom distribution or version that is not provided by action, you can download it manually and then action will take care about installation and caching of this version on VM:
|
||||
If your use-case requires a custom distribution or a version that is not provided by setup-java, you can download it manually and setup-java will take care of the installation and caching on the VM:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
|
@ -124,22 +124,6 @@ jobs:
|
|||
```
|
||||
|
||||
## Publishing using Apache Maven
|
||||
|
||||
### Extra setup for pom.xml:
|
||||
|
||||
The Maven GPG Plugin configuration in the pom.xml file should contain the following structure to avoid possible issues like `Inappropriate ioctl for device` or `gpg: signing failed: No such file or directory`:
|
||||
|
||||
```xml
|
||||
<configuration>
|
||||
<!-- Prevent gpg from using pinentry programs -->
|
||||
<gpgArguments>
|
||||
<arg>--pinentry-mode</arg>
|
||||
<arg>loopback</arg>
|
||||
</gpgArguments>
|
||||
</configuration>
|
||||
```
|
||||
GPG 2.1 requires `--pinentry-mode` to be set to `loopback` in order to pick up the `gpg.passphrase` value defined in Maven `settings.xml`.
|
||||
|
||||
### Yaml example:
|
||||
```yaml
|
||||
jobs:
|
||||
|
@ -222,6 +206,21 @@ The two `settings.xml` files created from the above example look like the follow
|
|||
|
||||
***NOTE: The `settings.xml` file is created in the Actions $HOME/.m2 directory. If you have an existing `settings.xml` file at that location, it will be overwritten. See below for using the `settings-path` to change your `settings.xml` file location.***
|
||||
|
||||
### Extra setup for pom.xml:
|
||||
|
||||
The Maven GPG Plugin configuration in the pom.xml file should contain the following structure to avoid possible issues like `Inappropriate ioctl for device` or `gpg: signing failed: No such file or directory`:
|
||||
|
||||
```xml
|
||||
<configuration>
|
||||
<!-- Prevent gpg from using pinentry programs -->
|
||||
<gpgArguments>
|
||||
<arg>--pinentry-mode</arg>
|
||||
<arg>loopback</arg>
|
||||
</gpgArguments>
|
||||
</configuration>
|
||||
```
|
||||
GPG 2.1 requires `--pinentry-mode` to be set to `loopback` in order to pick up the `gpg.passphrase` value defined in Maven `settings.xml`.
|
||||
|
||||
### GPG
|
||||
|
||||
If `gpg-private-key` input is provided, the private key will be written to a file in the runner's temp directory, the private key file will be imported into the GPG keychain, and then the file will be promptly removed before proceeding with the rest of the setup process. A cleanup step will remove the imported private key from the GPG keychain after the job completes regardless of the job status. This ensures that the private key is no longer accessible on self-hosted runners and cannot "leak" between jobs (hosted runners are always clean instances).
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Switching to V2
|
||||
## Java distribution
|
||||
The major breaking change in V2 is the new mandatory input `distribution`. This field should be specified with one of supported distributions. See [Supported distributions](../README.md#Supported-distributions) section for the list of available options.
|
||||
Use `zulu` keyword if you would like to continue using the same distribution as in the V1.
|
||||
The major breaking change in V2 is the new mandatory `distribution` input. This field should be specified with one of supported distributions. See [Supported distributions](../README.md#Supported-distributions) for a list of available options.
|
||||
Use the `zulu` keyword if you would like to continue using the same distribution as in the V1.
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -16,7 +16,7 @@ steps:
|
|||
**General recommendation** — configure CI with the same distribution that is used on your local dev machine.
|
||||
|
||||
## Installing custom Java distribution from local file
|
||||
Since `distribution` input is required in V2, you should specify it as `jdkFile` to continue installing Java from local file
|
||||
Since the `distribution` input is required in V2, you should specify it using `jdkFile` to continue installing Java from a local file on the runner
|
||||
```yaml
|
||||
steps:
|
||||
- run: |
|
||||
|
@ -31,5 +31,5 @@ steps:
|
|||
```
|
||||
|
||||
## Dropping legacy Java version syntax 1.x
|
||||
V1 supported legacy Java syntax like `1.8` (same as `8`), `1.8.0.212` (same as `8.0.212`).
|
||||
V2 dropped support of old syntax so workflows should be changed accordingly.
|
||||
V1 supported legacy Java syntax such as `1.8` (same as `8`) and `1.8.0.212` (same as `8.0.212`).
|
||||
V2 dropped support for legacy syntax so workflows should be updated accordingly.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue