This is an automated email from the ASF dual-hosted git repository.
asalamon74 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/oozie.git
The following commit(s) were added to refs/heads/master by this push:
new 259046f OOZIE-3395 [build] Migration from FindBugs to SpotBugs
(kmarton via asalamon74)
259046f is described below
commit 259046fc090dcb6f96f2362daff647d57f3fbddd
Author: Andras Salamon <[email protected]>
AuthorDate: Fri Feb 22 11:43:08 2019 +0100
OOZIE-3395 [build] Migration from FindBugs to SpotBugs (kmarton via
asalamon74)
---
...1-findbugs-diff => test-patch-11-spotbugs-diff} | 155 +++++++++++----------
client/pom.xml | 9 +-
core/pom.xml | 9 +-
fluent-job/fluent-job-api/pom.xml | 8 +-
.../{findbugs-filter.xml => spotbugs-filter.xml} | 0
fluent-job/pom.xml | 12 +-
pom.xml | 49 ++++---
release-log.txt | 1 +
sharelib/git/pom.xml | 9 +-
sharelib/oozie/pom.xml | 9 +-
sharelib/spark/pom.xml | 9 +-
tools/pom.xml | 9 +-
12 files changed, 163 insertions(+), 116 deletions(-)
diff --git a/bin/test-patch-11-findbugs-diff b/bin/test-patch-11-spotbugs-diff
similarity index 67%
rename from bin/test-patch-11-findbugs-diff
rename to bin/test-patch-11-spotbugs-diff
index c884daa..240180d 100755
--- a/bin/test-patch-11-findbugs-diff
+++ b/bin/test-patch-11-spotbugs-diff
@@ -17,7 +17,7 @@ if [ "${TESTPATCHDEBUG}" == "true" ] ; then
fi
BASEDIR=$(pwd)
-TASKNAME="FINDBUGS_DIFF"
+TASKNAME="SPOTBUGS_DIFF"
OP=""
TEMPDIR=${BASEDIR}/tmp
REPORTDIR=""
@@ -25,14 +25,15 @@ SUMMARYFILE=""
SUMMARYFILE_FULL=""
STDOUT="/dev/null"
MVNPASSTHRU=""
-FINDBUGS_JAR_URL=https://repo1.maven.org/maven2/me/andrz/findbugs/findbugs-diff/0.1.0/findbugs-diff-0.1.0-all.jar
FINDBUGS_JAR=findbugs-diff-0.1.0-all.jar
+FINDBUGS_JAR_URL=https://repo1.maven.org/maven2/me/andrz/findbugs/findbugs-diff/0.1.0/$FINDBUGS_JAR
# Priorities.HIGH_PRIORITY and Priorities.NORMAL_PRIORITY
-FINDBUGS_PRIORITY_THRESHOLD=2
+SPOTBUGS_PRIORITY_THRESHOLD=2
# Scariest and scary
-FINDBUGS_RANK_THRESHOLD=9
-FINDBUGS_XML_NAME=findbugsXml.xml
+SPOTBUGS_RANK_THRESHOLD=9
+SPOTBUGS_XML_NAME=spotbugsXml.xml
BUG_LIMIT_PER_PROJECT=5
+FINDBUGS_DIFF_XML=findbugs-new.xml
cleanup_and_exit() {
@@ -107,38 +108,38 @@ parse_args() {
}
-verify_and_save_findbugs_output() {
- FINDBUGS_OUTPUT_DIR=$1
+verify_and_save_spotbugs_output() {
+ SPOTBUGS_OUTPUT_DIR=$1
BRANCH_LABEL=$2
REPORT_SUFFIX=$3
- echo "[TRACE] Verifying and saving FindBugs output in ${BRANCH_LABEL}"
- echo "[TRACE] mvn clean compile test-compile findbugs:check
-Dfindbugs.failOnError=false -Dcheckstyle.failOnViolation=false -DskipTests
${MVNPASSTHRU} | tee ${REPORTDIR}/${TASKNAME}-${REPORT_SUFFIX}.txt >> ${STDOUT}"
+ echo "[TRACE] Verifying and saving SpotBugs output in ${BRANCH_LABEL}"
+ echo "[TRACE] mvn clean compile test-compile spotbugs:check
-Dspotbugs.failOnError=false -Dcheckstyle.failOnViolation=false -DskipTests
${MVNPASSTHRU} | tee ${REPORTDIR}/${TASKNAME}-${REPORT_SUFFIX}.txt >> ${STDOUT}"
- mvn clean compile test-compile findbugs:check -Dfindbugs.failOnError=false
-Dcheckstyle.failOnViolation=false -DskipTests ${MVNPASSTHRU} | tee
${REPORTDIR}/${TASKNAME}-${REPORT_SUFFIX}.txt >> ${STDOUT}
+ mvn clean compile test-compile spotbugs:check -Dspotbugs.failOnError=false
-Dcheckstyle.failOnViolation=false -DskipTests ${MVNPASSTHRU} | tee
"${REPORTDIR}/${TASKNAME}-${REPORT_SUFFIX}.txt" >> ${STDOUT}
- if [ ! -d "$FINDBUGS_OUTPUT_DIR" ]; then
- mkdir -p "${FINDBUGS_OUTPUT_DIR}"
+ if [ ! -d "$SPOTBUGS_OUTPUT_DIR" ]; then
+ mkdir -p "${SPOTBUGS_OUTPUT_DIR}"
fi
- find . -name ${FINDBUGS_XML_NAME} ! -path '*/test-patch/*' -exec rsync -avqR
{} "${FINDBUGS_OUTPUT_DIR}" ";"
+ find . -name ${SPOTBUGS_XML_NAME} ! -path '*/test-patch/*' -exec rsync -avqR
{} "${SPOTBUGS_OUTPUT_DIR}" ";"
- if [ "$(ls -A "${FINDBUGS_OUTPUT_DIR}")" ] ; then
- echo "{color:green}+1{color} ${BRANCH_LABEL} produces FindBugs output" >>
"${TEMPDIR}/${TASKNAME}-${REPORT_SUFFIX}.txt"
+ if [ -n "$(ls -A "${SPOTBUGS_OUTPUT_DIR}")" ] ; then
+ echo "{color:green}+1{color} ${BRANCH_LABEL} produces SpotBugs output" >>
"${TEMPDIR}/${TASKNAME}-${REPORT_SUFFIX}.txt"
else
- echo "{color:red}-1{color} ${BRANCH_LABEL} does not produce FindBugs
output" >> "${TEMPDIR}/${TASKNAME}-${REPORT_SUFFIX}.txt"
+ echo "{color:red}-1{color} ${BRANCH_LABEL} does not produce SpotBugs
output" >> "${TEMPDIR}/${TASKNAME}-${REPORT_SUFFIX}.txt"
fi
- echo "[TRACE] FindBugs output in ${BRANCH_LABEL} verified and saved"
+ echo "[TRACE] SpotBugs output in ${BRANCH_LABEL} verified and saved"
}
-create_missing_findbugs_files() {
+create_missing_spotbugs_files() {
PRE_DIR=$1
POST_DIR=$2
- create_missing_xml ${PRE_DIR} "pre" "post"
- create_missing_xml ${POST_DIR} "post" "pre"
+ create_missing_xml "${PRE_DIR}" "pre" "post"
+ create_missing_xml "${POST_DIR}" "post" "pre"
}
create_missing_xml() {
@@ -148,19 +149,19 @@ create_missing_xml() {
sourceXmlFiles=()
while IFS= read -r -d '' fn; do
- sourceXmlFiles+=(${fn})
- done < <(find "${sourceFolder}" -name ${FINDBUGS_XML_NAME} -print0)
+ sourceXmlFiles+=("${fn}")
+ done < <(find "${sourceFolder}" -name ${SPOTBUGS_XML_NAME} -print0)
for index in "${!sourceXmlFiles[@]}"; do
targetXmlFile=${sourceXmlFiles[index]/${sourcePart}/${targetPart}}
- targetFolder=${targetXmlFile%${FINDBUGS_XML_NAME}}
+ targetFolder=${targetXmlFile%${SPOTBUGS_XML_NAME}}
- if [ ! -d ${targetFolder} ]; then
+ if [ ! -d "${targetFolder}" ]; then
echo "[TRACE] Folder [${targetFolder}] does not exist, creating"
mkdir -p "${targetFolder}"
fi
- if [ ! -f ${targetXmlFile} ]; then
+ if [ ! -f "${targetXmlFile}" ]; then
echo "[TRACE] XML file [${targetXmlFile}] does not exist, creating"
echo "<BugCollection />" > "${targetXmlFile}"
fi
@@ -183,7 +184,7 @@ download_and_check_findbugs_diff_jar() {
if hash md5 2>/dev/null; then
md5 -q "${DIFF_DIR}/${FINDBUGS_JAR}" > "${DIFF_DIR}/${FINDBUGS_JAR}.md5"
elif hash md5sum 2>/dev/null; then
- md5Content=($(md5sum "${DIFF_DIR}/${FINDBUGS_JAR}"))
+ md5Content="$(md5sum "${DIFF_DIR}/${FINDBUGS_JAR}")"
echo "${md5Content}" > "${DIFF_DIR}/${FINDBUGS_JAR}.md5sum"
else
echo "[ERROR] Neither md5 nor md5sum are present, cannot check FindBugs
diff JAR"
@@ -192,16 +193,16 @@ download_and_check_findbugs_diff_jar() {
fi
if hash md5 2>/dev/null; then
- jarMd5DiffCount=$(grep -Fxvf "${BASH_DIR}/${FINDBUGS_JAR}.md5"
"${DIFF_DIR}/${FINDBUGS_JAR}.md5" | wc -l)
+ jarMd5DiffCount=$(grep -cFxvf "${BASH_DIR}/${FINDBUGS_JAR}.md5"
"${DIFF_DIR}/${FINDBUGS_JAR}.md5")
elif hash md5sum 2>/dev/null; then
- jarMd5DiffCount=$(grep -Fxvf "${BASH_DIR}/${FINDBUGS_JAR}.md5sum"
"${DIFF_DIR}/${FINDBUGS_JAR}.md5sum" | wc -l)
+ jarMd5DiffCount=$(grep -cFxvf "${BASH_DIR}/${FINDBUGS_JAR}.md5sum"
"${DIFF_DIR}/${FINDBUGS_JAR}.md5sum")
fi
- if [ ${jarMd5DiffCount} -gt "0" ]; then
+ if [ "${jarMd5DiffCount}" -gt "0" ]; then
if hash md5 2>/dev/null; then
- echo "[TRACE] md5 of FindBugs diff jar is " < cat
${DIFF_DIR}/${FINDBUGS_JAR}.md5
+ echo "[TRACE] md5 of FindBugs diff jar is $(cat
"${DIFF_DIR}"/${FINDBUGS_JAR}.md5)"
elif hash md5sum 2>/dev/null; then
- echo "[TRACE] md5sum of FindBugs diff jar is " < cat
${DIFF_DIR}/${FINDBUGS_JAR}.md5sum
+ echo "[TRACE] md5sum of FindBugs diff jar is $(cat
"${DIFF_DIR}"/${FINDBUGS_JAR}.md5sum)"
fi
echo "[ERROR] FindBugs diff JAR has a weird MD5 sum, rejecting"
@@ -214,36 +215,36 @@ download_and_check_findbugs_diff_jar() {
}
-perform_findbugs_diffs() {
+perform_spotbugs_diffs() {
PRE_DIR=$1
POST_DIR=$2
DIFF_DIR=$3
- echo "[TRACE] Performing FindBugs diffs"
+ echo "[TRACE] Performing SpotBugs diffs"
sourceXmlFiles=()
while IFS= read -r -d '' fn; do
- preFindbugsDiffs+=(${fn})
- done < <(find "${PRE_DIR}" -name ${FINDBUGS_XML_NAME} -print0)
+ preSpotbugsDiffs+=("${fn}")
+ done < <(find "${PRE_DIR}" -name ${SPOTBUGS_XML_NAME} -print0)
- postFindbugsDiffs=()
+ postSpotbugsDiffs=()
while IFS= read -r -d '' fn; do
- postFindbugsDiffs+=(${fn})
- done < <(find "${POST_DIR}" -name ${FINDBUGS_XML_NAME} -print0)
+ postSpotbugsDiffs+=("${fn}")
+ done < <(find "${POST_DIR}" -name ${SPOTBUGS_XML_NAME} -print0)
- for index in "${!preFindbugsDiffs[@]}"; do
- preFindbugsDir=${preFindbugsDiffs[index]}
- diffDirPostfix=${preFindbugsDir/*${TASKNAME}/${TASKNAME}}
+ for index in "${!preSpotbugsDiffs[@]}"; do
+ preSpotbugsDir=${preSpotbugsDiffs[index]}
+ diffDirPostfix=${preSpotbugsDir/*${TASKNAME}/${TASKNAME}}
diffDirPostfix=${diffDirPostfix:18}
- diffDirPostfix=${diffDirPostfix%%/target/findbugs/findbugsXml.xml}
+ diffDirPostfix=${diffDirPostfix%%/target/spotbugs/$SPOTBUGS_XML_NAME}
- check_minimum_file_size ${preFindbugsDiffs[index]}
- check_minimum_file_size ${postFindbugsDiffs[index]}
+ check_minimum_file_size "${preSpotbugsDiffs[index]}"
+ check_minimum_file_size "${postSpotbugsDiffs[index]}"
- java -jar -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR
${DIFF_DIR}/${FINDBUGS_JAR} --outDir=${DIFF_DIR}/${diffDirPostfix}
${preFindbugsDiffs[index]} ${postFindbugsDiffs[index]}
+ java -jar -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR
"${DIFF_DIR}"/${FINDBUGS_JAR} --outDir="${DIFF_DIR}/${diffDirPostfix}"
"${preSpotbugsDiffs[index]}" "${postSpotbugsDiffs[index]}"
done
- echo "[TRACE] FindBugs diffs performed"
+ echo "[TRACE] SpotBugs diffs performed"
}
@@ -252,19 +253,19 @@ check_minimum_file_size() {
actualSize=$(wc -c < "${FILE_NAME}")
minimumSize=10
- if [ ${actualSize} -le ${minimumSize} ]; then
- echo "[ERROR] File [${FILE_NAME}] is below minimum size (has only
[${actualSize}] bytes), cannot perform FindBugs diff"
+ if [ "${actualSize}" -le "${minimumSize}" ]; then
+ echo "[ERROR] File [${FILE_NAME}] is below minimum size (has only
[${actualSize}] bytes), cannot perform SpotBugs diff"
cleanup_and_exit 1
fi
}
-check_findbugs_diffs_and_create_reports() {
+check_spotbugs_diffs_and_create_reports() {
DIFF_DIR=$1
REPORT=()
REPORT_FULL=()
- echo "[TRACE] Checking FindBugs diffs and creating reports"
+ echo "[TRACE] Checking SpotBugs diffs and creating reports"
belowThresholdCount=0
totalCount=0
@@ -272,17 +273,17 @@ check_findbugs_diffs_and_create_reports() {
componentDir=${fn/*${TASKNAME}/${TASKNAME}}
componentDir=${componentDir:19}
htmlFileName=${componentDir%%.xml}.html
- componentDir=${componentDir%%/findbugs-new.xml}
+ componentDir=${componentDir%%/$FINDBUGS_DIFF_XML}
- xmlLintXPathCompatible=$(xmllint | grep -e '\-\-xpath' | wc -l)
+ xmlLintXPathCompatible=$(xmllint | grep -ce '\-\-xpath')
if [ "${xmlLintXPathCompatible}" -eq "0" ]; then
echo "[TRACE] Old XMLLib present, calling 'xmllint --shell' to get bug
instance counts"
newBugTotalCount=$(xmllint --shell "${fn}" <<< 'xpath
count(/BugCollection/BugInstance)' | grep -oE '[^ ]+$')
- newBugBelowThresholdCount=$(xmllint --shell "${fn}" <<< 'xpath
count(/BugCollection/BugInstance[@priority <= "${FINDBUGS_PRIORITY_THRESHOLD}"
or @rank <= "${FINDBUGS_RANK_THRESHOLD}"])' | grep -oE '[^ ]+$')
+ newBugBelowThresholdCount=$(xmllint --shell "${fn}" <<< 'xpath
count(/BugCollection/BugInstance[@priority <= "${SPOTBUGS_PRIORITY_THRESHOLD}"
or @rank <= "${SPOTBUGS_RANK_THRESHOLD}"])' | grep -oE '[^ ]+$')
else
echo "[TRACE] New XMLLib present, calling 'xmllint --xpath' to get bug
instance counts"
newBugTotalCount=$(xmllint --xpath "count(/BugCollection/BugInstance)"
"${fn}")
- newBugBelowThresholdCount=$(xmllint --xpath
"count(/BugCollection/BugInstance[@priority <= ${FINDBUGS_PRIORITY_THRESHOLD}
or @rank <= ${FINDBUGS_RANK_THRESHOLD}])" "${fn}")
+ newBugBelowThresholdCount=$(xmllint --xpath
"count(/BugCollection/BugInstance[@priority <= ${SPOTBUGS_PRIORITY_THRESHOLD}
or @rank <= ${SPOTBUGS_RANK_THRESHOLD}])" "${fn}")
fi
belowThresholdCount=$((belowThresholdCount + newBugBelowThresholdCount))
@@ -296,14 +297,14 @@ check_findbugs_diffs_and_create_reports() {
else
REPORT+=("{color:red}-1{color} There are
[${newBugBelowThresholdCount}] new bugs found below threshold in
[${componentDir}] that must be fixed.")
fi
- echo "[DEBUG] You can find the FindBugs diff here (look for the red and
orange ones): ${htmlFileName}"
- REPORT+=("You can find the FindBugs diff here (look for the red and
orange ones): ${htmlFileName}")
- REPORT_FULL+=("You can find the FindBugs diff here (look for the red and
orange ones): ${htmlFileName}")
- REPORT_FULL+=("The most important FindBugs errors are:")
+ echo "[DEBUG] You can find the SpotBugs diff here (look for the red and
orange ones): ${htmlFileName}"
+ REPORT+=("You can find the SpotBugs diff here (look for the red and
orange ones): ${htmlFileName}")
+ REPORT_FULL+=("You can find the SpotBugs diff here (look for the red and
orange ones): ${htmlFileName}")
+ REPORT_FULL+=("The most important SpotBugs errors are:")
if [ "${newBugBelowThresholdCount}" -gt "${BUG_LIMIT_PER_PROJECT}" ];
then
- REPORT+=("The top [${BUG_LIMIT_PER_PROJECT}] most important FindBugs
errors are:")
+ REPORT+=("The top [${BUG_LIMIT_PER_PROJECT}] most important SpotBugs
errors are:")
else
- REPORT+=("The most important FindBugs errors are:")
+ REPORT+=("The most important SpotBugs errors are:")
fi
lineCount=0
@@ -313,22 +314,22 @@ check_findbugs_diffs_and_create_reports() {
REPORT+=( "${line}" );
fi
lineCount=$((lineCount + 1))
- done < <(echo cat "/BugCollection/BugInstance[@priority <=
${FINDBUGS_PRIORITY_THRESHOLD} or @rank <=
${FINDBUGS_RANK_THRESHOLD}]/SourceLine/Message/text() |
/BugCollection/BugInstance[@priority <= 2 or @rank <= 9]/LongMessage/text()" \
+ done < <(echo cat "/BugCollection/BugInstance[@priority <=
${SPOTBUGS_PRIORITY_THRESHOLD} or @rank <=
${SPOTBUGS_RANK_THRESHOLD}]/SourceLine/Message/text() |
/BugCollection/BugInstance[@priority <= 2 or @rank <= 9]/LongMessage/text()" \
| xmllint --shell "${fn}" | grep -v '\-\-\-\-\-\-\-' | grep -v '/ >' |
sed -e 'N;s/\(.*\)\n\(.*\)/\2: \1/')
elif [ "${newBugTotalCount}" -gt "0" ]; then
echo "[WARN] There are [${newBugTotalCount}] new bugs found in
[${componentDir}]."
REPORT+=("{color:orange}0{color} There are [${newBugTotalCount}] new
bugs found in [${componentDir}] that would be nice to have fixed.")
REPORT_FULL+=("{color:orange}0{color} There are [${newBugTotalCount}]
new bugs found in [${componentDir}] that would be nice to have fixed.")
- echo "[DEBUG] You can find the FindBugs diff here: ${htmlFileName}"
- REPORT+=("You can find the FindBugs diff here: ${htmlFileName}")
- REPORT_FULL+=("You can find the FindBugs diff here: ${htmlFileName}")
+ echo "[DEBUG] You can find the SpotBugs diff here: ${htmlFileName}"
+ REPORT+=("You can find the SpotBugs diff here: ${htmlFileName}")
+ REPORT_FULL+=("You can find the SpotBugs diff here: ${htmlFileName}")
else
echo "[DEBUG] There are no new bugs found in [${componentDir}]."
REPORT+=("{color:green}+1{color} There are no new bugs found in
[${componentDir}].")
REPORT_FULL+=("{color:green}+1{color} There are no new bugs found in
[${componentDir}].")
fi
- done < <(find "${DIFF_DIR}" -name findbugs-new.xml -print0)
+ done < <(find "${DIFF_DIR}" -name ${FINDBUGS_DIFF_XML} -print0)
if [ "${belowThresholdCount}" -gt "0" ]; then
echo "[ERROR] There are [${belowThresholdCount}] new bugs found below
threshold in total that must be fixed."
@@ -349,26 +350,26 @@ check_findbugs_diffs_and_create_reports() {
summary_full ". ${line}"
done
- echo "[TRACE] FindBugs diffs checked and reports created"
+ echo "[TRACE] SpotBugs diffs checked and reports created"
}
summary() {
LINE=$1
- echo ${LINE} >> ${SUMMARYFILE}
+ echo "${LINE}" >> "${SUMMARYFILE}"
}
summary_full() {
LINE=$1
- echo ${LINE} >> ${SUMMARYFILE_FULL}
+ echo "${LINE}" >> "${SUMMARYFILE_FULL}"
}
summary_both() {
LINE=$1
- echo ${LINE} >> ${SUMMARYFILE}
- echo ${LINE} >> ${SUMMARYFILE_FULL}
+ echo "${LINE}" >> "${SUMMARYFILE}"
+ echo "${LINE}" >> "${SUMMARYFILE_FULL}"
}
@@ -376,18 +377,18 @@ parse_args "$@"
case ${OP} in
pre)
- verify_and_save_findbugs_output "${TEMPDIR}/${TASKNAME}/pre" HEAD clean
+ verify_and_save_spotbugs_output "${TEMPDIR}/${TASKNAME}/pre" HEAD clean
;;
post)
- verify_and_save_findbugs_output "${TEMPDIR}/${TASKNAME}/post" PATCH patch
+ verify_and_save_spotbugs_output "${TEMPDIR}/${TASKNAME}/post" PATCH patch
;;
report)
- create_missing_findbugs_files "${TEMPDIR}/${TASKNAME}/pre"
"${TEMPDIR}/${TASKNAME}/post"
+ create_missing_spotbugs_files "${TEMPDIR}/${TASKNAME}/pre"
"${TEMPDIR}/${TASKNAME}/post"
download_and_check_findbugs_diff_jar "${TEMPDIR}/${TASKNAME}/diff"
- perform_findbugs_diffs "${TEMPDIR}/${TASKNAME}/pre"
"${TEMPDIR}/${TASKNAME}/post" "${TEMPDIR}/${TASKNAME}/diff"
- check_findbugs_diffs_and_create_reports "${TEMPDIR}/${TASKNAME}/diff"
- echo "[TRACE] Summary file size is $(wc -c ${SUMMARYFILE} | awk '{print
$1}') bytes"
- echo "[TRACE] Full summary file size is $(wc -c ${SUMMARYFILE_FULL} | awk
'{print $1}') bytes"
+ perform_spotbugs_diffs "${TEMPDIR}/${TASKNAME}/pre"
"${TEMPDIR}/${TASKNAME}/post" "${TEMPDIR}/${TASKNAME}/diff"
+ check_spotbugs_diffs_and_create_reports "${TEMPDIR}/${TASKNAME}/diff"
+ echo "[TRACE] Summary file size is $(wc -c "${SUMMARYFILE}" | awk '{print
$1}') bytes"
+ echo "[TRACE] Full summary file size is $(wc -c "${SUMMARYFILE_FULL}" |
awk '{print $1}') bytes"
;;
esac
diff --git a/client/pom.xml b/client/pom.xml
index f0f6a1b..d6428d7 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -100,8 +100,13 @@
<artifactId>oozie-fluent-job-api</artifactId>
</dependency>
<dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>annotations</artifactId>
+ <groupId>net.jcip</groupId>
+ <artifactId>jcip-annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-annotations</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
diff --git a/core/pom.xml b/core/pom.xml
index b6c07d3..c7558a3 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -508,8 +508,13 @@
<scope>compile</scope>
</dependency>
<dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>annotations</artifactId>
+ <groupId>net.jcip</groupId>
+ <artifactId>jcip-annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-annotations</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
diff --git a/fluent-job/fluent-job-api/pom.xml
b/fluent-job/fluent-job-api/pom.xml
index f303b45..f9c2e5d 100644
--- a/fluent-job/fluent-job-api/pom.xml
+++ b/fluent-job/fluent-job-api/pom.xml
@@ -72,12 +72,12 @@
<build>
<plugins>
- <!-- findbugs plugin. Execute 'mvn verify' and look for
target/findbugs/findbugsXml.html under each module -->
+ <!-- spotbugs plugin. Execute 'mvn verify' and look for
target/spotbugs/spotbugsXml.html under each module -->
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
-
<excludeFilterFile>${basedir}/findbugs-filter.xml</excludeFilterFile>
+
<excludeFilterFile>${basedir}/spotbugs-filter.xml</excludeFilterFile>
</configuration>
</plugin>
<plugin>
diff --git a/fluent-job/fluent-job-api/findbugs-filter.xml
b/fluent-job/fluent-job-api/spotbugs-filter.xml
similarity index 100%
rename from fluent-job/fluent-job-api/findbugs-filter.xml
rename to fluent-job/fluent-job-api/spotbugs-filter.xml
diff --git a/fluent-job/pom.xml b/fluent-job/pom.xml
index bb8861d..43d9169 100644
--- a/fluent-job/pom.xml
+++ b/fluent-job/pom.xml
@@ -33,9 +33,15 @@
<dependencies>
<dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>annotations</artifactId>
- <scope>provided</scope>
+ <groupId>net.jcip</groupId>
+ <artifactId>jcip-annotations</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-annotations</artifactId>
+ <optional>true</optional>
</dependency>
</dependencies>
diff --git a/pom.xml b/pom.xml
index d817140..4227d31 100644
--- a/pom.xml
+++ b/pom.xml
@@ -119,6 +119,9 @@
<kyro.version>2.22</kyro.version>
<javax.servlet.api.version>3.0.1</javax.servlet.api.version>
<jgit.version>5.0.1.201806211838-r</jgit.version>
+ <spotbugs.annotations.version>3.1.11</spotbugs.annotations.version>
+ <spotbugs-maven-plugin.version>3.1.11</spotbugs-maven-plugin.version>
+ <spotbugs.version>3.1.11</spotbugs.version>
</properties>
<modules>
@@ -1621,9 +1624,16 @@
<version>3.0</version>
</dependency>
<dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>annotations</artifactId>
- <version>3.0.0</version>
+ <groupId>net.jcip</groupId>
+ <artifactId>jcip-annotations</artifactId>
+ <version>1.0</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-annotations</artifactId>
+ <version>${spotbugs.annotations.version}</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
@@ -1793,9 +1803,9 @@
<version>3.5.0</version>
</plugin>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <version>3.0.5</version>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
+ <version>${spotbugs-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
@@ -1838,25 +1848,24 @@
</configuration>
</plugin>
- <!-- findbugs plugin. Execute 'mvn verify' and look for
target/findbugs/findbugsXml.html under each module -->
+ <!-- spotbugs plugin. Execute 'mvn verify' and look for
target/spotbugs/spotbugsXml.html under each module -->
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<excludeSubProjects>false</excludeSubProjects>
<xmlOutput>true</xmlOutput>
- <findbugsXmlOutput>true</findbugsXmlOutput>
- <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
+ <spotbugsXmlOutput>true</spotbugsXmlOutput>
<effort>Max</effort>
<failOnError>false</failOnError>
<threshold>Low</threshold>
<xmlOutput>true</xmlOutput>
-
<findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory>
+
<spotbugsXmlOutputDirectory>${project.build.directory}/spotbugs</spotbugsXmlOutputDirectory>
<plugins>
<plugin>
<groupId>com.h3xstream.findsecbugs</groupId>
<artifactId>findsecbugs-plugin</artifactId>
- <version>1.7.1</version>
+ <version>1.8.0</version>
</plugin>
</plugins>
</configuration>
@@ -1864,7 +1873,7 @@
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs</artifactId>
- <version>3.1.1</version>
+ <version>${spotbugs.version}</version>
</dependency>
</dependencies>
<executions>
@@ -1877,7 +1886,7 @@
</execution>
</executions>
</plugin>
- <!-- xml plugin is used for transforming the findbugs xml output
into a friendlier html page -->
+ <!-- xml plugin is used for transforming the spotbugs xml output
into a friendlier html page -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
@@ -1885,8 +1894,8 @@
<excludeSubProjects>false</excludeSubProjects>
<transformationSets>
<transformationSet>
- <dir>${project.build.directory}/findbugs</dir>
-
<outputDir>${project.build.directory}/findbugs</outputDir>
+ <dir>${project.build.directory}/spotbugs</dir>
+
<outputDir>${project.build.directory}/spotbugs</outputDir>
<stylesheet>fancy-hist.xsl</stylesheet>
<excludes>
<exclude>**/findsecbugs*.jar</exclude>
@@ -1910,9 +1919,9 @@
</executions>
<dependencies>
<dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>findbugs</artifactId>
- <version>3.0.1</version>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs</artifactId>
+ <version>${spotbugs.version}</version>
</dependency>
</dependencies>
</plugin>
diff --git a/release-log.txt b/release-log.txt
index 698bc0e..b65afac 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -1,5 +1,6 @@
-- Oozie 5.2.0 release (trunk - unreleased)
+OOZIE-3395 [build] Migration from FindBugs to SpotBugs (kmarton via asalamon74)
OOZIE-3438 Copy only apache-jsp server dependencies to distro (asalamon74 via
kmarton)
OOZIE-3437 Missing README from distro (nobigo via asalamon74)
OOZIE-3439 Hive2 action is not parsing application ID for TEZ from log file
properly (shubham.chhabra via kmarton)
diff --git a/sharelib/git/pom.xml b/sharelib/git/pom.xml
index 1c17e48..f631ba5 100644
--- a/sharelib/git/pom.xml
+++ b/sharelib/git/pom.xml
@@ -92,8 +92,13 @@
</dependency>
<dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>annotations</artifactId>
+ <groupId>net.jcip</groupId>
+ <artifactId>jcip-annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-annotations</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
diff --git a/sharelib/oozie/pom.xml b/sharelib/oozie/pom.xml
index a53d335..cc97bdb 100644
--- a/sharelib/oozie/pom.xml
+++ b/sharelib/oozie/pom.xml
@@ -74,8 +74,13 @@
</dependency>
<dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>annotations</artifactId>
+ <groupId>net.jcip</groupId>
+ <artifactId>jcip-annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-annotations</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
diff --git a/sharelib/spark/pom.xml b/sharelib/spark/pom.xml
index 76f6903..496f2e7 100644
--- a/sharelib/spark/pom.xml
+++ b/sharelib/spark/pom.xml
@@ -361,8 +361,13 @@
</exclusions>
</dependency>
<dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>annotations</artifactId>
+ <groupId>net.jcip</groupId>
+ <artifactId>jcip-annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-annotations</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
diff --git a/tools/pom.xml b/tools/pom.xml
index 72a6c28..d4c0327 100644
--- a/tools/pom.xml
+++ b/tools/pom.xml
@@ -89,8 +89,13 @@
<scope>compile</scope>
</dependency>
<dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>annotations</artifactId>
+ <groupId>net.jcip</groupId>
+ <artifactId>jcip-annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.github.spotbugs</groupId>
+ <artifactId>spotbugs-annotations</artifactId>
<scope>provided</scope>
</dependency>