Package org.gradle.api.plugins.quality
Class PmdPlugin
- java.lang.Object
-
- org.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
-
- org.gradle.api.plugins.quality.PmdPlugin
-
- All Implemented Interfaces:
Plugin<org.gradle.api.internal.project.ProjectInternal>
public abstract class PmdPlugin extends org.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_PMD_VERSION
-
Constructor Summary
Constructors Constructor Description PmdPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureConfiguration(Configuration configuration)
protected void
configureForSourceSet(SourceSet sourceSet, Pmd task)
protected void
configureTaskDefaults(Pmd task, java.lang.String baseName)
protected void
createConfigurations()
protected CodeQualityExtension
createExtension()
TargetJdk
getDefaultTargetJdk(JavaVersion javaVersion)
protected java.lang.Class<Pmd>
getTaskType()
protected JavaToolchainService
getToolchainService()
protected java.lang.String
getToolName()
-
-
-
Field Detail
-
DEFAULT_PMD_VERSION
public static final java.lang.String DEFAULT_PMD_VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
getToolName
protected java.lang.String getToolName()
- Specified by:
getToolName
in classorg.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
-
getTaskType
protected java.lang.Class<Pmd> getTaskType()
- Specified by:
getTaskType
in classorg.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
-
getToolchainService
@Inject protected JavaToolchainService getToolchainService()
-
createExtension
protected CodeQualityExtension createExtension()
- Specified by:
createExtension
in classorg.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
-
getDefaultTargetJdk
public TargetJdk getDefaultTargetJdk(JavaVersion javaVersion)
-
createConfigurations
protected void createConfigurations()
- Overrides:
createConfigurations
in classorg.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
-
configureConfiguration
protected void configureConfiguration(Configuration configuration)
- Specified by:
configureConfiguration
in classorg.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
-
configureTaskDefaults
protected void configureTaskDefaults(Pmd task, java.lang.String baseName)
- Overrides:
configureTaskDefaults
in classorg.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin<Pmd>
-
-