diff --git a/BUILDING.txt b/BUILDING.txt index 875bf3e097..346dc144bb 100644 --- a/BUILDING.txt +++ b/BUILDING.txt @@ -8,7 +8,6 @@ Requirements: * JDK 1.8+ * Maven 3.1 or later -* Findbugs 2.0.2 or later (if running findbugs) * ProtocolBuffer 2.5.0 * Internet connection for first build (to fetch all dependencies) * Hadoop version should be 2.7.0 or higher. @@ -36,7 +35,7 @@ Maven build goals: * Compile : mvn compile * Run tests : mvn test * Create JAR : mvn package - * Run findbugs : mvn compile findbugs:findbugs + * Run spotsbugs : mvn compile spotbugs:spotsbugs * Run checkstyle : mvn compile checkstyle:checkstyle * Install JAR in M2 cache : mvn install * Deploy JAR to Maven repo : mvn deploy diff --git a/build-tools/docker/Dockerfile b/build-tools/docker/Dockerfile index f51cc3bd2b..8e63d09b9f 100644 --- a/build-tools/docker/Dockerfile +++ b/build-tools/docker/Dockerfile @@ -185,15 +185,6 @@ RUN apt-get -q update && apt-get -q install --no-install-recommends -y default-j && ln -s java-8-openjdk-amd64 /usr/lib/jvm/default-java ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 -###### -# Install findbugs -###### -# hadolint ignore=DL3008 -RUN apt-get -q update && apt-get -q install --no-install-recommends -y findbugs \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* -ENV FINDBUGS_HOME /usr - ###### # Install maven ###### diff --git a/build-tools/test-patch.sh b/build-tools/test-patch.sh index 9b457af221..08ce896de3 100755 --- a/build-tools/test-patch.sh +++ b/build-tools/test-patch.sh @@ -40,7 +40,6 @@ DIFF=${DIFF:-diff} JIRACLI=${JIRA:-jira} SED=${SED:-sed} CURL=${CURL:-curl} -FINDBUGS_HOME=${FINDBUGS_HOME} ############################################################################### printUsage() { @@ -60,7 +59,7 @@ printUsage() { echo "--grep-cmd= The 'grep' command to use (default 'grep')" echo "--patch-cmd= The 'patch' command to use (default 'patch')" echo "--diff-cmd= The 'diff' command to use (default 'diff')" - echo "--findbugs-home= Findbugs home directory (default FINDBUGS_HOME environment variable)" + echo "--spotbugs-home= SpotsBugs home directory (default SPOTBUGS_HOME environment variable)" echo "--dirty-workspace Allow the local git workspace to have uncommitted changes" echo "--run-tests Run all tests below the base directory" echo @@ -115,8 +114,8 @@ parseArgs() { --jira-password=*) JIRA_PASSWD=${i#*=} ;; - --findbugs-home=*) - FINDBUGS_HOME=${i#*=} + --spotbugs-home=*) + SPOTBUGS_HOME=${i#*=} ;; --dirty-workspace) DIRTY_WORKSPACE=true @@ -507,7 +506,7 @@ $JIRA_COMMENT_FOOTER" ############################################################################### -### Install the new jars so tests and findbugs can find all of the updated jars +### Install the new jars so tests and SpotsBugs can find all of the updated jars buildAndInstall () { echo "" echo "" @@ -525,67 +524,67 @@ buildAndInstall () { ############################################################################### -### Check there are no changes in the number of Findbugs warnings -checkFindbugsWarnings () { +### Check there are no changes in the number of SpotBugs warnings +checkSpotBugsWarnings () { echo "" echo "" echo "======================================================================" echo "======================================================================" - echo " Determining number of patched Findbugs warnings." + echo " Determining number of patched SpotBugs warnings." echo "======================================================================" echo "======================================================================" echo "" echo "" rc=0 - echo " Running findbugs " - echo "$MVN clean test findbugs:findbugs -DskipTests < /dev/null > $PATCH_DIR/patchFindBugsOutput.txt 2>&1" - $MVN clean test findbugs:findbugs -DskipTests < /dev/null > $PATCH_DIR/patchFindBugsOutput.txt 2>&1 + echo " Running SpotBugs " + echo "$MVN clean test spotbugs:spotbugs -DskipTests < /dev/null > $PATCH_DIR/patchSpotBugsOutput.txt 2>&1" + $MVN clean test spotbugs:spotbugs -DskipTests < /dev/null > $PATCH_DIR/patchSpotBugsOutput.txt 2>&1 rc=$? - findbugs_version=$(${AWK} 'match($0, /findbugs-maven-plugin:[^:]*:findbugs/) { print substr($0, RSTART + 22, RLENGTH - 31); exit }' "${PATCH_DIR}/patchFindBugsOutput.txt") + spotbugs_version=$(${AWK} 'match($0, /spotbugs-maven-plugin:[^:]*:spotbugs/) { print substr($0, RSTART + 22, RLENGTH - 31); exit }' "${PATCH_DIR}/patchSpotBugsOutput.txt") if [ $rc != 0 ] ; then JIRA_COMMENT="$JIRA_COMMENT - {color:red}-1 findbugs{color}. The patch appears to cause Findbugs (version ${findbugs_version}) to fail." + {color:red}-1 spotbugs{color}. The patch appears to cause SpotsBugs (version ${spotbugs_version}) to fail." return 1 fi - findbugsWarnings=0 - for file in $(find $BASEDIR -name findbugsXml.xml) + spotbugsWarnings=0 + for file in $(find $BASEDIR -name spotbugsXml.xml) do relative_file=${file#$BASEDIR/} # strip leading $BASEDIR prefix - if [ ! $relative_file == "target/findbugsXml.xml" ]; then - module_suffix=${relative_file%/target/findbugsXml.xml} # strip trailing path + if [ ! $relative_file == "target/spotbugsXml.xml" ]; then + module_suffix=${relative_file%/target/spotbugsXml.xml} # strip trailing path module_suffix=`basename ${module_suffix}` fi - cp $file $PATCH_DIR/patchFindbugsWarnings${module_suffix}.xml - $FINDBUGS_HOME/bin/setBugDatabaseInfo -timestamp "01/01/2000" \ - $PATCH_DIR/patchFindbugsWarnings${module_suffix}.xml \ - $PATCH_DIR/patchFindbugsWarnings${module_suffix}.xml - newFindbugsWarnings=`$FINDBUGS_HOME/bin/filterBugs -first "01/01/2000" $PATCH_DIR/patchFindbugsWarnings${module_suffix}.xml \ - $PATCH_DIR/newPatchFindbugsWarnings${module_suffix}.xml | $AWK '{print $1}'` - echo "Found $newFindbugsWarnings Findbugs warnings ($file)" - findbugsWarnings=$((findbugsWarnings+newFindbugsWarnings)) - $FINDBUGS_HOME/bin/convertXmlToText -html \ - $PATCH_DIR/newPatchFindbugsWarnings${module_suffix}.xml \ - $PATCH_DIR/newPatchFindbugsWarnings${module_suffix}.html - if [[ $newFindbugsWarnings > 0 ]] ; then - JIRA_COMMENT_FOOTER="Findbugs warnings: $BUILD_URL/artifact/patchprocess/newPatchFindbugsWarnings${module_suffix}.html + cp $file $PATCH_DIR/patchSpotbugsWarnings${module_suffix}.xml + $SPOTBUGS_HOME/bin/setBugDatabaseInfo -timestamp "01/01/2000" \ + $PATCH_DIR/patchSpotbugsWarnings${module_suffix}.xml \ + $PATCH_DIR/patchSpotbugsWarnings${module_suffix}.xml + newSpotbugsWarnings=`$SPOTBUGS_HOME/bin/filterBugs -first "01/01/2000" $PATCH_DIR/patchSpotbugsWarnings${module_suffix}.xml \ + $PATCH_DIR/newPatchSpotbugsWarnings${module_suffix}.xml | $AWK '{print $1}'` + echo "Found $newSpotbugsWarnings SpotBugs warnings ($file)" + spotbugsWarnings=$((spotbugsWarnings+newSpotbugsWarnings)) + $SPOTBUGS_HOME/bin/convertXmlToText -html \ + $PATCH_DIR/newPatchSpotbugsWarnings${module_suffix}.xml \ + $PATCH_DIR/newPatchSpotbugsWarnings${module_suffix}.html + if [[ $newSpotbugsWarnings > 0 ]] ; then + JIRA_COMMENT_FOOTER="SpotBugs warnings: $BUILD_URL/artifact/patchprocess/newPatchSpotbugsWarnings${module_suffix}.html $JIRA_COMMENT_FOOTER" fi done - if [[ $findbugsWarnings -gt 0 ]] ; then + if [[ $spotbugsWarnings -gt 0 ]] ; then JIRA_COMMENT="$JIRA_COMMENT - {color:red}-1 findbugs{color}. The patch appears to introduce $findbugsWarnings new Findbugs (version ${findbugs_version}) warnings." + {color:red}-1 spotbugs{color}. The patch appears to introduce $spotbugsWarnings new SpotBugs (version ${spotbugs_version}) warnings." return 1 fi JIRA_COMMENT="$JIRA_COMMENT - {color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version ${findbugs_version}) warnings." + {color:green}+1 spotbugs{color}. The patch does not introduce any new SpotBugs (version ${spotbugs_version}) warnings." return 0 } @@ -805,7 +804,7 @@ fi checkJavadocWarnings (( RESULT = RESULT + $? )) buildAndInstall -checkFindbugsWarnings +checkSpotBugsWarnings (( RESULT = RESULT + $? )) checkReleaseAuditWarnings (( RESULT = RESULT + $? )) diff --git a/pom.xml b/pom.xml index 19fd5167cd..d5e468266b 100644 --- a/pom.xml +++ b/pom.xml @@ -67,8 +67,8 @@ ${env.PROTOC_PATH} scm:git:https://gitbox.apache.org/repos/asf/tez.git 1.4 - 3.0.5 - 3.1.1 + 4.1.4 + 3.1.1 8.35 1.3.6 ${project.build.directory}/tmp @@ -695,9 +695,17 @@ 1.3.4 - com.google.code.findbugs - jsr305 - 3.0.0 + com.github.spotbugs + spotbugs-annotations + ${spotbugs.version} + true + + + + net.jcip + jcip-annotations + 1.0 + true com.sun.jersey @@ -878,9 +886,13 @@ ${dependency-check-maven.version} - org.codehaus.mojo - findbugs-maven-plugin - ${findbugs-maven-plugin.version} + com.github.spotbugs + spotbugs-maven-plugin + ${spotbugs.version} + + ${project.basedir}/findbugs-exclude.xml + false + org.codehaus.mojo @@ -1002,11 +1014,8 @@ build-helper-maven-plugin - org.codehaus.mojo - findbugs-maven-plugin - - ${basedir}/findbugs-exclude.xml - + com.github.spotbugs + spotbugs-maven-plugin + target/site + ${project.basedir}/findbugs-exclude.xml diff --git a/tez-api/pom.xml b/tez-api/pom.xml index 95a7610ee4..c1d99591c6 100644 --- a/tez-api/pom.xml +++ b/tez-api/pom.xml @@ -81,10 +81,6 @@ junit junit - - com.google.code.findbugs - jsr305 - com.sun.jersey jersey-client diff --git a/tez-dag/pom.xml b/tez-dag/pom.xml index c0dccc8642..3748ae4368 100644 --- a/tez-dag/pom.xml +++ b/tez-dag/pom.xml @@ -107,11 +107,6 @@ commons-cli commons-cli - - com.google.code.findbugs - jsr305 - compile - org.apache.commons commons-collections4 diff --git a/tez-runtime-internals/pom.xml b/tez-runtime-internals/pom.xml index 8fe7d79e40..dee6795b87 100644 --- a/tez-runtime-internals/pom.xml +++ b/tez-runtime-internals/pom.xml @@ -65,10 +65,6 @@ junit junit - - com.google.code.findbugs - jsr305 - org.mockito mockito-all