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


(Juan Miguel Salamanca) #1

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.


(Luke Daley) #2

Hi Juan,

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


(Juan Miguel Salamanca) #3

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.


(Luke Daley) #4

It’s

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

(Juan Miguel Salamanca) #5

that is not good:

A problem occurred evaluating root project

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


(Luke Daley) #6

Sorry, it’s

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

(Juan Miguel Salamanca) #7

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


(naveenpaul904) #8

where to put this line of code?


(Luke Daley) #9

Anywhere after ‘apply plugin: “findbugs”’.