diff --git a/hadoop-ozone/dev-support/checks/findbugs.sh b/hadoop-ozone/dev-support/checks/findbugs.sh
index eaf8ec569d12..a665e359b891 100755
--- a/hadoop-ozone/dev-support/checks/findbugs.sh
+++ b/hadoop-ozone/dev-support/checks/findbugs.sh
@@ -20,12 +20,13 @@ MAVEN_OPTIONS='-B -fae -Dskip.npx -Dskip.installnpx'
if ! type unionBugs >/dev/null 2>&1 || ! type convertXmlToText >/dev/null 2>&1; then
#shellcheck disable=SC2086
- mvn ${MAVEN_OPTIONS} compile spotbugs:check
+ mvn ${MAVEN_OPTIONS} test-compile spotbugs:check
exit $?
fi
#shellcheck disable=SC2086
-mvn ${MAVEN_OPTIONS} compile spotbugs:spotbugs
+mvn ${MAVEN_OPTIONS} test-compile spotbugs:spotbugs
+rc=$?
REPORT_DIR=${OUTPUT_DIR:-"$DIR/../../../target/findbugs"}
mkdir -p "$REPORT_DIR"
@@ -42,3 +43,5 @@ wc -l "$REPORT_FILE" | awk '{print $1}'> "$REPORT_DIR/failures"
if [[ -s "${REPORT_FILE}" ]]; then
exit 1
fi
+
+exit ${rc}
diff --git a/hadoop-ozone/interface-storage/dev-support/findbugsExcludeFile.xml b/hadoop-ozone/interface-storage/dev-support/findbugsExcludeFile.xml
new file mode 100644
index 000000000000..9492f9c5d481
--- /dev/null
+++ b/hadoop-ozone/interface-storage/dev-support/findbugsExcludeFile.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
diff --git a/hadoop-ozone/interface-storage/pom.xml b/hadoop-ozone/interface-storage/pom.xml
index 9f000bf8a7a1..5c9ae432baad 100644
--- a/hadoop-ozone/interface-storage/pom.xml
+++ b/hadoop-ozone/interface-storage/pom.xml
@@ -91,6 +91,13 @@
+
+ com.github.spotbugs
+ spotbugs-maven-plugin
+
+ ${basedir}/dev-support/findbugsExcludeFile.xml
+
+
-
\ No newline at end of file
+