22

Overview:

I am trying to upgrade Java and Gradle version in my project as follows:

  • java from 8 to 11
  • Gradle from 5 to 6

My project runs with no issues on the old versions but when runs on Java 11 and Gradle 6 it complains about fireBugs plugin and raises the following exception:

 > Plugin with id 'findbugs' not found.

Snippet of gradle file:

buildscript {
    ext {
        SampleProjectVersion = '1.3.4'
    }
    repositories {
        mavenLocal()
        maven {
            url1
        }
    }
    dependencies {
        classpath(sample lib 1)
        classpath(sample lib 2)
    }

apply plugin: 'findbugs'

...

I would appreciate if you could share your thoughts with me as I couldn't find any proper solution for that.

saeedj
  • 2,179
  • 9
  • 25
  • 38
  • Not aware if any such plugin with an exact id of `findbugs`, see the search [here](https://plugins.gradle.org/search?term=findbugs). If it's a custom plugin, make sure [the marker](https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_markers) is published as well. – Cisco Nov 22 '19 at 15:59

2 Answers2

25

From the Gradle web site (Upgrading your build from Gradle 5.x to 6.0):

The FindBugs plugin has been removed

The deprecated FindBugs plugin has been removed. As an alternative, you can use the SpotBugs plugin from the Gradle Plugin Portal.

https://docs.gradle.org/current/userguide/upgrading_version_5.html

Andrea
  • 401
  • 3
  • 8
2

You can use the SpotBugs plugin. Try my snippet of gradle file

buildscript {
ext {
    SampleProjectVersion = '1.3.4'
}
repositories {
    mavenLocal()
    maven {
        url1
    }
}
dependencies {
    classpath(sample lib 1)
    classpath(sample lib 2)
    classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:2.0.0"
}

apply plugin: "com.github.spotbugs"

tasks.withType(com.github.spotbugs.SpotBugsTask) {
    spotbugsMain.enabled = true
    spotbugsTest.enabled = true
    reports {
        xml.enabled = false
        html.enabled = true
    }
}
...
Dharman
  • 30,962
  • 25
  • 85
  • 135
V-Q-A NGUYEN
  • 1,497
  • 16
  • 19