ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 01.01.2026

Просмотров: 1143

Скачиваний: 0

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

Table 29.2. Checkstyle plugin - additional task dependencies

Task name

Depends on

check

All Checkstyle tasks, including checkstyleMain and checkstyleTest.

29.3. Project layout

The Checkstyle plugin expects the following project layout:

Table 29.3. Checkstyle plugin - project layout

File

Meaning

config/checkstyle/checkstyle.xml

Checkstyle configuration file

29.4. Dependency management

The Checkstyle plugin adds the following dependency configurations:

Table 29.4. Checkstyle plugin - dependency configurations

Name Meaning

checkstyle The Checkstyle libraries to use

29.5. Configuration

See CheckstyleExtension.

Page 176 of 343

30

The CodeNarc Plugin

The CodeNarc plugin performs quality checks on your project's Groovy source files using CodeNarc and generates reports from these checks.

30.1. Usage

To use the CodeNarc plugin, include in your build script:

Example 30.1. Using the CodeNarc plugin

build.gradle

apply plugin: 'codenarc'

The plugin adds a number of tasks to the project that perform the quality checks. You can execute the checks by running gradle check.

30.2. Tasks

The CodeNarc plugin adds the following tasks to the project:

Table 30.1. CodeNarc plugin - tasks

Task name

Depends

Type

Description

 

on

 

 

codenarcMain

-

CodeNarc

Runs CodeNarc against the production Groovy

 

 

 

source files.

codenarcTest

-

CodeNarc

Runs CodeNarc against the test Groovy

 

 

 

source files.

codenarcSourceSet-

CodeNarc

Runs CodeNarc against the given source set's

 

 

 

Groovy source files.

The CodeNarc plugin adds the following dependencies to tasks defined by the Groovy plugin.

Page 177 of 343


Table 30.2. CodeNarc plugin - additional task dependencies

Task name

Depends on

check

All CodeNarc tasks, including codenarcMain and codenarcTest.

30.3. Project layout

The CodeNarc plugin expects the following project layout:

Table 30.3. CodeNarc plugin - project layout

File

Meaning

config/codenarc/codenarc.xml

CodeNarc configuration file

30.4. Dependency management

The CodeNarc plugin adds the following dependency configurations:

Table 30.4. CodeNarc plugin - dependency configurations

Name Meaning

codenarc The CodeNarc libraries to use

30.5. Configuration

See CodeNarcExtension.

Page 178 of 343

31

The FindBugs Plugin

The FindBugs plugin performs quality checks on your project's Java source files usingFindBugs and generates reports from these checks.

31.1. Usage

To use the FindBugs plugin, include in your build script:

Example 31.1. Using the FindBugs plugin

build.gradle

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 gradle check.

31.2. Tasks

The FindBugs plugin adds the following tasks to the project:

Table 31.1. FindBugs plugin - tasks

Task name

Depends on

Type

Description

findbugsMain

classes

FindBugs

Runs FindBugs against the production

 

 

 

Java source files.

findbugsTest

testClasses

FindBugs

Runs FindBugs against the test Java

 

 

 

source files.

findbugsSourceSetsourceSetClassFindBugses

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.

Page 179 of 343



Table 31.2. FindBugs plugin - additional task dependencies

Task name

Depends on

check

All FindBugs tasks, including findbugsMain and findbugsTest.

31.3. Dependency management

The FindBugs plugin adds the following dependency configurations:

Table 31.3. FindBugs plugin - dependency configurations

Name Meaning

findbugs The FindBugs libraries to use

31.4. Configuration

See FindBugsExtension.

Page 180 of 343

32

The JDepend Plugin

The JDepend plugin performs quality checks on your project's source files usingJDepend and generates reports from these checks.

32.1. Usage

To use the JDepend plugin, include in your build script:

Example 32.1. Using the JDepend plugin

build.gradle

apply plugin: 'jdepend'

The plugin adds a number of tasks to the project that perform the quality checks. You can execute the checks by running gradle check.

32.2. Tasks

The JDepend plugin adds the following tasks to the project:

Table 32.1. JDepend plugin - tasks

Task name

Depends on

Type

Description

jdependMain

classes

JDepend

Runs JDepend against the production Java

 

 

 

source files.

jdependTest

testClasses

JDepend

Runs JDepend against the test Java source

 

 

 

files.

jdependSourceSetsourceSetClassesJDepend

Runs JDepend against the given source

 

 

 

set's Java source files.

The JDepend plugin adds the following dependencies to tasks defined by the Java plugin.

Page 181 of 343

Table 32.2. JDepend plugin - additional task dependencies

Task name

Depends on

check

All JDepend tasks, including jdependMain and jdependTest.

32.3. Dependency management

The JDepend plugin adds the following dependency configurations:

Table 32.3. JDepend plugin - dependency configurations

Name Meaning

jdepend The JDepend libraries to use

32.4. Configuration

See JDependExtension.

Page 182 of 343


33

The PMD Plugin

The PMD plugin performs quality checks on your project's Java source files usingPMD and generates reports from these checks.

33.1. Usage

To use the PMD plugin, include in your build script:

Example 33.1. Using the PMD plugin

build.gradle

apply plugin: 'pmd'

The plugin adds a number of tasks to the project that perform the quality checks. You can execute the checks by running gradle check.

33.2. Tasks

The PMD plugin adds the following tasks to the project:

Table 33.1. PMD plugin - tasks

Task name

Depends

Type

Description

 

on

 

 

pmdMain

-

Pmd

Runs PMD against the production Java source files.

pmdTest

-

Pmd

Runs PMD against the test Java source files.

pmdSourceSet

-

Pmd

Runs PMD against the given source set's Java

 

 

 

source files.

The PMD plugin adds the following dependencies to tasks defined by the Java plugin.

Page 183 of 343