From 89331f42d03e6f99071c770f96358585d075cd78 Mon Sep 17 00:00:00 2001 From: Christine Baumann Date: Tue, 23 Apr 2024 12:13:34 +0200 Subject: [PATCH] fix: adjust workflow file to use Java 11 for compilation, tests, etc, and use Java 17 for running sonar scan --- .github/workflows/maven.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c61fddd9..f6a899ca 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -15,12 +15,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' + - uses: actions/checkout@v4 + + - name: Set up Java Env + uses: actions/setup-java@v4 + with: # The last version will be used by default and available globally via JAVA_HOME. + java-version: | + 17 + 11 distribution: 'temurin' cache: maven @@ -38,11 +40,14 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: Build with Maven + - name: Build and Test with Maven + env: + JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }} run: mvn clean install javadoc:javadoc - - name: Build and analyze + - name: Analyze with SonarQube env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=aecu + JAVA_HOME: ${{ env.JAVA_HOME_17_X64 }} + run: mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=aecu