mirror of
https://github.com/actions/setup-java.git
synced 2025-06-29 04:24:14 +00:00
resolve comments
This commit is contained in:
parent
c65c532df3
commit
7006d0be41
3 changed files with 27 additions and 28 deletions
|
@ -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