diff --git a/hadoop-ozone/dev-support/checks/checkstyle.sh b/hadoop-ozone/dev-support/checks/checkstyle.sh index ee11e389ee095..7a218a410c55e 100755 --- a/hadoop-ozone/dev-support/checks/checkstyle.sh +++ b/hadoop-ozone/dev-support/checks/checkstyle.sh @@ -16,6 +16,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" cd "$DIR/../../.." || exit 1 +BASE_DIR="$(pwd -P)" REPORT_DIR=${OUTPUT_DIR:-"$DIR/../../../target/checkstyle"} mkdir -p "$REPORT_DIR" REPORT_FILE="$REPORT_DIR/summary.txt" @@ -23,7 +24,16 @@ REPORT_FILE="$REPORT_DIR/summary.txt" mvn -B -fn checkstyle:check -f pom.ozone.xml #Print out the exact violations with parsing XML results with sed -find "." -name checkstyle-errors.xml -print0 | xargs -0 sed '$!N; //d' | tee "$REPORT_FILE" +find "." -name checkstyle-errors.xml -print0 \ + | xargs -0 sed '$!N; //d' \ + -e '/ "$REPORT_DIR/failures"