Package org.apache.maven.plugins.pmd
Class PmdReport
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.reporting.AbstractMavenReport
org.apache.maven.plugins.pmd.AbstractPmdReport
org.apache.maven.plugins.pmd.PmdReport
- All Implemented Interfaces:
ContextEnabled
,Mojo
,MavenMultiPageReport
,MavenReport
- Direct Known Subclasses:
AggregatorPmdReport
@Mojo(name="pmd",
threadSafe=true,
requiresDependencyResolution=TEST)
public class PmdReport
extends AbstractPmdReport
Creates a PMD site report based on the rulesets and configuration set in the plugin.
It can also generate a pmd output file aside from the site report in any of the following formats: xml, csv or txt.
- Since:
- 2.0
- Version:
- $Id$
- Author:
- Brett Porter
-
Field Summary
Fields inherited from class org.apache.maven.plugins.pmd.AbstractPmdReport
aggregate, excludeFromFailureFile, filesToProcess, format, includeTests, includeXmlInSite, outputDirectory, project, reactorProjects, session, showPmdLog, skipEmptyReport, targetDirectory
Fields inherited from interface org.apache.maven.reporting.MavenReport
CATEGORY_PROJECT_INFORMATION, CATEGORY_PROJECT_REPORTS, ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
final net.sourceforge.pmd.renderers.Renderer
Deprecated.void
executeReport
(Locale locale) getDescription
(Locale locale) protected String
getLocationTemp
(String name) Convenience method to get the location of the specified file name.protected String
void
setRulesets
(String[] rulesets) Configures the PMD rulesets to be used directly.Methods inherited from class org.apache.maven.plugins.pmd.AbstractPmdReport
constructXRefLocation, determineCurrentRootLogLevel, getAggregatedProjects, getFilesToProcess, getOutputDirectory, getOutputEncoding, getProject, getSiteRenderer, getToolchain, isAggregator, isXml
Methods inherited from class org.apache.maven.reporting.AbstractMavenReport
closeReport, execute, generate, generate, generate, getCategoryName, getInputEncoding, getReportOutputDirectory, getSink, getSinkFactory, isExternalReport, setReportOutputDirectory
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
PmdReport
public PmdReport()
-
-
Method Details
-
getName
-
getDescription
-
setRulesets
Configures the PMD rulesets to be used directly. Note: Usually the rulesets are configured via the property.- Parameters:
rulesets
- the PMD rulesets to be used.- See Also:
-
rulesets
-
executeReport
- Specified by:
executeReport
in classAbstractMavenReport
- Throws:
MavenReportException
-
canGenerateReport
public boolean canGenerateReport()Description copied from class:AbstractPmdReport
- Specified by:
canGenerateReport
in interfaceMavenReport
- Overrides:
canGenerateReport
in classAbstractPmdReport
-
getSourceEncoding
- Overrides:
getSourceEncoding
in classAbstractPmdReport
-
getLocationTemp
Convenience method to get the location of the specified file name.- Parameters:
name
- the name of the file whose location is to be resolved- Returns:
- a String that contains the absolute file name of the file
-
getOutputName
-
createRenderer
@Deprecated public final net.sourceforge.pmd.renderers.Renderer createRenderer() throws MavenReportExceptionDeprecated.UsePmdExecutor.createRenderer(String, String)
instead.Create and return the correct renderer for the output type.- Returns:
- the renderer based on the configured output
- Throws:
MavenReportException
- if no renderer found for the output type
-
PmdExecutor.createRenderer(String, String)
instead.