From 9bf7a6e5b26a361fd08552793852208d817fdfbd Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Tue, 24 Sep 2019 09:23:48 +0200 Subject: [PATCH] HDDS-2149. Replace findbugs with spotbugs Signed-off-by: Anu Engineer --- hadoop-hdds/common/pom.xml | 4 +-- hadoop-hdds/container-service/pom.xml | 9 +++---- hadoop-hdds/pom.xml | 15 ----------- hadoop-hdds/server-scm/pom.xml | 4 +-- hadoop-ozone/common/pom.xml | 4 +-- hadoop-ozone/csi/pom.xml | 4 +-- hadoop-ozone/dev-support/checks/findbugs.sh | 12 ++++++--- hadoop-ozone/insight/pom.xml | 9 +++---- hadoop-ozone/ozone-manager/pom.xml | 5 ++-- hadoop-ozone/ozonefs-lib-current/pom.xml | 4 +-- hadoop-ozone/ozonefs-lib-legacy/pom.xml | 4 +-- hadoop-ozone/ozonefs/pom.xml | 5 ++-- hadoop-ozone/pom.xml | 8 ------ hadoop-ozone/recon/pom.xml | 4 +-- hadoop-ozone/s3gateway/pom.xml | 5 ++-- hadoop-ozone/tools/pom.xml | 9 +++---- hadoop-ozone/upgrade/pom.xml | 5 ++-- pom.ozone.xml | 29 ++++++++++----------- 18 files changed, 57 insertions(+), 82 deletions(-) diff --git a/hadoop-hdds/common/pom.xml b/hadoop-hdds/common/pom.xml index 2a6d44a2a4..9af807f8b9 100644 --- a/hadoop-hdds/common/pom.xml +++ b/hadoop-hdds/common/pom.xml @@ -274,8 +274,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> - org.codehaus.mojo - findbugs-maven-plugin + com.github.spotbugs + spotbugs-maven-plugin ${basedir}/dev-support/findbugsExcludeFile.xml diff --git a/hadoop-hdds/container-service/pom.xml b/hadoop-hdds/container-service/pom.xml index 2f89fa23f3..0eef961733 100644 --- a/hadoop-hdds/container-service/pom.xml +++ b/hadoop-hdds/container-service/pom.xml @@ -55,9 +55,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> 1.16 - com.google.code.findbugs - findbugs - 3.0.1 + com.github.spotbugs + spotbugs provided @@ -93,8 +92,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> - org.codehaus.mojo - findbugs-maven-plugin + com.github.spotbugs + spotbugs-maven-plugin ${basedir}/dev-support/findbugsExcludeFile.xml diff --git a/hadoop-hdds/pom.xml b/hadoop-hdds/pom.xml index 5c98e38e87..a1efb5b071 100644 --- a/hadoop-hdds/pom.xml +++ b/hadoop-hdds/pom.xml @@ -195,13 +195,6 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> ${junit.jupiter.version} test - - - com.google.code.findbugs - findbugs - 3.0.1 - provided - @@ -307,14 +300,6 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> - - org.codehaus.mojo - findbugs-maven-plugin - 3.0.4 - - - - org.apache.maven.plugins maven-dependency-plugin diff --git a/hadoop-hdds/server-scm/pom.xml b/hadoop-hdds/server-scm/pom.xml index 99d5922387..68a5cd8061 100644 --- a/hadoop-hdds/server-scm/pom.xml +++ b/hadoop-hdds/server-scm/pom.xml @@ -101,8 +101,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> bcprov-jdk15on - com.google.code.findbugs - findbugs + com.github.spotbugs + spotbugs provided diff --git a/hadoop-ozone/common/pom.xml b/hadoop-ozone/common/pom.xml index 9cbee561de..09ac27ad60 100644 --- a/hadoop-ozone/common/pom.xml +++ b/hadoop-ozone/common/pom.xml @@ -154,8 +154,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> - org.codehaus.mojo - findbugs-maven-plugin + com.github.spotbugs + spotbugs-maven-plugin ${basedir}/dev-support/findbugsExcludeFile.xml diff --git a/hadoop-ozone/csi/pom.xml b/hadoop-ozone/csi/pom.xml index fb04d8c495..6e7b807e36 100644 --- a/hadoop-ozone/csi/pom.xml +++ b/hadoop-ozone/csi/pom.xml @@ -176,8 +176,8 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> - org.codehaus.mojo - findbugs-maven-plugin + com.github.spotbugs + spotbugs-maven-plugin ${basedir}/dev-support/findbugsExcludeFile.xml diff --git a/hadoop-ozone/dev-support/checks/findbugs.sh b/hadoop-ozone/dev-support/checks/findbugs.sh index 3108bdd056..ccbf2ed678 100755 --- a/hadoop-ozone/dev-support/checks/findbugs.sh +++ b/hadoop-ozone/dev-support/checks/findbugs.sh @@ -16,7 +16,12 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" cd "$DIR/../../.." || exit 1 -mvn -B compile -fn findbugs:check -Dfindbugs.failOnError=false -f pom.ozone.xml +if ! type unionBugs >/dev/null 2>&1 || ! type convertXmlToText >/dev/null 2>&1; then + mvn -B -fae compile spotbugs:check -f pom.ozone.xml + exit $? +fi + +mvn -B -fae compile spotbugs:spotbugs -f pom.ozone.xml REPORT_DIR=${OUTPUT_DIR:-"$DIR/../../../target/findbugs"} mkdir -p "$REPORT_DIR" @@ -24,8 +29,9 @@ REPORT_FILE="$REPORT_DIR/summary.txt" touch "$REPORT_FILE" -find hadoop-ozone -name findbugsXml.xml -print0 | xargs -0 -n1 convertXmlToText | tee -a "${REPORT_FILE}" -find hadoop-hdds -name findbugsXml.xml -print0 | xargs -0 -n1 convertXmlToText | tee -a "${REPORT_FILE}" +find hadoop-hdds hadoop-ozone -name spotbugsXml.xml -print0 | xargs -0 unionBugs -output "${REPORT_DIR}"/summary.xml +convertXmlToText "${REPORT_DIR}"/summary.xml | tee -a "${REPORT_FILE}" +convertXmlToText -html:fancy-hist.xsl "${REPORT_DIR}"/summary.xml "${REPORT_DIR}"/summary.html wc -l "$REPORT_FILE" | awk '{print $1}'> "$REPORT_DIR/failures" diff --git a/hadoop-ozone/insight/pom.xml b/hadoop-ozone/insight/pom.xml index 80b2f8fad5..8287334f6a 100644 --- a/hadoop-ozone/insight/pom.xml +++ b/hadoop-ozone/insight/pom.xml @@ -92,9 +92,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> 1.19 - com.google.code.findbugs - findbugs - 3.0.1 + com.github.spotbugs + spotbugs provided @@ -118,8 +117,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> - org.codehaus.mojo - findbugs-maven-plugin + com.github.spotbugs + spotbugs-maven-plugin ${basedir}/dev-support/findbugsExcludeFile.xml diff --git a/hadoop-ozone/ozone-manager/pom.xml b/hadoop-ozone/ozone-manager/pom.xml index fa68398b84..653209b0fa 100644 --- a/hadoop-ozone/ozone-manager/pom.xml +++ b/hadoop-ozone/ozone-manager/pom.xml @@ -57,9 +57,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> test - com.google.code.findbugs - findbugs - 3.0.1 + com.github.spotbugs + spotbugs provided diff --git a/hadoop-ozone/ozonefs-lib-current/pom.xml b/hadoop-ozone/ozonefs-lib-current/pom.xml index 9d77a780af..5953acb62e 100644 --- a/hadoop-ozone/ozonefs-lib-current/pom.xml +++ b/hadoop-ozone/ozonefs-lib-current/pom.xml @@ -58,8 +58,8 @@ - org.codehaus.mojo - findbugs-maven-plugin + com.github.spotbugs + spotbugs-maven-plugin true diff --git a/hadoop-ozone/ozonefs-lib-legacy/pom.xml b/hadoop-ozone/ozonefs-lib-legacy/pom.xml index fedd26b784..c2483088d8 100644 --- a/hadoop-ozone/ozonefs-lib-legacy/pom.xml +++ b/hadoop-ozone/ozonefs-lib-legacy/pom.xml @@ -120,8 +120,8 @@ - org.codehaus.mojo - findbugs-maven-plugin + com.github.spotbugs + spotbugs-maven-plugin true diff --git a/hadoop-ozone/ozonefs/pom.xml b/hadoop-ozone/ozonefs/pom.xml index a945f40a71..4f85070143 100644 --- a/hadoop-ozone/ozonefs/pom.xml +++ b/hadoop-ozone/ozonefs/pom.xml @@ -136,9 +136,8 @@ httpclient - com.google.code.findbugs - findbugs - 3.0.1 + com.github.spotbugs + spotbugs provided diff --git a/hadoop-ozone/pom.xml b/hadoop-ozone/pom.xml index b2d143e985..18a14228bb 100644 --- a/hadoop-ozone/pom.xml +++ b/hadoop-ozone/pom.xml @@ -296,14 +296,6 @@ - - org.codehaus.mojo - findbugs-maven-plugin - 3.0.4 - - - - org.apache.maven.plugins maven-dependency-plugin diff --git a/hadoop-ozone/recon/pom.xml b/hadoop-ozone/recon/pom.xml index 4eed4683f5..55318a543c 100644 --- a/hadoop-ozone/recon/pom.xml +++ b/hadoop-ozone/recon/pom.xml @@ -77,8 +77,8 @@ - org.codehaus.mojo - findbugs-maven-plugin + com.github.spotbugs + spotbugs-maven-plugin ${basedir}/dev-support/findbugsExcludeFile.xml diff --git a/hadoop-ozone/s3gateway/pom.xml b/hadoop-ozone/s3gateway/pom.xml index cbbba1f7fc..32c9587454 100644 --- a/hadoop-ozone/s3gateway/pom.xml +++ b/hadoop-ozone/s3gateway/pom.xml @@ -210,9 +210,8 @@ test - com.google.code.findbugs - findbugs - 3.0.1 + com.github.spotbugs + spotbugs provided diff --git a/hadoop-ozone/tools/pom.xml b/hadoop-ozone/tools/pom.xml index b4a6bc2873..d1ee9d590b 100644 --- a/hadoop-ozone/tools/pom.xml +++ b/hadoop-ozone/tools/pom.xml @@ -101,9 +101,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> 1.11.615 - com.google.code.findbugs - findbugs - 3.0.1 + com.github.spotbugs + spotbugs provided @@ -133,8 +132,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> - org.codehaus.mojo - findbugs-maven-plugin + com.github.spotbugs + spotbugs-maven-plugin ${basedir}/dev-support/findbugsExcludeFile.xml diff --git a/hadoop-ozone/upgrade/pom.xml b/hadoop-ozone/upgrade/pom.xml index 57211022f1..0a4bd7fc9a 100644 --- a/hadoop-ozone/upgrade/pom.xml +++ b/hadoop-ozone/upgrade/pom.xml @@ -34,9 +34,8 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd"> hadoop-hdds-common - com.google.code.findbugs - findbugs - 3.0.1 + com.github.spotbugs + spotbugs provided diff --git a/pom.ozone.xml b/pom.ozone.xml index 55c0205a41..f83c55c2c4 100644 --- a/pom.ozone.xml +++ b/pom.ozone.xml @@ -144,7 +144,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs 2.12.0 3.0.0 - 3.1.0-RC1 + 3.1.12 2.1.7 11.0.2 @@ -1210,6 +1210,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs hadoop-cloud-storage ${hadoop.version} + + com.github.spotbugs + spotbugs + ${spotbugs.version} + provided + com.google.code.findbugs jsr305 @@ -1571,16 +1577,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs ${maven-war-plugin.version} - org.codehaus.mojo - findbugs-maven-plugin - ${findbugs.version} - - - com.github.spotbugs - spotbugs - ${spotbugs.version} - - + com.github.spotbugs + spotbugs-maven-plugin + ${spotbugs.version} + + 1024 + true + org.codehaus.mojo @@ -1674,10 +1677,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs - - org.codehaus.mojo - findbugs-maven-plugin - org.apache.maven.plugins maven-remote-resources-plugin