Package org.apache.maven.plugins.pmd
Class AbstractPmdReport
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.reporting.AbstractMavenReport
org.apache.maven.plugins.pmd.AbstractPmdReport
- All Implemented Interfaces:
- org.apache.maven.plugin.ContextEnabled,- org.apache.maven.plugin.Mojo,- org.apache.maven.reporting.MavenMultiPageReport,- org.apache.maven.reporting.MavenReport
public abstract class AbstractPmdReport
extends org.apache.maven.reporting.AbstractMavenReport
Base class for the PMD reports.
- Version:
- $Id$
- Author:
- Brett Porter
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected booleanDeprecated.protected StringFile that lists classes and rules to be excluded from failures.protected Map<File,PmdFileInfo> The files that are being analyzed.protected StringSet the output format type, in addition to the HTML report.protected booleanRun PMD on the tests.protected booleanWhether to include the xml files generated by PMD/CPD in the site.protected List<org.apache.maven.project.MavenProject>The projects in the reactor for aggregation report.protected org.apache.maven.execution.MavenSessionThe current build session instance.protected booleanRedirect PMD log into maven log out.protected booleanSkip the PMD/CPD report generation if there are no violations or duplications found.protected FileThe output directory for the intermediate XML report.Fields inherited from class org.apache.maven.reporting.AbstractMavenReportlocalRepository, outputDirectory, project, remoteRepositories, siteRenderer, siteToolFields inherited from interface org.apache.maven.reporting.MavenReportCATEGORY_PROJECT_INFORMATION, CATEGORY_PROJECT_REPORTS, ROLEFields inherited from interface org.apache.maven.plugin.MojoROLE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanprotected StringconstructXRefLocation(boolean test) protected Stringprotected Collection<org.apache.maven.project.MavenProject>protected Map<File,PmdFileInfo> Convenience method to get the list of files where the PMD tool will be executedprotected org.apache.maven.project.MavenProjectprotected org.apache.maven.doxia.siterenderer.Rendererprotected final org.apache.maven.toolchain.Toolchainprotected booleanprotected booleanisXml()Methods inherited from class org.apache.maven.reporting.AbstractMavenReportcloseReport, execute, executeReport, generate, generate, generate, getCategoryName, getInputEncoding, getOutputDirectory, getOutputEncoding, getReportOutputDirectory, getSink, getSinkFactory, isExternalReport, setReportOutputDirectoryMethods inherited from class org.apache.maven.plugin.AbstractMojogetLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.reporting.MavenReportgetDescription, getName, getOutputName
- 
Field Details- 
targetDirectoryThe output directory for the intermediate XML report.
- 
formatSet the output format type, in addition to the HTML report. Must be one of: "none", "csv", "xml", "txt" or the full class name of the PMD renderer to use. See the net.sourceforge.pmd.renderers package javadoc for available renderers. XML is produced in any case, since this format is needed for the check goals (pmd:check, pmd:aggregator-check, pmd:cpd-check, pmd:aggregator-cpd-check).
- 
includeTests@Parameter(defaultValue="false") protected boolean includeTestsRun PMD on the tests.- Since:
- 2.2
 
- 
aggregateDeprecated.since 3.15.0 Use the goalspmd:aggregate-pmdandpmd:aggregate-cpdinstead.Whether to build an aggregated report at the root, or build individual reports.- Since:
- 2.2
 
- 
includeXmlInSite@Parameter(defaultValue="false") protected boolean includeXmlInSiteWhether to include the xml files generated by PMD/CPD in the site.- Since:
- 3.0
 
- 
skipEmptyReport@Parameter(defaultValue="false") protected boolean skipEmptyReportSkip the PMD/CPD report generation if there are no violations or duplications found. Defaults tofalse.Note: the default value was changed from truetofalsewith version 3.13.0.- Since:
- 3.1
 
- 
excludeFromFailureFile@Parameter(property="pmd.excludeFromFailureFile", defaultValue="") protected String excludeFromFailureFileFile that lists classes and rules to be excluded from failures. For PMD, this is a properties file. For CPD, this is a text file that contains comma-separated lists of classes that are allowed to duplicate.- Since:
- 3.7
 
- 
showPmdLog@Parameter(defaultValue="true", property="pmd.showPmdLog") protected boolean showPmdLogRedirect PMD log into maven log out. When enabled, the PMD log output is redirected to maven, so that it is visible in the console together with all the other log output. Also, if maven is started with the debug flag (-Xor--debug), the PMD logger is also configured for debug.- Since:
- 3.9.0
 
- 
reactorProjects@Parameter(property="reactorProjects", readonly=true) protected List<org.apache.maven.project.MavenProject> reactorProjectsThe projects in the reactor for aggregation report.
- 
session@Parameter(defaultValue="${session}", required=true, readonly=true) protected org.apache.maven.execution.MavenSession sessionThe current build session instance. This is used for toolchain manager API calls and for dependency resolver API calls.
- 
filesToProcessThe files that are being analyzed.
 
- 
- 
Constructor Details- 
AbstractPmdReportpublic AbstractPmdReport()
 
- 
- 
Method Details- 
getProjectprotected org.apache.maven.project.MavenProject getProject()- Overrides:
- getProjectin class- org.apache.maven.reporting.AbstractMavenReport
 
- 
getSiteRendererprotected org.apache.maven.doxia.siterenderer.Renderer getSiteRenderer()- Overrides:
- getSiteRendererin class- org.apache.maven.reporting.AbstractMavenReport
 
- 
constructXRefLocation
- 
getFilesToProcessConvenience method to get the list of files where the PMD tool will be executed- Returns:
- a List of the files where the PMD tool will be executed
- Throws:
- IOException- If an I/O error occurs during construction of the canonical pathnames of the files
 
- 
isXmlprotected boolean isXml()
- 
canGenerateReportpublic boolean canGenerateReport()- Specified by:
- canGenerateReportin interface- org.apache.maven.reporting.MavenReport
- Overrides:
- canGenerateReportin class- org.apache.maven.reporting.AbstractMavenReport
 
- 
determineCurrentRootLogLevel
- 
getToolchainprotected final org.apache.maven.toolchain.Toolchain getToolchain()
- 
isAggregatorprotected boolean isAggregator()
- 
getAggregatedProjects
 
- 
pmd:aggregate-pmdandpmd:aggregate-cpdinstead.