From 4f46e9ecfaae2e408e88f4ec998a970d24c53894 Mon Sep 17 00:00:00 2001 From: spbolton Date: Mon, 25 Nov 2024 14:37:10 +0000 Subject: [PATCH] ci: Update legacy release workflow to use core cicd setup java (#30762) (#30764) ### Proposed Changes * Refactor legacy release workflow to use new core-cicd/setup-java action to consistently use the same java version accross workflows * Updated maven enforcer plugin to error if not using Java 21 minimum to build/compile --- .../legacy-release_maven-release-process.yml | 14 ++++---------- parent/pom.xml | 5 ++--- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/legacy-release_maven-release-process.yml b/.github/workflows/legacy-release_maven-release-process.yml index 2c25d6be4fba..9228455be52d 100644 --- a/.github/workflows/legacy-release_maven-release-process.yml +++ b/.github/workflows/legacy-release_maven-release-process.yml @@ -34,8 +34,6 @@ on: default: true required: false env: - JAVA_VERSION: 11 - JAVA_DISTRO: temurin JVM_TEST_MAVEN_OPTS: '-e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' DOCKER_BUILD_CONTEXT: /home/runner/work/_temp/core-build jobs: @@ -126,10 +124,8 @@ jobs: echo "release_commit=${release_commit}" >> $GITHUB_OUTPUT - name: Setup Java - uses: actions/setup-java@v4 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: ${{ env.JAVA_DISTRO }} + id: setup-java + uses: ./.github/actions/core-cicd/setup-java - name: Build Core run: | @@ -265,10 +261,8 @@ jobs: key: npm-${{ hashFiles('core-web/package-lock.json') }} - name: Setup Java - uses: actions/setup-java@v4 - with: - java-version: ${{ env.JAVA_VERSION }} - distribution: ${{ env.JAVA_DISTRO }} + id: setup-java + uses: ./.github/actions/core-cicd/setup-java - name: maven-settings-xml-action uses: whelk-io/maven-settings-xml-action@v20 diff --git a/parent/pom.xml b/parent/pom.xml index 09b32c10f298..9c4b314ab2c3 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -92,7 +92,7 @@ 1.2.3 -Xdoclint:none --allow-script-in-comments - ${maven.compiler.argument.source} + 21 ${maven.compiler.source} ${maven.compiler.target} ${maven.compiler.testSource} @@ -1049,8 +1049,7 @@ ${jdk.min.version} - To build this project JDK ${jdk.min.version} (or greater) is required. - Please install it. + Building this project requires JDK version ${jdk.min.version} or higher. It is recommended to use SDKMAN to manage JDK versions. Run "sdk env install" to install and activate the correct JDK version specified in the .sdkmanrc file.