Movatterモバイル変換


[0]ホーム

URL:


Previous|Contents|Next

Chapter 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 the following 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 runninggradle check.

33.2. Tasks

The PMD plugin adds the following tasks to the project:

Table 33.1. PMD plugin - tasks

Task nameDepends onTypeDescription
pmdMain-PmdRuns PMD against the production Java source files.
pmdTest-PmdRuns PMD against the test Java source files.
pmdSourceSet-PmdRuns PMD against the given source set's Java source files.

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

Table 33.2. PMD plugin - additional task dependencies

Task nameDepends on
checkAll PMD tasks, includingpmdMain andpmdTest.

33.3. Dependency management

The PMD plugin adds the following dependency configurations:

Table 33.3. PMD plugin - dependency configurations

NameMeaning
pmdThe PMD libraries to use

33.4. Configuration

See thePmdExtension class in the API documentation.

Previous|Contents|Next

[8]ページ先頭

©2009-2025 Movatter.jp