-
Notifications
You must be signed in to change notification settings - Fork 215
43 lines (37 loc) · 1.16 KB
/
maven.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
paths-ignore:
- '.github/workflows/*.yml'
- '!.github/workflows/maven.yml'
pull_request:
paths-ignore:
- '.github/workflows/*.yml'
- '!.github/workflows/maven.yml'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11', '17', '21' ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.Java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.Java }}
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn --batch-mode --errors --fail-at-end --show-version --update-snapshots verify
- name: Store artifact
if: ${{ matrix.Java == 11 }}
uses: actions/upload-artifact@v4
with:
name: jar-jdk${{ matrix.Java }}
path: target/*.jar
retention-days: 7