mirror of
https://github.com/s4u/setup-maven-action.git
synced 2026-02-14 00:03:08 +08:00
Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b03f80a9bf | |||
| bf6bdba903 | |||
| 6c4e9964d4 | |||
| 6ad09a30aa | |||
| 64c378ccfd | |||
| 53c9cfd053 | |||
| 99433ad2a6 | |||
| 4a57038947 | |||
| cadd5249e2 | |||
| 194b328cfe | |||
| 7227538596 | |||
| e49e3fe78c | |||
| b77843ff24 | |||
| a8a4c2d97e | |||
| 4f7fb9d967 | |||
| 31c80e7249 | |||
| 232c434257 | |||
| 9a27433d28 | |||
| 382542f776 | |||
| 7520fcc0b4 | |||
| 68896192ef | |||
| f4785d5b29 | |||
| 611a8f2746 | |||
| a46d0cb350 | |||
| 2f6a59136c | |||
| 2e2cbf3053 | |||
| a37cecafbf | |||
| a4199cab67 | |||
| 787523041c | |||
| 4aedd0b3b2 | |||
| 5f52556e27 | |||
| 5eec3f78f3 | |||
| 4095a894c5 | |||
| 8a09fe4cf2 | |||
| 2b1e091324 | |||
| 2059bfe2f2 | |||
| 6e3103c027 | |||
| 2f53a7669c | |||
| 1bea7e41c5 | |||
| 816f5e6ba8 | |||
| 25553285e3 | |||
| 4894416432 | |||
| a9992a1ccd | |||
| 3b45b50cd5 | |||
| 5a52b9da46 | |||
| e2f38a4518 | |||
| 9d09e3987e | |||
| f480a422c2 |
1
.github/workflows/release-drafter.yml
vendored
1
.github/workflows/release-drafter.yml
vendored
@ -5,6 +5,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
- 'main'
|
- 'main'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update_release_draft:
|
update_release_draft:
|
||||||
|
|||||||
37
.github/workflows/test.yml
vendored
37
.github/workflows/test.yml
vendored
@ -19,13 +19,13 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ 'ubuntu-latest', 'windows-latest', 'macOS-latest' ]
|
os: [ 'ubuntu-latest', 'windows-latest', 'macOS-latest' ]
|
||||||
java: [ '8', '11', '17', '21' ]
|
java: [ '8', '11', '17', '21' ]
|
||||||
maven: [ '3.8.8', '3.9.6' ]
|
maven: [ '3.8.8', '3.9.11' ]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
|
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
@ -41,45 +41,22 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
|
|
||||||
- uses: ./
|
- uses: ./
|
||||||
|
|
||||||
- run: mvn -V validate -Drequire.java=17 -Drequire.maven=3.9.6
|
- run: mvn -V validate -Drequire.java=17 -Drequire.maven=3.9.11
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
# regressions tests
|
|
||||||
test-issue-68:
|
|
||||||
name: Test for issue 68
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: ./
|
|
||||||
with:
|
|
||||||
settings-servers: |
|
|
||||||
[{
|
|
||||||
"id": "ossrh",
|
|
||||||
"username": "${{ vars.TEST_68_1 }}",
|
|
||||||
"password": "${{ vars.TEST_68_2 }}"
|
|
||||||
}]
|
|
||||||
|
|
||||||
- run: cat ~/.m2/settings.xml
|
|
||||||
- run: |
|
|
||||||
grep "<id>ossrh</id>" ~/.m2/settings.xml
|
|
||||||
grep "<username>username-68</username>" ~/.m2/settings.xml
|
|
||||||
grep "<password>password-68</password>" ~/.m2/settings.xml
|
|
||||||
|
|
||||||
test-ok:
|
test-ok:
|
||||||
name: Test OK
|
name: Test OK
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ test, test-default, test-issue-68 ]
|
needs: [ test, test-default ]
|
||||||
if: always()
|
if: always()
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run: 'true'
|
- run: 'true'
|
||||||
if: join(needs.*.result, ',') == 'success,success,success'
|
if: join(needs.*.result, ',') == 'success,success'
|
||||||
|
|
||||||
- run: 'false'
|
- run: 'false'
|
||||||
if: join(needs.*.result, ',') != 'success,success,success'
|
if: join(needs.*.result, ',') != 'success,success'
|
||||||
|
|||||||
31
README.md
31
README.md
@ -21,18 +21,21 @@ For default values you only need:
|
|||||||
|
|
||||||
- run: mvn -V ...
|
- run: mvn -V ...
|
||||||
```
|
```
|
||||||
|
|
||||||
# Params mapping for sub actions
|
# Params mapping for sub actions
|
||||||
|
|
||||||
## checkout
|
## checkout
|
||||||
|
|
||||||
| params | destination | default |
|
| params | destination | default |
|
||||||
|------------------------------|---------------------|--------------------------|
|
|------------------------------|---------------------|--------------------------|
|
||||||
|
| checkout-enabled | enabled | true |
|
||||||
| checkout-fetch-depth | fetch-depth | |
|
| checkout-fetch-depth | fetch-depth | |
|
||||||
|
| checkout-submodules | submodules | |
|
||||||
| checkout-path | path | |
|
| checkout-path | path | |
|
||||||
| checkout-ref | ref | |
|
| checkout-ref | ref | |
|
||||||
| checkout-repository | repository | ${{ github.repository }} |
|
| checkout-repository | repository | ${{ github.repository }} |
|
||||||
| checkout-token | token | ${{ github.token }} |
|
| checkout-token | token | ${{ github.token }} |
|
||||||
|
| checkout-ssh-key | ssh-key | |
|
||||||
| checkout-persist-credentials | persist-credentials | false |
|
| checkout-persist-credentials | persist-credentials | false |
|
||||||
|
|
||||||
## setup-java
|
## setup-java
|
||||||
@ -40,7 +43,8 @@ For default values you only need:
|
|||||||
| params | destination | default |
|
| params | destination | default |
|
||||||
|-------------------|--------------|---------|
|
|-------------------|--------------|---------|
|
||||||
| java-version | java-version | 17 |
|
| java-version | java-version | 17 |
|
||||||
| java-distribution | distribution | temurin |
|
| java-distribution | distribution | zulu |
|
||||||
|
| java-jdkFile | jdkFile | |
|
||||||
|
|
||||||
## cache
|
## cache
|
||||||
|
|
||||||
@ -61,7 +65,7 @@ So we can use for action:
|
|||||||
| params | description |
|
| params | description |
|
||||||
|----------------|----------------------------------------------------------|
|
|----------------|----------------------------------------------------------|
|
||||||
| cache-enabled | enable cache. Default true |
|
| cache-enabled | enable cache. Default true |
|
||||||
| cache-path | default cache path for Maven with value ~/.m2/repository |
|
| cache-path | default cache path for Maven with value ~/.m2/repository |
|
||||||
| cache-path-add | additional value for cache path |
|
| cache-path-add | additional value for cache path |
|
||||||
| cache-prefix | prefix value for `key` and `restore-keys` cache params |
|
| cache-prefix | prefix value for `key` and `restore-keys` cache params |
|
||||||
|
|
||||||
@ -70,16 +74,21 @@ So we can use for action:
|
|||||||
|
|
||||||
| params | destination | default |
|
| params | destination | default |
|
||||||
|---------------|---------------|---------|
|
|---------------|---------------|---------|
|
||||||
| maven-version | maven-version | 3.9.6 |
|
| maven-version | maven-version | 3.9.11 |
|
||||||
|
|
||||||
## maven-settings-action
|
## maven-settings-action
|
||||||
|
|
||||||
| params | destination |
|
| params | destination |
|
||||||
|----------------------------|-------------------|
|
|-----------------------------|--------------------|
|
||||||
| settings-servers | servers |
|
| settings-servers | servers |
|
||||||
| settings-mirrors | mirrors |
|
| settings-mirrors | mirrors |
|
||||||
| settings-properties | properties |
|
| settings-properties | properties |
|
||||||
| settings-sonatypeSnapshots | sonatypeSnapshots |
|
| settings-sonatypeSnapshots | sonatypeSnapshots |
|
||||||
|
| settings-proxies | proxies |
|
||||||
|
| settings-repositories | repositories |
|
||||||
|
| settings-pluginRepositories | pluginRepositories |
|
||||||
|
| settings-githubServer | githubServer |
|
||||||
|
| settings-path | path |
|
||||||
|
|
||||||
# Testing against different Maven versions
|
# Testing against different Maven versions
|
||||||
|
|
||||||
@ -91,7 +100,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
maven: [ '3.8.8', '3.9.6' ]
|
maven: [ '3.8.8', '3.9.8' ]
|
||||||
|
|
||||||
name: Maven ${{ matrix.maven }} sample
|
name: Maven ${{ matrix.maven }} sample
|
||||||
|
|
||||||
|
|||||||
75
action.yml
75
action.yml
@ -8,10 +8,19 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
|
|
||||||
# checkout
|
# checkout
|
||||||
|
checkout-enabled:
|
||||||
|
description: 'Enable checkout'
|
||||||
|
default: 'true'
|
||||||
|
required: false
|
||||||
|
|
||||||
checkout-fetch-depth:
|
checkout-fetch-depth:
|
||||||
description: 'Number of commits to fetch'
|
description: 'Number of commits to fetch'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
|
checkout-submodules:
|
||||||
|
description: 'Whether to fetch submodules'
|
||||||
|
required: false
|
||||||
|
|
||||||
checkout-path:
|
checkout-path:
|
||||||
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
|
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
|
||||||
required: false
|
required: false
|
||||||
@ -35,6 +44,10 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
|
|
||||||
|
checkout-ssh-key:
|
||||||
|
description: 'SSH key used to fetch the repository. It allows to run authenticated git commands'
|
||||||
|
required: false
|
||||||
|
|
||||||
# java jdk params
|
# java jdk params
|
||||||
|
|
||||||
java-version:
|
java-version:
|
||||||
@ -44,7 +57,11 @@ inputs:
|
|||||||
|
|
||||||
java-distribution:
|
java-distribution:
|
||||||
description: 'Java distribution'
|
description: 'Java distribution'
|
||||||
default: 'temurin'
|
default: 'zulu'
|
||||||
|
required: false
|
||||||
|
|
||||||
|
java-jdkFile:
|
||||||
|
description: 'Java JDK compressed file location'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
# cache
|
# cache
|
||||||
@ -69,47 +86,72 @@ inputs:
|
|||||||
# maven version
|
# maven version
|
||||||
maven-version:
|
maven-version:
|
||||||
description: 'The Maven version to set up'
|
description: 'The Maven version to set up'
|
||||||
default: '3.9.6'
|
default: '3.9.11'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
# maven settings.xml
|
# maven settings.xml
|
||||||
settings-servers:
|
settings-servers:
|
||||||
description: 'servers definition in json array, eg: [{"id": "serverId", "username": "username", "password": "password"}]'
|
description: 'servers definition in json array, e.g.: [{"id": "serverId", "username": "username", "password": "password"}]'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
settings-mirrors:
|
settings-mirrors:
|
||||||
description: 'mirrors definition in json array, eg: [{"id": "id", "name": "name", "mirrorOf": "mirrorOf", "url": "url"}]'
|
description: 'mirrors definition in json array, e.g.: [{"id": "id", "name": "name", "mirrorOf": "mirrorOf", "url": "url"}]'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
settings-properties:
|
settings-properties:
|
||||||
description: 'json array with properties, eg [{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'
|
description: 'json array with properties, e.g.: [{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
settings-sonatypeSnapshots:
|
settings-sonatypeSnapshots:
|
||||||
description: 'add https://oss.sonatype.org/content/repositories/snapshots to repository list - true or false'
|
description: 'add https://oss.sonatype.org/content/repositories/snapshots to repository list - true or false'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
|
settings-proxies:
|
||||||
|
description: 'proxies definition in json array, e.g.: [{"id": "http-proxy", "active": "true", "protocol": "http", "host": "host", "port": "port", "nonProxyHosts": "host1|host2"}]'
|
||||||
|
required: false
|
||||||
|
|
||||||
|
settings-repositories:
|
||||||
|
description: 'repository settings definition in json array, e.g.: [ { "id": "repoId","name": "repoName","url": "url","snapshots": { "enabled": true } } ]'
|
||||||
|
required: false
|
||||||
|
|
||||||
|
settings-pluginRepositories:
|
||||||
|
description: 'plugin repository settings definition in json array, e.g.: [{"id":"repoId","name":"repoName","url":"url","snapshots":{"enabled":true}}]'
|
||||||
|
required: false
|
||||||
|
|
||||||
|
settings-githubServer:
|
||||||
|
description: 'add to settings.xml servers server-id: github; username=$GITHUB_ACTOR and password=$GITHUB_TOKEN'
|
||||||
|
default: "true"
|
||||||
|
required: false
|
||||||
|
|
||||||
|
settings-path:
|
||||||
|
description: 'override default path to settings.xml which is $HOME/.m2/settings.xml'
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||||
|
if: inputs.checkout-enabled == 'true'
|
||||||
with:
|
with:
|
||||||
fetch-depth: '${{ inputs.checkout-fetch-depth }}'
|
fetch-depth: '${{ inputs.checkout-fetch-depth }}'
|
||||||
|
submodules: '${{ inputs.checkout-submodules }}'
|
||||||
path: '${{ inputs.checkout-path }}'
|
path: '${{ inputs.checkout-path }}'
|
||||||
persist-credentials: '${{ inputs.checkout-persist-credentials }}'
|
persist-credentials: '${{ inputs.checkout-persist-credentials }}'
|
||||||
ref: '${{ inputs.checkout-ref }}'
|
ref: '${{ inputs.checkout-ref }}'
|
||||||
repository: '${{ inputs.checkout-repository }}'
|
repository: '${{ inputs.checkout-repository }}'
|
||||||
token: '${{ inputs.checkout-token }}'
|
token: '${{ inputs.checkout-token }}'
|
||||||
|
ssh-key: '${{ inputs.checkout-ssh-key }}'
|
||||||
|
|
||||||
- uses: actions/setup-java@v4
|
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
|
||||||
with:
|
with:
|
||||||
overwrite-settings: false
|
overwrite-settings: false
|
||||||
java-version: '${{ inputs.java-version }}'
|
java-version: '${{ inputs.java-version }}'
|
||||||
distribution: '${{ inputs.java-distribution }}'
|
distribution: '${{ inputs.java-distribution }}'
|
||||||
|
jdkFile: '${{ inputs.java-jdkFile }}'
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||||
if: inputs.cache-enabled == 'true'
|
if: inputs.cache-enabled == 'true'
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
@ -123,14 +165,19 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
id: current-maven
|
id: current-maven
|
||||||
|
|
||||||
- uses: stCarolas/setup-maven@v5
|
- uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
|
||||||
if: inputs.maven-version != steps.current-maven.outputs.version
|
if: inputs.maven-version != steps.current-maven.outputs.version
|
||||||
with:
|
with:
|
||||||
maven-version: '${{ inputs.maven-version }}'
|
maven-version: '${{ inputs.maven-version }}'
|
||||||
|
|
||||||
- uses: s4u/maven-settings-action@v3.0.0
|
- uses: s4u/maven-settings-action@894661b3ddae382f1ae8edbeab60987e08cf0788 # v4.0.0
|
||||||
with:
|
with:
|
||||||
servers: '${{ inputs.settings-servers}}'
|
servers: '${{ inputs.settings-servers }}'
|
||||||
mirrors: '${{ inputs.settings-mirrors}}'
|
mirrors: '${{ inputs.settings-mirrors }}'
|
||||||
properties: '${{ inputs.settings-properties}}'
|
properties: '${{ inputs.settings-properties }}'
|
||||||
sonatypeSnapshots: '${{ inputs.settings-sonatypeSnapshots}}'
|
sonatypeSnapshots: '${{ inputs.settings-sonatypeSnapshots }}'
|
||||||
|
proxies: '${{ inputs.settings-proxies }}'
|
||||||
|
repositories: '${{ inputs.settings-repositories }}'
|
||||||
|
pluginRepositories: '${{ inputs.settings-pluginRepositories }}'
|
||||||
|
githubServer: '${{ inputs.settings-githubServer }}'
|
||||||
|
path: '${{ inputs.settings-path }}'
|
||||||
|
|||||||
Reference in New Issue
Block a user