mirror of
https://github.com/s4u/setup-maven-action.git
synced 2026-04-14 00:42:16 +08:00
Compare commits
158 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba34de01b7 | ||
|
|
0015d1cf3d | ||
|
|
87e39a0b1a | ||
|
|
ed02f10aa2 | ||
|
|
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 | ||
|
|
6d44c18d67 | ||
|
|
9f3d803b4e | ||
|
|
023b47f3ae | ||
|
|
5257c30aee | ||
|
|
88b5bc7548 | ||
|
|
6c5362973d | ||
|
|
f8353fecf3 | ||
|
|
9337884575 | ||
|
|
c6cceea941 | ||
|
|
fa2c7e4517 | ||
|
|
78d72295d8 | ||
|
|
5727e29093 | ||
|
|
57ca7f1a81 | ||
|
|
41e894b5c6 | ||
|
|
c1ef1c9458 | ||
|
|
fe0723070c | ||
|
|
f416ae1666 | ||
|
|
428a7bd6a8 | ||
|
|
7b66d0ca2e | ||
|
|
2dce5ee2b1 | ||
|
|
e912d59387 | ||
|
|
721df57437 | ||
|
|
21adf11259 | ||
|
|
94605e0cdf | ||
|
|
ff947fe3e9 | ||
|
|
35afc95be0 | ||
|
|
4f918ce4df | ||
|
|
e3f10494a8 | ||
|
|
7cf09e2e6e | ||
|
|
deb771502d | ||
|
|
e5734e3ce7 | ||
|
|
fc8e36b653 | ||
|
|
8c7ad20804 | ||
|
|
4e0b434104 | ||
|
|
bb348407a1 | ||
|
|
b185da4934 | ||
|
|
4fdbe2a6a7 | ||
|
|
6f549063f4 | ||
|
|
615b14550f | ||
|
|
835f1da688 | ||
|
|
cab2e3d716 | ||
|
|
a993197694 | ||
|
|
44901dc0f8 | ||
|
|
63e4cd9ad1 | ||
|
|
f0414a8351 | ||
|
|
81f0483288 | ||
|
|
af6b8e170c | ||
|
|
22a06a2fe3 | ||
|
|
d36f1fc23e | ||
|
|
b53dd2825a | ||
|
|
56cc41b90d | ||
|
|
e3c826f8cc | ||
|
|
4c63d7d932 | ||
|
|
4585690afd | ||
|
|
22fe1553d7 | ||
|
|
18ef4b759e | ||
|
|
58b2cc938d | ||
|
|
004043f81b | ||
|
|
d9764096ef | ||
|
|
d60941527d | ||
|
|
8668fb9de8 | ||
|
|
ec82f26b88 | ||
|
|
1907361ea9 | ||
|
|
d4245fa41a | ||
|
|
35a231e628 | ||
|
|
bee771f042 | ||
|
|
5344d1092e | ||
|
|
cd150da647 | ||
|
|
f2a772b79b | ||
|
|
b82597c31c | ||
|
|
2a61fa7362 | ||
|
|
47c2778e48 | ||
|
|
18ed4916ce | ||
|
|
a2f82a8171 | ||
|
|
f0c6d72092 | ||
|
|
fccb401913 | ||
|
|
440eda18c7 | ||
|
|
44b3adc17b | ||
|
|
8d6de218c6 | ||
|
|
421a3d288e | ||
|
|
00510bfd43 | ||
|
|
8693beee3c | ||
|
|
9589d5648d | ||
|
|
d27f7bad34 | ||
|
|
07db3fb4b2 | ||
|
|
3a36aae9ec | ||
|
|
b8af8b0ed8 | ||
|
|
336767f6a6 | ||
|
|
078175723e | ||
|
|
38506fd243 | ||
|
|
41d4657217 | ||
|
|
e9a7bdc6d6 | ||
|
|
b3d576e79a | ||
|
|
ff43cac4ad | ||
|
|
cac57cc0b0 | ||
|
|
490f541598 | ||
|
|
638a374dff | ||
|
|
6f35cfffb0 | ||
|
|
4ce3c6745c | ||
|
|
2261292f40 | ||
|
|
10041ccdff | ||
|
|
7d14bd0fab | ||
|
|
73706c9355 | ||
|
|
f625f4e949 | ||
|
|
d253165ff8 | ||
|
|
339d84e602 |
23
.github/workflows/auto-approve.yml
vendored
23
.github/workflows/auto-approve.yml
vendored
@ -1,25 +1,10 @@
|
||||
name: Auto approve
|
||||
name: Auto Approve
|
||||
|
||||
on:
|
||||
pull_request_target
|
||||
|
||||
jobs:
|
||||
auto-approve:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- uses: alexwilson/enable-github-automerge-action@1.0.0
|
||||
if: >
|
||||
github.actor == 'dependabot[bot]'
|
||||
|| github.actor == 'dependabot-preview[bot]'
|
||||
with:
|
||||
merge-method: "REBASE"
|
||||
github-token: "${{ secrets.TECH_TOKEN }}"
|
||||
|
||||
- uses: hmarr/auto-approve-action@v2.1.0
|
||||
if: >
|
||||
github.actor == 'dependabot[bot]'
|
||||
|| github.actor == 'dependabot-preview[bot]'
|
||||
|| github.actor == 'slawekjaranowski'
|
||||
with:
|
||||
github-token: "${{ secrets.TECH_TOKEN }}"
|
||||
uses: s4u/.github/.github/workflows/auto-approve.yml@master
|
||||
secrets:
|
||||
TECH_TOKEN: ${{ secrets.TECH_TOKEN }}
|
||||
|
||||
14
.github/workflows/release-drafter.yml
vendored
14
.github/workflows/release-drafter.yml
vendored
@ -4,18 +4,10 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'main'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update_release_draft:
|
||||
name: Update Release Draft
|
||||
runs-on: ubuntu-latest
|
||||
concurrency: release-drafter
|
||||
|
||||
if: >
|
||||
github.repository_owner == 's4u'
|
||||
&& !startsWith(github.event.head_commit.message , '[maven-release-plugin]')
|
||||
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5.15.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
uses: s4u/.github/.github/workflows/release-drafter.yml@master
|
||||
|
||||
38
.github/workflows/test.yml
vendored
38
.github/workflows/test.yml
vendored
@ -2,9 +2,11 @@ name: Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- 'main'
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'dependabot/**'
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
schedule:
|
||||
- cron: '22 23 * * 5'
|
||||
@ -16,21 +18,45 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ 'ubuntu-latest', 'windows-latest', 'macOS-latest' ]
|
||||
java: [ '8', '11', '16' ]
|
||||
maven: [ '3.5.4', '3.6.3', '3.8.2' ]
|
||||
java: [ '8', '11', '17', '21', '25' ]
|
||||
maven: [ '3.8.8', '3.9.14' ]
|
||||
fail-fast: false
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- uses: ./
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
java-cache: maven
|
||||
maven-version: ${{ matrix.maven }}
|
||||
cache-prefix: 'test-prefix-'
|
||||
|
||||
- run: mvn -V validate -Drequire.java=${{ matrix.java }} -Drequire.maven=${{ matrix.maven }}
|
||||
shell: bash
|
||||
|
||||
test-default:
|
||||
name: Test with defaults
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- uses: ./
|
||||
|
||||
- run: mvn -V validate -Drequire.java=17 -Drequire.maven=3.9.14
|
||||
shell: bash
|
||||
|
||||
test-ok:
|
||||
name: Test OK
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ test, test-default ]
|
||||
if: always()
|
||||
|
||||
steps:
|
||||
- run: 'true'
|
||||
if: join(needs.*.result, ',') == 'success,success'
|
||||
|
||||
- run: 'false'
|
||||
if: join(needs.*.result, ',') != 'success,success'
|
||||
|
||||
112
README.md
112
README.md
@ -1,48 +1,94 @@
|
||||
# Setup Maven with settings.xml
|
||||
# Setup Maven Action
|
||||
[](https://github.com/s4u/setup-maven-action/actions/workflows/test.yml)
|
||||
|
||||
This is composite action which help to prepare GitHub Actions environment for Maven build by calling:
|
||||
|
||||
- [actions/checkout](https://github.com/marketplace/actions/checkout)
|
||||
- [actions/setup-java](https://github.com/marketplace/actions/setup-java-jdk)
|
||||
- [actions/cache](https://github.com/marketplace/actions/cache)
|
||||
- [stCarolas/setup-maven](https://github.com/marketplace/actions/setup-maven)
|
||||
- [s4u/maven-settings-action](https://github.com/marketplace/actions/maven-settings-action)
|
||||
|
||||
# Contributions
|
||||
- Contributions are welcome!
|
||||
- Give :star: - if you want to encourage me to work on a project
|
||||
- Don't hesitate to create issues for new features you dream of or if you suspect some bug
|
||||
:exclamation: You **should not** include above actions in your configuration - in other case those will be **called twice**. :exclamation:
|
||||
|
||||
# Project versioning
|
||||
This project uses [Semantic Versioning](https://semver.org/).
|
||||
We recommended to use the latest and specific release version.
|
||||
For default values you only need:
|
||||
|
||||
In order to keep your project dependencies up to date you can watch this repository *(Releases only)*
|
||||
or use automatic tools like [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates).
|
||||
```yml
|
||||
steps:
|
||||
|
||||
- name: Setup Maven Action
|
||||
uses: s4u/setup-maven-action@< version >
|
||||
|
||||
- run: mvn -V ...
|
||||
```
|
||||
|
||||
# Params mapping for sub actions
|
||||
|
||||
## checkout
|
||||
|
||||
| params | destination | default |
|
||||
|------------------------------|---------------------|--------------------------|
|
||||
| checkout-enabled | enabled | true |
|
||||
| checkout-fetch-depth | fetch-depth | |
|
||||
| checkout-submodules | submodules | |
|
||||
| checkout-path | path | |
|
||||
| checkout-ref | ref | |
|
||||
| checkout-repository | repository | ${{ github.repository }} |
|
||||
| checkout-token | token | ${{ github.token }} |
|
||||
| checkout-ssh-key | ssh-key | |
|
||||
| checkout-persist-credentials | persist-credentials | false |
|
||||
|
||||
## setup-java
|
||||
|
||||
| params | destination | default |
|
||||
| ----------------- |------------- |-------- |
|
||||
| java-version | java-version | |
|
||||
| java-distribution | distribution | temurin |
|
||||
| java-cache | cache | |
|
||||
|-------------------|--------------|---------|
|
||||
| java-version | java-version | 17 |
|
||||
| java-distribution | distribution | zulu |
|
||||
| java-jdkFile | jdkFile | |
|
||||
|
||||
## cache
|
||||
|
||||
A cache action is configured as:
|
||||
|
||||
```yaml
|
||||
- uses: actions/cache
|
||||
with:
|
||||
path: |
|
||||
${{ inputs.cache-path }}
|
||||
${{ inputs.cache-path-add }}
|
||||
key: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-
|
||||
```
|
||||
|
||||
So we can use for action:
|
||||
|
||||
| params | description |
|
||||
|----------------|----------------------------------------------------------|
|
||||
| cache-enabled | enable cache. Default true |
|
||||
| cache-path | default cache path for Maven with value ~/.m2/repository |
|
||||
| cache-path-add | additional value for cache path |
|
||||
| cache-prefix | prefix value for `key` and `restore-keys` cache params |
|
||||
|
||||
|
||||
## setup-maven
|
||||
|
||||
| params | destination | default |
|
||||
| ------------- |-------------- |-------- |
|
||||
| maven-version | maven-version | 3.8.1 |
|
||||
|---------------|---------------|---------|
|
||||
| maven-version | maven-version | 3.9.14 |
|
||||
|
||||
## maven-settings-action
|
||||
|
||||
| params | destination |
|
||||
| -------------------------- |------------------ |
|
||||
| settings-servers | servers |
|
||||
| settings-mirrors | mirrors |
|
||||
| settings-properties | properties |
|
||||
| settings-sonatypeSnapshots | sonatypeSnapshots |
|
||||
| params | destination |
|
||||
|-----------------------------|--------------------|
|
||||
| settings-servers | servers |
|
||||
| settings-mirrors | mirrors |
|
||||
| settings-properties | properties |
|
||||
| settings-sonatypeSnapshots | sonatypeSnapshots |
|
||||
| settings-proxies | proxies |
|
||||
| settings-repositories | repositories |
|
||||
| settings-pluginRepositories | pluginRepositories |
|
||||
| settings-githubServer | githubServer |
|
||||
| settings-path | path |
|
||||
|
||||
# Testing against different Maven versions
|
||||
|
||||
@ -54,21 +100,35 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
maven: [ '3.5.4', '3.6.3', '3.8.2' ]
|
||||
maven: [ '3.8.8', '3.9.8' ]
|
||||
|
||||
name: Maven ${{ matrix.maven }} sample
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Maven
|
||||
uses: setup-maven@v1.0.0
|
||||
- name: Setup Maven Action
|
||||
uses: s4u/setup-maven-action@< version >
|
||||
with:
|
||||
java-version: 8
|
||||
maven-version: ${{ matrix.maven }}
|
||||
|
||||
- run: mvn -V ...
|
||||
```
|
||||
|
||||
# Contributions
|
||||
|
||||
- Contributions are welcome!
|
||||
- Give :star: - if you want to encourage me to work on a project
|
||||
- Don't hesitate to create issues for new features you dream of or if you suspect some bug
|
||||
|
||||
# Project versioning
|
||||
|
||||
This project uses [Semantic Versioning](https://semver.org/).
|
||||
We recommended using the latest and specific release version.
|
||||
|
||||
In order to keep your project dependencies up to date you can watch this repository *(Releases only)*
|
||||
or use automatic tools like [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates).
|
||||
|
||||
# License
|
||||
|
||||
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
||||
|
||||
160
action.yml
160
action.yml
@ -1,5 +1,5 @@
|
||||
name: 'Setup Maven with settings.xml'
|
||||
description: 'Setup environment for Maven build'
|
||||
name: 'Setup Maven Action'
|
||||
description: 'Complete environment configuration for Maven builds'
|
||||
|
||||
branding:
|
||||
icon: 'settings'
|
||||
@ -7,75 +7,177 @@ branding:
|
||||
|
||||
inputs:
|
||||
|
||||
# checkout
|
||||
checkout-enabled:
|
||||
description: 'Enable checkout'
|
||||
default: 'true'
|
||||
required: false
|
||||
|
||||
checkout-fetch-depth:
|
||||
description: 'Number of commits to fetch'
|
||||
required: false
|
||||
|
||||
checkout-submodules:
|
||||
description: 'Whether to fetch submodules'
|
||||
required: false
|
||||
|
||||
checkout-path:
|
||||
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
|
||||
required: false
|
||||
|
||||
checkout-persist-credentials:
|
||||
description: 'Whether to configure the token or SSH key with the local git config'
|
||||
default: 'false'
|
||||
required: false
|
||||
|
||||
checkout-ref:
|
||||
description: 'The branch, tag, or SHA of the repository to clone'
|
||||
required: false
|
||||
|
||||
checkout-repository:
|
||||
description: 'The repository to checkout if not the repository that triggered the action. For use when building GitHub Apps'
|
||||
required: false
|
||||
default: ${{ github.repository }}
|
||||
|
||||
checkout-token:
|
||||
description: 'Token to use for checkout if checking out a repository out of scope for GITHUB_TOKEN'
|
||||
required: false
|
||||
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-version:
|
||||
description: 'The Java version to set up'
|
||||
default: '17'
|
||||
required: true
|
||||
|
||||
java-distribution:
|
||||
description: 'Java distribution'
|
||||
default: 'temurin'
|
||||
default: 'zulu'
|
||||
required: false
|
||||
|
||||
java-cache:
|
||||
description: 'Name of the build platform to cache dependencies. It should be "maven" or empty.'
|
||||
required: true
|
||||
java-jdkFile:
|
||||
description: 'Java JDK compressed file location'
|
||||
required: false
|
||||
|
||||
# cache
|
||||
cache-enabled:
|
||||
description: 'Enable cache'
|
||||
default: 'true'
|
||||
required: false
|
||||
|
||||
cache-prefix:
|
||||
description: 'Cache key prefix'
|
||||
required: false
|
||||
|
||||
cache-path:
|
||||
description: 'Cache path'
|
||||
default: '~/.m2/repository'
|
||||
required: false
|
||||
|
||||
cache-path-add:
|
||||
description: 'Additional item for cache path'
|
||||
required: false
|
||||
|
||||
# maven version
|
||||
maven-version:
|
||||
description: 'The Maven version to set up'
|
||||
default: 3.8.1
|
||||
default: '3.9.14'
|
||||
required: false
|
||||
|
||||
# maven settings.xml
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
settings-sonatypeSnapshots:
|
||||
description: 'add https://oss.sonatype.org/content/repositories/snapshots to repository list - true or 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:
|
||||
using: 'composite'
|
||||
|
||||
steps:
|
||||
|
||||
- run: echo "::group::Setup Java"
|
||||
shell: bash
|
||||
- uses: actions/setup-java@v2.3.0
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
if: inputs.checkout-enabled == 'true'
|
||||
with:
|
||||
fetch-depth: '${{ inputs.checkout-fetch-depth }}'
|
||||
submodules: '${{ inputs.checkout-submodules }}'
|
||||
path: '${{ inputs.checkout-path }}'
|
||||
persist-credentials: '${{ inputs.checkout-persist-credentials }}'
|
||||
ref: '${{ inputs.checkout-ref }}'
|
||||
repository: '${{ inputs.checkout-repository }}'
|
||||
token: '${{ inputs.checkout-token }}'
|
||||
ssh-key: '${{ inputs.checkout-ssh-key }}'
|
||||
|
||||
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
|
||||
with:
|
||||
overwrite-settings: false
|
||||
java-version: '${{ inputs.java-version }}'
|
||||
distribution: '${{ inputs.java-distribution }}'
|
||||
cache: '${{ inputs.java-cache }}'
|
||||
- run: echo "::endgroup::"
|
||||
shell: bash
|
||||
jdkFile: '${{ inputs.java-jdkFile }}'
|
||||
|
||||
- run: echo "::group::Setup Maven Version"
|
||||
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
||||
if: inputs.cache-enabled == 'true'
|
||||
with:
|
||||
path: |
|
||||
${{ inputs.cache-path }}
|
||||
${{ inputs.cache-path-add }}
|
||||
key: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-
|
||||
|
||||
- name: Installed Maven version
|
||||
run: echo "version=$(mvn -q -v)" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- uses: stCarolas/setup-maven@v4.1
|
||||
id: current-maven
|
||||
|
||||
- uses: stCarolas/setup-maven@12eb41b233df95d49b0c11fc1b5bc8312e5d4ce0 # v5.1
|
||||
if: inputs.maven-version != steps.current-maven.outputs.version
|
||||
with:
|
||||
maven-version: '${{ inputs.maven-version }}'
|
||||
- run: echo "::endgroup::"
|
||||
shell: bash
|
||||
|
||||
- run: echo "::group::Prepare Maven settings.xml"
|
||||
shell: bash
|
||||
- uses: s4u/maven-settings-action@v2.4.1
|
||||
- uses: s4u/maven-settings-action@894661b3ddae382f1ae8edbeab60987e08cf0788 # v4.0.0
|
||||
with:
|
||||
servers: '${{ inputs.settings-servers}}'
|
||||
mirrors: '${{ inputs.settings-mirrors}}'
|
||||
properties: '${{ inputs.settings-properties}}'
|
||||
sonatypeSnapshots: '${{ inputs.settings-sonatypeSnapshots}}'
|
||||
- run: echo "::endgroup::"
|
||||
shell: bash
|
||||
servers: '${{ inputs.settings-servers }}'
|
||||
mirrors: '${{ inputs.settings-mirrors }}'
|
||||
properties: '${{ inputs.settings-properties }}'
|
||||
sonatypeSnapshots: '${{ inputs.settings-sonatypeSnapshots }}'
|
||||
proxies: '${{ inputs.settings-proxies }}'
|
||||
repositories: '${{ inputs.settings-repositories }}'
|
||||
pluginRepositories: '${{ inputs.settings-pluginRepositories }}'
|
||||
githubServer: '${{ inputs.settings-githubServer }}'
|
||||
path: '${{ inputs.settings-path }}'
|
||||
|
||||
34
pom.xml
34
pom.xml
@ -36,7 +36,6 @@
|
||||
<properties>
|
||||
<require.maven/>
|
||||
<require.java/>
|
||||
<_require.java/>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
@ -44,11 +43,10 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
<version>3.0.0-M3</version>
|
||||
<version>3.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>display-info</goal>
|
||||
<goal>enforce</goal>
|
||||
</goals>
|
||||
<phase>validate</phase>
|
||||
@ -57,7 +55,7 @@
|
||||
<configuration>
|
||||
<rules>
|
||||
<requireJavaVersion>
|
||||
<version>${_require.java}</version>
|
||||
<version>${require.java}</version>
|
||||
</requireJavaVersion>
|
||||
<requireMavenVersion>
|
||||
<version>[${require.maven}]</version>
|
||||
@ -67,32 +65,4 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>java8-version-label</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>require.java</name>
|
||||
<value>8</value>
|
||||
</property>
|
||||
</activation>
|
||||
<properties>
|
||||
<_require.java>1.8</_require.java>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>non-java8-version-label</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>require.java</name>
|
||||
<value>!8</value>
|
||||
</property>
|
||||
</activation>
|
||||
<properties>
|
||||
<_require.java>${require.java}</_require.java>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user