# PmdPlugin

abstract class PmdPlugin : AbstractCodeQualityPlugin<Pmd> (source)

A plugin for the PMD source code analyzer.

Declares a `pmd` configuration which needs to be configured with the PMD library to be used.

Declares a `pmdAux` configuration to add transitive compileOnly dependencies to the PMD's auxclasspath. This is only needed if PMD complains about NoClassDefFoundError during type resolution.

For each source set that is to be analyzed, a Pmd task is created and configured to analyze all Java code.

All PMD tasks (including user-defined ones) are added to the `check` lifecycle task.

#### See also

PmdExtension
Pmd

PMD plugin reference

## Constructors

PmdPlugin
Link copied to clipboard
constructor()

## Properties

DEFAULT_PMD_VERSION
Link copied to clipboard
val DEFAULT_PMD_VERSION: String = "7.24.0"

## Functions

apply
Link copied to clipboard
abstract fun apply(target: T)
fun apply(project: ProjectInternal)
Apply this plugin to the given target object.
getDefaultTargetJdk
Link copied to clipboard
open fun getDefaultTargetJdk(javaVersion: JavaVersion): TargetJdk
Returns the default TargetJdk for the given Java source compatibility version.