Skip to content

Commit 476ac5b

Browse files
committed
JAVA-2524: Replace FindBugs with SpotBugs, which is actively maintained and supports Java 9
1 parent 3e323b5 commit 476ac5b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
1617
import static org.gradle.util.CollectionUtils.single
1718

1819
apply plugin: 'eclipse'
@@ -27,12 +28,14 @@ buildscript {
2728
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
2829
jcenter()
2930
mavenCentral()
31+
maven { url "https://plugins.gradle.org/m2/" }
3032
mavenLocal()
3133
}
3234
dependencies {
3335
classpath 'org.kordamp.gradle:clirr-gradle-plugin:0.2.2'
3436
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:1.12.+'
3537
classpath 'com.bmuschko:gradle-nexus-plugin:2.2'
38+
classpath "gradle.plugin.com.github.spotbugs:gradlePlugin:1.6.0"
3639
}
3740
}
3841

@@ -165,7 +168,7 @@ def getGitVersion() {
165168

166169
configure(subprojects.findAll { it.name != 'util' && it.name != 'mongo-java-driver' }) {
167170
apply plugin: 'checkstyle'
168-
apply plugin: 'findbugs'
171+
apply plugin: "com.github.spotbugs"
169172
apply plugin: 'jacoco'
170173
apply plugin: 'groovy'
171174
apply plugin: 'codenarc'
@@ -266,18 +269,18 @@ configure(subprojects.findAll { it.name != 'util' && it.name != 'mongo-java-driv
266269
configProperties.checkstyleConfigDir = configDir
267270
}
268271

269-
findbugs {
272+
spotbugs {
270273
excludeFilter = new File(configDir, 'findbugs-exclude.xml')
271274
sourceSets = [sourceSets.main]
272-
toolVersion = '3.0.1'
275+
toolVersion = '3.1.0'
273276
}
274277

275278
codenarc {
276279
toolVersion = '0.24'
277280
reportFormat = project.buildingWith('xmlReports.enabled') ? 'xml' : 'html'
278281
}
279282

280-
tasks.withType(FindBugs) {
283+
tasks.withType(com.github.spotbugs.SpotBugsTask) {
281284
reports {
282285
xml.enabled = project.buildingWith('xmlReports.enabled')
283286
html.enabled = !project.buildingWith('xmlReports.enabled')

0 commit comments

Comments
 (0)