Skip to content

Add maven wrapper

Add maven wrapper #118

Workflow file for this run

name: Maven Build and Deployment
on: [push, pull_request]
jobs:
build:
name: Java Latest LTS Build and Verify
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: maven
- name: Build with Maven
run: ./mvnw -B -V verify --no-transfer-progress
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3
compatibility-checks:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11, 17, 21, 22-ea]
name: Java ${{ matrix.java }} Compatibility
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: maven
- name: Test with Maven
run: ./mvnw -B -V test
compatibility-checks-java7-maven354:
runs-on: ubuntu-latest
strategy:
matrix:
java: [7]
name: Java ${{ matrix.java }} Compatibility with Maven 3.5.4
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: maven
- name: Load Maven 3.5.4
run: mvn -B -V io.takari:maven:0.5.0:wrapper -Dmaven=3.5.4 --no-transfer-progress
- name: Test with Maven
run: ./mvnw -B -V test
deploy:
name: Deploy to OSSRH
needs: [build, compatibility-checks]
if: github.event_name == 'push' && github.repository_owner == 'acegi' && ! contains(toJSON(github.event.head_commit.message), '[maven-release-plugin]')
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
cache: maven
- name: Set up Java and Maven
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.gpg_private_key }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish Maven package
run: ./mvnw -B -V -Possrh-deploy deploy --no-transfer-progress
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.gpg_passphrase }}
MAVEN_USERNAME: ${{ secrets.nexus_username }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.nexus_password }}