Skip to content

GitHub Action to build Maven projects with different Java JDK versions.

License

Notifications You must be signed in to change notification settings

offa/maven-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

maven-action

ci GitHub release License

GitHub Action for Maven based projects.

It checks out the repository, sets up Java, runs Maven and optional analysis.

Example

Minimal example:

- uses: offa/maven-action@main
  with:
    java-version: '21'

Builds JDK 17 and 21 and executes a PMD analysis:

# […]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        java: [ 17, 21 ]
    name: jdk-${{ matrix.java }}
    steps:
      - name: Build
        uses: offa/maven-action@main
        with:
          java-version: ${{ matrix.java }}
          pmd: true

Usage

java-version is required, all other settings are optional with defaults

- uses: offa/maven-action@main
  with:
    # Java version to use (required) - whole or semver Java version
    java-version: # Required

    # Path to pom.xml file or directory containing one
    pom: 'pom.xml'

    # Maven goal to execute
    goal: 'verify'

    # Execute PMD goal (runs after 'goal')
    pmd: false

    # Skips JavaDoc generation
    skip-javadoc: true