Using fb-contrib library with Gradle's FindBugs plugin

◇◆丶佛笑我妖孽 提交于 2019-12-05 05:30:21

I just came across this very same problem. I was able to solve it as follows:

apply plugin: 'findbugs'

dependencies {
    // We need to manually set this first, or the plugin is not loaded
    findbugs 'com.google.code.findbugs:findbugs:3.0.0'
    findbugs configurations.findbugsPlugins.dependencies

    // To keep everything tidy, we set these apart
    findbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:6.0.0'
}

task findbugs(type: FindBugs) {
   // Add all your config here ...

   pluginClasspath = project.configurations.findbugsPlugins
}

Hope that helps!

You can add more Findbugs plugins just by adding them under dependencies for findbugsPlugins

if you place the fb-contrib.jar in Findbugs' plugin directory, it should just automagically get picked up, i would think. Never tried with Gradle tho.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!