on: [push]
jobs:
  build-maven:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - id: setup-java8
        uses: actions/setup-java@v2
        with:
            distribution: 'temurin'
            java-version: '8'
            cache: maven
      - shell: bash
        run: |
            mkdir -p $HOME/.m2 \
            && cat << EOF > $HOME/.m2/toolchains.xml
            <?xml version="1.0" encoding="UTF8"?>
                <toolchains>
                    <toolchain>
                        <type>jdk</type>
                        <provides>
                            <version>8</version>
                            <vendor>temurin</vendor>
                        </provides>
                        <configuration>
                            <jdkHome>${{ steps.setup-java8.outputs.path }}</jdkHome>
                        </configuration>
                    </toolchain>
                </toolchains>
            EOF
      - run: mvn --batch-mode --update-snapshots verify

on: [push]
jobs:
  build-maven:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - id: setup-java8
        uses: actions/setup-java@v2
        with:
            distribution: 'temurin'
            java-version: '8'
            cache: maven
      - shell: bash
        run: |
            mkdir -p $HOME/.m2 \
            && cat << EOF > $HOME/.m2/toolchains.xml
            <?xml version="1.0" encoding="UTF8"?>
                <toolchains>
                    <toolchain>
                        <type>jdk</type>
                        <provides>
                            <version>1.8</version>
                            <vendor>temurin</vendor>
                        </provides>
                        <configuration>
                            <jdkHome>${{ steps.setup-java8.outputs.path }}</jdkHome>
                        </configuration>
                    </toolchain>
                </toolchains>
            EOF
      - run: mvn --batch-mode --update-snapshots verify

Correct toolchain in GitHub action
Correct toolchain in GitHub action
