I have written this workflow below to verify the Java format in my project according to Google Java style guides. My intention is to use maven in the workflow.
# Checks that the code is formatted according to the
# Google Java style guide
name: Code Formatter Check
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
distribution: 'adopt'
cache: maven
- name: Build with maven
run: mvn --batch-mode --update-snapshots verify verifyGoogleJavaFormat
With gradle I would have make it executable with chmod +x gradlew and run with ./gradlew verifyGoogleJavaFormat.
My question is how can I achieve this with maven. With above workflow I get the following error:
Unknown lifecycle phase "verifyGoogleJavaFormat".