The FindBugs Plugin
The FindBugs plugin performs quality checks on your project’s Java source files using FindBugs and generates reports from these checks.
To use the FindBugs plugin, include the following in your build script:
apply plugin: 'findbugs'
The plugin adds a number of tasks to the project that perform the quality checks. You can execute the checks by running
Note that Findbugs will run with the same Java version used to run Gradle.
The FindBugs plugin adds the following tasks to the project:
Runs FindBugs against the production Java source files.
Runs FindBugs against the test Java source files.
Runs FindBugs against the given source set’s Java source files.
The FindBugs plugin adds the following dependencies to tasks defined by the Java plugin.
|Task name||Depends on|
All FindBugs tasks, including
The FindBugs plugin adds the following dependency configurations:
The FindBugs libraries to use
The HTML report generated by the FindBugs task can be customized using a XSLT stylesheet, for example to highlight specific errors or change its appearance: