Skip to content

Commit 43e8dcc

Browse files
aajisakatomscut
authored andcommitted
HADOOP-16870. Use spotbugs-maven-plugin instead of findbugs-maven-plugin (apache#2454)
Use spotbugs instead of findbugs. Removed findbugs from the hadoop build images, and added spotbugs in the images instead. Reviewed-by: Masatake Iwasaki <iwasakims@apache.org> Reviewed-by: Inigo Goiri <inigoiri@apache.org> Reviewed-by: Dinesh Chitlangia <dineshc@apache.org>
1 parent f3b9145 commit 43e8dcc

File tree

33 files changed

+98
-106
lines changed

33 files changed

+98
-106
lines changed

BUILDING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Maven build goals:
131131
* Compile : mvn compile [-Pnative]
132132
* Run tests : mvn test [-Pnative] [-Pshelltest]
133133
* Create JAR : mvn package
134-
* Run findbugs : mvn compile findbugs:findbugs
134+
* Run spotbugs : mvn compile spotbugs:spotbugs
135135
* Run checkstyle : mvn compile checkstyle:checkstyle
136136
* Install JAR in M2 cache : mvn install
137137
* Deploy JAR to Maven repo : mvn deploy

Jenkinsfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ pipeline {
120120
YETUS_ARGS+=("--proclimit=5500")
121121
YETUS_ARGS+=("--dockermemlimit=22g")
122122
123-
# -1 findbugs issues that show up prior to the patch being applied
124-
YETUS_ARGS+=("--findbugs-strict-precheck")
123+
# -1 spotbugs issues that show up prior to the patch being applied
124+
YETUS_ARGS+=("--spotbugs-strict-precheck")
125125
126126
# rsync these files back into the archive dir
127-
YETUS_ARGS+=("--archive-list=checkstyle-errors.xml,findbugsXml.xml")
127+
YETUS_ARGS+=("--archive-list=checkstyle-errors.xml,spotbugsXml.xml")
128128
129129
# URL for user-side presentation in reports and such to our artifacts
130130
# (needs to match the archive bits below)

dev-support/bin/hadoop.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ function personality_file_tests
482482
fi
483483

484484
if [[ ${filename} =~ \.java$ ]]; then
485-
add_test findbugs
485+
add_test spotbugs
486486
fi
487487
}
488488

@@ -550,7 +550,7 @@ function shadedclient_rebuild
550550
echo_and_redirect "${logfile}" \
551551
"${MAVEN}" "${MAVEN_ARGS[@]}" verify -fae --batch-mode -am \
552552
"${modules[@]}" \
553-
-Dtest=NoUnitTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dfindbugs.skip=true
553+
-Dtest=NoUnitTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotbugs.skip=true
554554

555555
count=$("${GREP}" -c '\[ERROR\]' "${logfile}")
556556
if [[ ${count} -gt 0 ]]; then

dev-support/docker/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ RUN apt-get -q update \
4444
cmake \
4545
curl \
4646
doxygen \
47-
findbugs \
4847
fuse \
4948
g++ \
5049
gcc \
@@ -91,7 +90,16 @@ RUN apt-get -q update \
9190
ENV MAVEN_HOME /usr
9291
# JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
9392
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
94-
ENV FINDBUGS_HOME /usr
93+
94+
#######
95+
# Install SpotBugs 4.0.6
96+
#######
97+
RUN mkdir -p /opt/spotbugs \
98+
&& curl -L -s -S https://github.com/spotbugs/spotbugs/releases/download/4.0.6/spotbugs-4.0.6.tgz \
99+
-o /opt/spotbugs.tgz \
100+
&& tar xzf /opt/spotbugs.tgz --strip-components 1 -C /opt/spotbugs \
101+
&& chmod +x /opt/spotbugs/bin/*
102+
ENV SPOTBUGS_HOME /opt/spotbugs
95103

96104
#######
97105
# Install Boost 1.72 (1.71 ships with Focal)

dev-support/docker/Dockerfile_aarch64

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ RUN apt-get -q update \
4848
cmake \
4949
curl \
5050
doxygen \
51-
findbugs \
5251
fuse \
5352
g++ \
5453
gcc \
@@ -95,7 +94,16 @@ RUN apt-get -q update \
9594
ENV MAVEN_HOME /usr
9695
# JAVA_HOME must be set in Maven >= 3.5.0 (MNG-6003)
9796
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-arm64
98-
ENV FINDBUGS_HOME /usr
97+
98+
#######
99+
# Install SpotBugs 4.0.6
100+
#######
101+
RUN mkdir -p /opt/spotbugs \
102+
&& curl -L -s -S https://github.com/spotbugs/spotbugs/releases/download/4.0.6/spotbugs-4.0.6.tgz \
103+
-o /opt/spotbugs.tgz \
104+
&& tar xzf /opt/spotbugs.tgz --strip-components 1 -C /opt/spotbugs \
105+
&& chmod +x /opt/spotbugs/bin/*
106+
ENV SPOTBUGS_HOME /opt/spotbugs
99107

100108
#######
101109
# Install Boost 1.72 (1.71 ships with Focal)

hadoop-cloud-storage-project/hadoop-cos/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,9 @@
6464
<build>
6565
<plugins>
6666
<plugin>
67-
<groupId>org.codehaus.mojo</groupId>
68-
<artifactId>findbugs-maven-plugin</artifactId>
67+
<groupId>com.github.spotbugs</groupId>
68+
<artifactId>spotbugs-maven-plugin</artifactId>
6969
<configuration>
70-
<findbugsXmlOutput>true</findbugsXmlOutput>
7170
<xmlOutput>true</xmlOutput>
7271
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml
7372
</excludeFilterFile>

hadoop-common-project/hadoop-auth/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@
237237
</executions>
238238
</plugin>
239239
<plugin>
240-
<groupId>org.codehaus.mojo</groupId>
241-
<artifactId>findbugs-maven-plugin</artifactId>
240+
<groupId>com.github.spotbugs</groupId>
241+
<artifactId>spotbugs-maven-plugin</artifactId>
242242
<configuration>
243243
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
244244
</configuration>

hadoop-common-project/hadoop-kms/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@
237237
</executions>
238238
</plugin>
239239
<plugin>
240-
<groupId>org.codehaus.mojo</groupId>
241-
<artifactId>findbugs-maven-plugin</artifactId>
240+
<groupId>com.github.spotbugs</groupId>
241+
<artifactId>spotbugs-maven-plugin</artifactId>
242242
<configuration>
243243
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml
244244
</excludeFilterFile>

hadoop-common-project/hadoop-minikdc/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
<build>
5454
<plugins>
5555
<plugin>
56-
<groupId>org.codehaus.mojo</groupId>
57-
<artifactId>findbugs-maven-plugin</artifactId>
56+
<groupId>com.github.spotbugs</groupId>
57+
<artifactId>spotbugs-maven-plugin</artifactId>
5858
<configuration>
5959
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml
6060
</excludeFilterFile>

hadoop-common-project/hadoop-nfs/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@
107107
<build>
108108
<plugins>
109109
<plugin>
110-
<groupId>org.codehaus.mojo</groupId>
111-
<artifactId>findbugs-maven-plugin</artifactId>
110+
<groupId>com.github.spotbugs</groupId>
111+
<artifactId>spotbugs-maven-plugin</artifactId>
112112
<configuration>
113113
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml
114114
</excludeFilterFile>

hadoop-common-project/hadoop-registry/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,9 @@
163163
</resources>
164164
<plugins>
165165
<plugin>
166-
<groupId>org.codehaus.mojo</groupId>
167-
<artifactId>findbugs-maven-plugin</artifactId>
166+
<groupId>com.github.spotbugs</groupId>
167+
<artifactId>spotbugs-maven-plugin</artifactId>
168168
<configuration>
169-
<findbugsXmlOutput>true</findbugsXmlOutput>
170169
<xmlOutput>true</xmlOutput>
171170
<excludeFilterFile>${project.basedir}/dev-support/findbugs-exclude.xml</excludeFilterFile>
172171
<effort>Max</effort>

hadoop-hdfs-project/hadoop-hdfs-httpfs/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@
337337
</executions>
338338
</plugin>
339339
<plugin>
340-
<groupId>org.codehaus.mojo</groupId>
341-
<artifactId>findbugs-maven-plugin</artifactId>
340+
<groupId>com.github.spotbugs</groupId>
341+
<artifactId>spotbugs-maven-plugin</artifactId>
342342
<configuration>
343343
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
344344
</configuration>

hadoop-mapreduce-project/hadoop-mapreduce-client/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,9 @@
157157
<build>
158158
<plugins>
159159
<plugin>
160-
<groupId>org.codehaus.mojo</groupId>
161-
<artifactId>findbugs-maven-plugin</artifactId>
160+
<groupId>com.github.spotbugs</groupId>
161+
<artifactId>spotbugs-maven-plugin</artifactId>
162162
<configuration>
163-
<findbugsXmlOutput>true</findbugsXmlOutput>
164163
<xmlOutput>true</xmlOutput>
165164
<excludeFilterFile>${mr.basedir}/dev-support/findbugs-exclude.xml</excludeFilterFile>
166165
<effort>Max</effort>

hadoop-mapreduce-project/hadoop-mapreduce-examples/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,9 @@
138138
</plugin>
139139

140140
<plugin>
141-
<groupId>org.codehaus.mojo</groupId>
142-
<artifactId>findbugs-maven-plugin</artifactId>
141+
<groupId>com.github.spotbugs</groupId>
142+
<artifactId>spotbugs-maven-plugin</artifactId>
143143
<configuration>
144-
<findbugsXmlOutput>true</findbugsXmlOutput>
145144
<xmlOutput>true</xmlOutput>
146145
<excludeFilterFile>${mr.examples.basedir}/dev-support/findbugs-exclude.xml</excludeFilterFile>
147146
<effort>Max</effort>

hadoop-mapreduce-project/pom.xml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,9 @@
178178
</executions>
179179
</plugin>
180180
<plugin>
181-
<groupId>org.codehaus.mojo</groupId>
182-
<artifactId>findbugs-maven-plugin</artifactId>
181+
<groupId>com.github.spotbugs</groupId>
182+
<artifactId>spotbugs-maven-plugin</artifactId>
183183
<configuration>
184-
<findbugsXmlOutput>true</findbugsXmlOutput>
185184
<xmlOutput>true</xmlOutput>
186185
<excludeFilterFile>${mr.basedir}/dev-support/findbugs-exclude.xml</excludeFilterFile>
187186
<effort>Max</effort>
@@ -299,12 +298,9 @@
299298
<reporting>
300299
<plugins>
301300
<plugin>
302-
<groupId>org.codehaus.mojo</groupId>
303-
<artifactId>findbugs-maven-plugin</artifactId>
304-
<!-- until we have reporting management cf. MSITE-443 -->
305-
<version>2.3.2</version>
301+
<groupId>com.github.spotbugs</groupId>
302+
<artifactId>spotbugs-maven-plugin</artifactId>
306303
<configuration>
307-
<findbugsXmlOutput>true</findbugsXmlOutput>
308304
<xmlOutput>true</xmlOutput>
309305
</configuration>
310306
</plugin>

hadoop-project-dist/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,10 @@
8989
</executions>
9090
</plugin>
9191
<plugin>
92-
<groupId>org.codehaus.mojo</groupId>
93-
<artifactId>findbugs-maven-plugin</artifactId>
92+
<groupId>com.github.spotbugs</groupId>
93+
<artifactId>spotbugs-maven-plugin</artifactId>
9494
<configuration>
9595
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
96-
<fork>true</fork>
9796
<maxHeap>2048</maxHeap>
9897
</configuration>
9998
</plugin>

hadoop-project/pom.xml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
<zookeeper.version>3.5.6</zookeeper.version>
102102
<curator.version>4.2.0</curator.version>
103103
<findbugs.version>3.0.5</findbugs.version>
104-
<spotbugs.version>4.0.6</spotbugs.version>
105104
<dnsjava.version>2.1.7</dnsjava.version>
106105

107106
<guava.version>27.0-jre</guava.version>
@@ -1866,18 +1865,6 @@
18661865
<artifactId>maven-war-plugin</artifactId>
18671866
<version>${maven-war-plugin.version}</version>
18681867
</plugin>
1869-
<plugin>
1870-
<groupId>org.codehaus.mojo</groupId>
1871-
<artifactId>findbugs-maven-plugin</artifactId>
1872-
<version>${findbugs.version}</version>
1873-
<dependencies>
1874-
<dependency>
1875-
<groupId>com.github.spotbugs</groupId>
1876-
<artifactId>spotbugs</artifactId>
1877-
<version>${spotbugs.version}</version>
1878-
</dependency>
1879-
</dependencies>
1880-
</plugin>
18811868
<plugin>
18821869
<groupId>org.codehaus.mojo</groupId>
18831870
<artifactId>make-maven-plugin</artifactId>
@@ -2111,10 +2098,6 @@
21112098
</filesets>
21122099
</configuration>
21132100
</plugin>
2114-
<plugin>
2115-
<groupId>org.codehaus.mojo</groupId>
2116-
<artifactId>findbugs-maven-plugin</artifactId>
2117-
</plugin>
21182101
<plugin>
21192102
<groupId>org.apache.maven.plugins</groupId>
21202103
<artifactId>maven-antrun-plugin</artifactId>

hadoop-tools/hadoop-aliyun/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@
5858
<build>
5959
<plugins>
6060
<plugin>
61-
<groupId>org.codehaus.mojo</groupId>
62-
<artifactId>findbugs-maven-plugin</artifactId>
61+
<groupId>com.github.spotbugs</groupId>
62+
<artifactId>spotbugs-maven-plugin</artifactId>
6363
<configuration>
64-
<findbugsXmlOutput>true</findbugsXmlOutput>
6564
<xmlOutput>true</xmlOutput>
6665
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml
6766
</excludeFilterFile>

hadoop-tools/hadoop-archive-logs/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,9 @@
194194
</executions>
195195
</plugin>
196196
<plugin>
197-
<groupId>org.codehaus.mojo</groupId>
198-
<artifactId>findbugs-maven-plugin</artifactId>
197+
<groupId>com.github.spotbugs</groupId>
198+
<artifactId>spotbugs-maven-plugin</artifactId>
199199
<configuration>
200-
<findbugsXmlOutput>true</findbugsXmlOutput>
201200
<xmlOutput>true</xmlOutput>
202201
<excludeFilterFile>
203202
${basedir}/dev-support/findbugs-exclude.xml

hadoop-tools/hadoop-aws/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,9 @@
399399
<build>
400400
<plugins>
401401
<plugin>
402-
<groupId>org.codehaus.mojo</groupId>
403-
<artifactId>findbugs-maven-plugin</artifactId>
402+
<groupId>com.github.spotbugs</groupId>
403+
<artifactId>spotbugs-maven-plugin</artifactId>
404404
<configuration>
405-
<findbugsXmlOutput>true</findbugsXmlOutput>
406405
<xmlOutput>true</xmlOutput>
407406
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml
408407
</excludeFilterFile>

hadoop-tools/hadoop-azure/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@
5050
<build>
5151
<plugins>
5252
<plugin>
53-
<groupId>org.codehaus.mojo</groupId>
54-
<artifactId>findbugs-maven-plugin</artifactId>
53+
<groupId>com.github.spotbugs</groupId>
54+
<artifactId>spotbugs-maven-plugin</artifactId>
5555
<configuration>
56-
<findbugsXmlOutput>true</findbugsXmlOutput>
5756
<xmlOutput>true</xmlOutput>
5857
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml
5958
</excludeFilterFile>

hadoop-tools/hadoop-datajoin/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,9 @@
108108
<build>
109109
<plugins>
110110
<plugin>
111-
<groupId>org.codehaus.mojo</groupId>
112-
<artifactId>findbugs-maven-plugin</artifactId>
111+
<groupId>com.github.spotbugs</groupId>
112+
<artifactId>spotbugs-maven-plugin</artifactId>
113113
<configuration>
114-
<findbugsXmlOutput>true</findbugsXmlOutput>
115114
<xmlOutput>true</xmlOutput>
116115
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml
117116
</excludeFilterFile>

hadoop-tools/hadoop-fs2img/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@
8787
</configuration>
8888
</plugin>
8989
<plugin>
90-
<groupId>org.codehaus.mojo</groupId>
91-
<artifactId>findbugs-maven-plugin</artifactId>
90+
<groupId>com.github.spotbugs</groupId>
91+
<artifactId>spotbugs-maven-plugin</artifactId>
9292
<configuration>
93-
<findbugsXmlOutput>true</findbugsXmlOutput>
9493
<xmlOutput>true</xmlOutput>
9594
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml</excludeFilterFile>
9695
<effort>Max</effort>

hadoop-tools/hadoop-gridmix/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,9 @@
123123
<build>
124124
<plugins>
125125
<plugin>
126-
<groupId>org.codehaus.mojo</groupId>
127-
<artifactId>findbugs-maven-plugin</artifactId>
126+
<groupId>com.github.spotbugs</groupId>
127+
<artifactId>spotbugs-maven-plugin</artifactId>
128128
<configuration>
129-
<findbugsXmlOutput>true</findbugsXmlOutput>
130129
<xmlOutput>true</xmlOutput>
131130
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml</excludeFilterFile>
132131
<effort>Max</effort>

hadoop-tools/hadoop-kafka/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@
3939
<build>
4040
<plugins>
4141
<plugin>
42-
<groupId>org.codehaus.mojo</groupId>
43-
<artifactId>findbugs-maven-plugin</artifactId>
42+
<groupId>com.github.spotbugs</groupId>
43+
<artifactId>spotbugs-maven-plugin</artifactId>
4444
<configuration>
45-
<findbugsXmlOutput>true</findbugsXmlOutput>
4645
<xmlOutput>true</xmlOutput>
4746
<effort>Max</effort>
4847
</configuration>

hadoop-tools/hadoop-openstack/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@
6666
<build>
6767
<plugins>
6868
<plugin>
69-
<groupId>org.codehaus.mojo</groupId>
70-
<artifactId>findbugs-maven-plugin</artifactId>
69+
<groupId>com.github.spotbugs</groupId>
70+
<artifactId>spotbugs-maven-plugin</artifactId>
7171
<configuration>
72-
<findbugsXmlOutput>true</findbugsXmlOutput>
7372
<xmlOutput>true</xmlOutput>
7473
<excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml
7574
</excludeFilterFile>

0 commit comments

Comments
 (0)