You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Setup Maven Action
v1.3.1
This is composite action which help to prepare GitHub Actions environment for Maven build by calling:
- 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
This project uses Semantic Versioning. We recommended to use 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.
params | destination |
---|---|
checkout-fetch-depth | fetch-depth |
params | destination | default |
---|---|---|
java-version | java-version | |
java-distribution | distribution | temurin |
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-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 |
params | destination | default |
---|---|---|
maven-version | maven-version | 3.8.3 |
params | destination |
---|---|
settings-servers | servers |
settings-mirrors | mirrors |
settings-properties | properties |
settings-sonatypeSnapshots | sonatypeSnapshots |
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
maven: [ '3.5.4', '3.6.3', '3.8.2' ]
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 ...
The scripts and documentation in this project are released under the MIT License