Skip to content

Get required java version from maven project when running github actions #158

@kappsegla

Description

@kappsegla

When compiling code and running tests in github actions, java version has to be specified and changed when a new version arrives. Instead of having to change java version each time manually we can configure our actions to read java version from our maven config.
- name: Get required JDK version from Maven project run: | JDK_VERSION=$(mvn help:evaluate -Dexpression=maven.compiler.release -q -DforceStdout) echo "JDK_VERSION=$JDK_VERSION" >> $GITHUB_ENV - name: Set up JDK uses: actions/setup-java@v2 with: java-version: ${{ env.JDK_VERSION }} distribution: microsoft
https://github.com/brunoborges/aks-jvm-benchmark/blob/main/.github/workflows/maven.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions