From 792a3457ff179cfb2d5f027a1d8e62c2e35205f2 Mon Sep 17 00:00:00 2001 From: Alexander Schwartz Date: Mon, 3 Jun 2024 15:45:39 +0200 Subject: [PATCH] Use Maven wrapper instead of platform dependent Maven version (#29988) Closes #29987 Signed-off-by: Alexander Schwartz --- get-version.sh | 2 +- misc/scripts/dependency-report.sh | 2 +- operator/scripts/olm-testing.sh | 2 +- set-version.sh | 4 ++-- testsuite/model/test-all-profiles.sh | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/get-version.sh b/get-version.sh index 89d3a88a67..ca1d1bd95f 100755 --- a/get-version.sh +++ b/get-version.sh @@ -1,3 +1,3 @@ #!/bin/bash -e -mvn help:evaluate -Dexpression=project.version -q -DforceStdout -pl . +./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout -pl . diff --git a/misc/scripts/dependency-report.sh b/misc/scripts/dependency-report.sh index 12e87899e6..ae19dae2be 100755 --- a/misc/scripts/dependency-report.sh +++ b/misc/scripts/dependency-report.sh @@ -10,7 +10,7 @@ if [ "$DEP" == "" ]; then exit 1 fi -mvn -q dependency:tree -Dincludes=$DEP -DoutputFile=$TMP -DappendOutput=true -Poperator +./mvnw -q dependency:tree -Dincludes=$DEP -DoutputFile=$TMP -DappendOutput=true -Poperator echo "" echo "===================================================================================================" diff --git a/operator/scripts/olm-testing.sh b/operator/scripts/olm-testing.sh index fc952154c0..4e7e7e737f 100755 --- a/operator/scripts/olm-testing.sh +++ b/operator/scripts/olm-testing.sh @@ -23,7 +23,7 @@ VERSION="86400000.0.0" # Build the operator Docker image ( cd $SCRIPT_DIR/../../ - mvn clean package -Poperator -pl :keycloak-operator -am \ + ./mvnw clean package -Poperator -pl :keycloak-operator -am \ -Dquarkus.container-image.build=true \ -Dquarkus.container-image.image="ttl.sh/${UUID}keycloak-operator:${VERSION}" \ -Dkc.operator.keycloak.image="ttl.sh/${UUID}keycloak:${VERSION}" \ diff --git a/set-version.sh b/set-version.sh index d4fc34fe51..ebeb931fc1 100755 --- a/set-version.sh +++ b/set-version.sh @@ -10,8 +10,8 @@ else fi # Maven -mvn versions:set -DnewVersion=$NEW_VERSION -DgenerateBackupPoms=false -DgroupId=org.keycloak* -DartifactId=* -mvn versions:set-property --non-recursive -Dproperty=project.version.npm -DnewVersion="$NEW_NPM_VERSION" +./mvnw versions:set -DnewVersion=$NEW_VERSION -DgenerateBackupPoms=false -DgroupId=org.keycloak* -DartifactId=* +./mvnw versions:set-property --non-recursive -Dproperty=project.version.npm -DnewVersion="$NEW_NPM_VERSION" # Docker sed -i "s/ENV KEYCLOAK_VERSION .*/ENV KEYCLOAK_VERSION $NEW_VERSION/" quarkus/container/Dockerfile diff --git a/testsuite/model/test-all-profiles.sh b/testsuite/model/test-all-profiles.sh index 5d21c6ad2f..69932868df 100755 --- a/testsuite/model/test-all-profiles.sh +++ b/testsuite/model/test-all-profiles.sh @@ -7,15 +7,15 @@ ## cd "$(dirname $0)" -mvn -version +../../mvnw -version EXIT_CODE=0 -mvn clean -for I in `perl -ne 'print "$1\n" if (m,([^.<]+),)' pom.xml`; do +../../mvnw clean +for I in `perl -ne 'print "$1\n" if (m,([^.<]+),)' pom.xml | grep -E -v '(report|copy-testsuite-providers-to-model-testsuite)'`; do echo "========" echo "======== Start of Profile $I" echo "========" - mvn -B -Dsurefire.timeout=900 test "-P$I" "$@" 2>&1 | tee /tmp/surefire.out + ../../mvnw -B -Dsurefire.timeout=900 test "-P$I" "$@" 2>&1 | tee /tmp/surefire.out EXIT_CODE=$[$EXIT_CODE + ${PIPESTATUS[0]}] mv target/surefire-reports "target/surefire-reports-$I" perl -ne "print '::error::| $I | Timed out.' . \"\n\" if (/There was a timeout in the fork/)" /tmp/surefire.out @@ -25,7 +25,7 @@ for I in `perl -ne 'print "$1\n" if (m,([^.<]+),)' pom.xml`; do done ## If the jacoco file is present, generate reports in each of the model projects -[ -f target/jacoco.exec ] && mvn -f ../../model org.jacoco:jacoco-maven-plugin:0.8.7:report -Djacoco.dataFile="$(readlink -f target/jacoco.exec)" +[ -f target/jacoco.exec ] && ../../mvnw -f ../../model org.jacoco:jacoco-maven-plugin:0.8.7:report -Djacoco.dataFile="$(readlink -f target/jacoco.exec)" for I in `perl -ne 'print "$1\n" if (m,([^<]+),)' pom.xml`; do grep -A 1 --no-filename '<<<' "target/surefire-reports-$I"/*.txt | perl -pe "print '::error::| $I | ';"