mirror of
https://github.com/s4u/setup-maven-action.git
synced 2026-02-12 00:05:30 +08:00
f4785d5b29e2e0e768cd24b4cb114ac50f85fdb1
Some checks failed
Release Drafter / Update Release Draft (push) Failing after 1s
Test / Test (11, 3.9.9, ubuntu-latest) (push) Failing after 4m32s
Test / Test (17, 3.8.8, ubuntu-latest) (push) Failing after 4m28s
Test / Test (17, 3.9.9, ubuntu-latest) (push) Failing after 4m53s
Test / Test (11, 3.8.8, ubuntu-latest) (push) Failing after 5m1s
Test / Test (8, 3.9.9, ubuntu-latest) (push) Failing after 1m34s
Test / Test (21, 3.9.9, ubuntu-latest) (push) Failing after 2m50s
Test / Test (8, 3.8.8, ubuntu-latest) (push) Failing after 2m48s
Test / Test (21, 3.8.8, ubuntu-latest) (push) Failing after 3m57s
Test / Test with defaults (push) Failing after 2m31s
Test / Test (11, 3.8.8, macOS-latest) (push) Has been cancelled
Test / Test (11, 3.8.8, windows-latest) (push) Has been cancelled
Test / Test (11, 3.9.9, macOS-latest) (push) Has been cancelled
Test / Test (11, 3.9.9, windows-latest) (push) Has been cancelled
Test / Test (17, 3.8.8, macOS-latest) (push) Has been cancelled
Test / Test (17, 3.8.8, windows-latest) (push) Has been cancelled
Test / Test (17, 3.9.9, macOS-latest) (push) Has been cancelled
Test / Test (17, 3.9.9, windows-latest) (push) Has been cancelled
Test / Test (21, 3.8.8, macOS-latest) (push) Has been cancelled
Test / Test (21, 3.8.8, windows-latest) (push) Has been cancelled
Test / Test (21, 3.9.9, macOS-latest) (push) Has been cancelled
Test / Test (21, 3.9.9, windows-latest) (push) Has been cancelled
Test / Test (8, 3.8.8, macOS-latest) (push) Has been cancelled
Test / Test (8, 3.8.8, windows-latest) (push) Has been cancelled
Test / Test (8, 3.9.9, macOS-latest) (push) Has been cancelled
Test / Test (8, 3.9.9, windows-latest) (push) Has been cancelled
Test / Test OK (push) Has been cancelled
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4.4.0 to 4.5.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](b36c23c0d9...8df1039502)
---
updated-dependencies:
- dependency-name: actions/setup-java
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Setup Maven Action
This is composite action which help to prepare GitHub Actions environment for Maven build by calling:
❗ You should not include above actions in your configuration - in other case those will be called twice. ❗
For default values you only need:
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 | 17 |
| java-distribution | distribution | zulu |
cache
A cache action is configured as:
- 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.9.9 |
maven-settings-action
| params | destination |
|---|---|
| settings-servers | servers |
| settings-mirrors | mirrors |
| settings-properties | properties |
| settings-sonatypeSnapshots | sonatypeSnapshots |
| settings-proxies | proxies |
| settings-repositories | repositories |
Testing against different Maven versions
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
maven: [ '3.8.8', '3.9.8' ]
name: Maven ${{ matrix.maven }} sample
steps:
- 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 ⭐ - 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. 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.
License
The scripts and documentation in this project are released under the MIT License