May 25, 2021 Gradle
The PMD plug-in uses PMD to perform a quality check on the project's Java source file and generate a report from the results of the check.
To use the PMD plug-in, include the following statement in the build script:
Use the PMD plug-in
build.gradle
apply plugin: 'pmd'
The plug-in adds a lot of quality checks to your project. You can perform a check by running the gradle check.
The PMD plug-in adds the following tasks to the project:
Table 33.1. PMD plug-in - task
The name of the task | Depends on | Type | Describe |
pmdMain
|
- | Pmd | Run PMD for production Java source files. |
pmdTest
|
- | Pmd | Run PMD against the test Java source file. |
SourceSet
|
- | Pmd | Run PMD on the Java source file for source set. |
The PMD plug-in adds the following dependencies to the tasks that the Java plug-in joins.
Table 33.2. PMD plug-in - additional task dependency
The name of the task | Depends on |
check
|
All PMD tasks,
pmdTest
|
The PMD plug-in adds the following dependency configurations:
Table 33.3. PMD Plug-in - Dependent on configuration
Name | Significance |
pmd
|
The PMD library used |