Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Commit 6ae4a15

Browse files
committed
Changed to spotbugs
1 parent bdcdcfd commit 6ae4a15

4 files changed

Lines changed: 15 additions & 11 deletions

File tree

Jenkinsfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ stage('QA') {
5757

5858
// Standard builds do Findbugs and test against Cloudant
5959
def axes = [
60-
Findbugs:
60+
Spotbugs:
6161
{
6262
node {
6363
unstash name: 'built'
64-
// findBugs
64+
// Spotbugs
6565
try {
66-
sh './gradlew -Dfindbugs.xml.report=true findbugsMain'
66+
sh './gradlew -Dspotbugs.xml.report=true spotbugsMain'
6767
} finally {
68-
step([$class: 'FindBugsPublisher', pattern: '**/build/reports/findbugs/*.xml'])
68+
recordIssues enabledForFailure: true, tool: spotBugs(pattern: '**/build/reports/spotbugs/*.xml')
6969
}
7070
}
7171
},

build.gradle

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
* and limitations under the License.
1313
*/
1414

15+
plugins {
16+
id "com.github.spotbugs" version "2.0.0" apply false
17+
}
18+
1519
subprojects {
1620
apply plugin: 'java'
1721
apply plugin: 'maven'
@@ -175,24 +179,24 @@ subprojects {
175179
}
176180

177181
// Findbugs
178-
apply plugin: 'findbugs'
179-
findbugs {
180-
toolVersion = "3.0.1"
182+
apply plugin: 'com.github.spotbugs'
183+
spotbugs {
184+
toolVersion = "3.1.12"
181185
// Report only high severity bugs for now
182186
reportLevel = "low"
183187
// The code base is pretty small so use max effort
184188
effort = "max"
185189
// We don't want to run findbugs on the test code yet
186190
sourceSets = [sourceSets.main]
187191
// Exclude a couple of known bugs until we get the chance to fix them
188-
if (file("findbugs_excludes.xml").exists()) {
189-
excludeFilter = file("findbugs_excludes.xml")
192+
if (file("spotbugs_excludes.xml").exists()) {
193+
excludeFilter = file("spotbugs_excludes.xml")
190194
}
191195
}
192196

193-
tasks.withType(FindBugs) {
197+
tasks.withType(com.github.spotbugs.SpotBugsTask) {
194198
// Currently only one report type can be used toggle which with a property
195-
boolean generateXML = Boolean.getBoolean("findbugs.xml.report")
199+
boolean generateXML = Boolean.getBoolean("spotbugs.xml.report")
196200
reports {
197201
xml.enabled = generateXML
198202
html.enabled = !generateXML

0 commit comments

Comments
 (0)