mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 09:56:46 +00:00
update readme
This commit is contained in:
parent
20a04c5835
commit
fc1780360a
2 changed files with 10 additions and 8 deletions
|
@ -17,7 +17,7 @@ This action provides the following functionality for GitHub Actions runners:
|
||||||
- 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
|
- 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
|
## Usage
|
||||||
Input `distribution` is mandatory. See [Supported distributions](../README.md#Supported-distributions) section for a list of available options.
|
Inputs `java-version` and `distribution` are mandatory. See [Supported distributions](../README.md#Supported-distributions) section for a list of available options.
|
||||||
|
|
||||||
### Basic
|
### Basic
|
||||||
```yaml
|
```yaml
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
See [action.yml](../action.yml) for more details on task inputs.
|
See [action.yml](../action.yml) for more details on task inputs.
|
||||||
|
|
||||||
## Selecting a Java distribution
|
## Selecting a Java distribution
|
||||||
Input `distribution` is mandatory and needs to be provided. See [Supported distributions](../README.md#Supported-distributions) for a list of available options.
|
Inputs `java-version` and `distribution` are mandatory and needs to be provided. See [Supported distributions](../README.md#Supported-distributions) for a list of available options.
|
||||||
|
|
||||||
### Adopt
|
### Adopt
|
||||||
```yaml
|
```yaml
|
||||||
|
@ -133,11 +133,11 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up JDK 8
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v2-preview
|
uses: actions/setup-java@v2-preview
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: '8'
|
java-version: '11'
|
||||||
|
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn -B package --file pom.xml
|
run: mvn -B package --file pom.xml
|
||||||
|
@ -150,6 +150,8 @@ jobs:
|
||||||
- name: Set up Apache Maven Central
|
- name: Set up Apache Maven Central
|
||||||
uses: actions/setup-java@v2-preview
|
uses: actions/setup-java@v2-preview
|
||||||
with: # running setup-java again overwrites the settings.xml
|
with: # running setup-java again overwrites the settings.xml
|
||||||
|
distribution: 'adopt'
|
||||||
|
java-version: '11'
|
||||||
server-id: maven # Value of the distributionManagement/repository/id field of the pom.xml
|
server-id: maven # Value of the distributionManagement/repository/id field of the pom.xml
|
||||||
server-username: MAVEN_USERNAME # env variable for username in deploy
|
server-username: MAVEN_USERNAME # env variable for username in deploy
|
||||||
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
|
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
|
||||||
|
@ -239,11 +241,11 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up JDK 8
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v2-preview
|
uses: actions/setup-java@v2-preview
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: '8'
|
java-version: '11'
|
||||||
|
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: gradle build
|
run: gradle build
|
||||||
|
@ -271,11 +273,11 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up JDK 8 for Shared Runner
|
- name: Set up JDK 11 for Shared Runner
|
||||||
uses: actions/setup-java@v2-preview
|
uses: actions/setup-java@v2-preview
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: '8'
|
java-version: '11'
|
||||||
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
|
||||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue