Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Gradle FindBugs plug-in


May 25, 2021 Gradle


Table of contents


FindBugs plug-in

The FindBugs plug-in uses FindBugs to perform quality checks on the project's Java source files and generate reports from the results of the checks.

Usage

To use the FindBugs plug-in, include the following statement in the build script:

Use the FindBugs plug-in

build.gradle

apply plugin: 'findbugs'  

The plug-in adds a lot of quality checks to your project. You can perform a check by running the gradle check.

Task

The FindBugs plug-in adds the following tasks to the project:

Table 31.1. FindBugs Plug-in - Task

The name of the task Depends on Type Describe
findbugsMain classes Findbugs Run FindBugs for production Java source files.
findbugsTest testClasses Findbugs Run FindBugs against the test Java source file.
SourceSet sourceSet Classes Findbugs Run FindBugs against the Java source file for source set.

The FindBugs plug-in adds the following dependencies to the tasks that the Java plug-in joins.

Table 31.2. FindBugs plug-in - Additional task dependency

The name of the task Depends on
check All FindBugs tasks, findbugsTest

Rely on management

The FindBugs plug-in adds the following dependency configurations:

Table 31.3. FindBugs plug-in - Dependent on configuration

Name Significance
findbugs The FindBugs library used