From e949a8e354316da194e6a0496e7c315ca812c9a4 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 26 Jul 2024 11:27:25 +0200 Subject: [PATCH] Fix maven/simple-project verification script After updating maven-pmd-plugin to 3.24.0, the messages slightly changed. No summary is printed anymore, only each violation is given (if any). --- maven/simple-project/.ci/build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/maven/simple-project/.ci/build.sh b/maven/simple-project/.ci/build.sh index bbd05dd..4099f5a 100755 --- a/maven/simple-project/.ci/build.sh +++ b/maven/simple-project/.ci/build.sh @@ -7,6 +7,10 @@ set -e echo echo "Verifying build.log..." -grep "You have 2 PMD violations" build.log || (echo -e "\n\n\x1b[31mMissing expected rule violation\e[0m"; exit 1) +failure_count=$(grep --count "PMD Failure" build.log) +if [[ $failure_count -ne 2 ]]; then + echo -e "\n\n\x1b[31mMissing expected rule violations\e[0m" + exit 1 +fi echo -e "\n\n\x1b[32mTest successful\e[0m"