Plugin<org.gradle.api.internal.project.ProjectInternal>
public class PmdPlugin extends org.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
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.
PmdExtension
,
Pmd
,
PMD plugin referenceModifier and Type | Field | Description |
---|---|---|
static String |
DEFAULT_PMD_VERSION |
Constructor | Description |
---|---|
PmdPlugin() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
configureConfiguration(Configuration configuration) |
|
protected void |
configureForSourceSet(SourceSet sourceSet,
Pmd task) |
|
protected void |
configureTaskDefaults(Pmd task,
String baseName) |
|
protected void |
createConfigurations() |
|
protected CodeQualityExtension |
createExtension() |
|
TargetJdk |
getDefaultTargetJdk(JavaVersion javaVersion) |
|
protected org.gradle.api.plugins.jvm.internal.JvmPluginServices |
getJvmPluginServices() |
|
protected Class<Pmd> |
getTaskType() |
|
protected String |
getToolName() |
public static final String DEFAULT_PMD_VERSION
@Inject protected org.gradle.api.plugins.jvm.internal.JvmPluginServices getJvmPluginServices()
protected String getToolName()
getToolName
in class org.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
protected Class<Pmd> getTaskType()
getTaskType
in class org.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
protected CodeQualityExtension createExtension()
createExtension
in class org.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
public TargetJdk getDefaultTargetJdk(JavaVersion javaVersion)
protected void createConfigurations()
createConfigurations
in class org.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
protected void configureConfiguration(Configuration configuration)
configureConfiguration
in class org.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
protected void configureTaskDefaults(Pmd task, String baseName)
configureTaskDefaults
in class org.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>