Can you give an example of FindBugs plugin producing an html report?

The default setting of findbugs plugin is to produce xml reports. I would like to have an html report since it’s better for local development. But I haven’t been able to get it to work following the DSL documentation. I would appreciate if someone would give an example of how to generate an HTML report with the findbugs plugin.

Hi Juan,

What have you tried so far, and what went wrong?

These are some of the things I tested:

findbugs {

output = ‘html’ }

That does nothing, it still produces the same xml report

findbugsMain {

reports {

html {

destination ‘build/reports/findbugs’

}

} }

That again, does nothing, keeps producing the same xml report, and there’s no sign of a findbugs html report.

At this point, I’m a bit lost. I find that there’s not enough examples in the documentation. I know that there’s the DSL documentation but it lacks usage examples.

Any help would be appreciated.

It’s

findbugsMain {
  xml.enabled = false
  html.enabled = true
}

that is not good:

A problem occurred evaluating root project

Could not find property ‘xml’ on task ‘:findbugsMain’.

Sorry, it’s

findbugsMain {
  reports {
    xml.enabled = false
    html.enabled = true
  }
}

Yes! That did the trick! Thank you very much for your quick responses!

where to put this line of code?

Anywhere after ‘apply plugin: “findbugs”’.