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:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
,org.apache.maven.reporting.MavenMultiPageReport
,org.apache.maven.reporting.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, includeXmlInReports, session, showPmdLog, skipEmptyReport, targetDirectory
Fields inherited from class org.apache.maven.reporting.AbstractMavenReport
locale, mojoExecution, outputDirectory, outputFormat, outputTimestamp, project, reactorProjects, remoteProjectRepositories, repoSession, siteDirectory, siteRenderer, siteTool
Fields inherited from interface org.apache.maven.reporting.MavenReport
CATEGORY_PROJECT_INFORMATION, CATEGORY_PROJECT_REPORTS, ROLE
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
ConstructorsConstructorDescriptionPmdReport
(org.codehaus.plexus.resource.ResourceManager locator, ConfigurationService configurationService, org.codehaus.plexus.i18n.I18N i18n, PmdServiceExecutor serviceExecutor) -
Method Summary
Modifier and TypeMethodDescriptionboolean
final net.sourceforge.pmd.renderers.Renderer
Deprecated.void
executeReport
(Locale locale) getDescription
(Locale locale) protected String
getI18nString
(Locale locale, String key) protected String
getLocationTemp
(String name, int position) Convenience method to get the location of the specified file name.Deprecated.void
setRulesets
(String[] rulesets) Configures the PMD rulesets to be used directly.Methods inherited from class org.apache.maven.plugins.pmd.AbstractPmdReport
canGenerateReportInternal, getAggregatedProjects, getFilesToProcess, getJdkToolchain, getMojoExecution, getProject, getReactorProjects, isAggregator, isXml
Methods inherited from class org.apache.maven.reporting.AbstractMavenReport
closeReport, constructXrefLocation, execute, generate, generate, getCategoryName, getInputEncoding, getLocale, getOutputDirectory, getOutputEncoding, getReportOutputDirectory, getSink, getSinkFactory, getSiteRenderer, getXrefLocation, isExternalReport, setReportOutputDirectory
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
PmdReport
@Inject public PmdReport(org.codehaus.plexus.resource.ResourceManager locator, ConfigurationService configurationService, org.codehaus.plexus.i18n.I18N i18n, PmdServiceExecutor serviceExecutor)
-
-
Method Details
-
getName
-
getDescription
-
getI18nString
- Parameters:
locale
- The localekey
- The key to search for- Returns:
- The text appropriate for the locale.
-
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:
-
executeReport
- Specified by:
executeReport
in classorg.apache.maven.reporting.AbstractMavenReport
- Throws:
org.apache.maven.reporting.MavenReportException
-
canGenerateReport
public boolean canGenerateReport() throws org.apache.maven.reporting.MavenReportException- Specified by:
canGenerateReport
in interfaceorg.apache.maven.reporting.MavenReport
- Overrides:
canGenerateReport
in classorg.apache.maven.reporting.AbstractMavenReport
- Throws:
org.apache.maven.reporting.MavenReportException
-
getLocationTemp
Convenience method to get the location of the specified file name.- Parameters:
name
- the name of the file whose location is to be resolvedposition
- position in the list of rulesets (1-based)- Returns:
- a String that contains the absolute file name of the file
-
getOutputName
Deprecated. -
getOutputPath
-
createRenderer
@Deprecated public final net.sourceforge.pmd.renderers.Renderer createRenderer() throws org.apache.maven.reporting.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:
org.apache.maven.reporting.MavenReportException
- if no renderer found for the output type
-
PmdExecutor.createRenderer(String, String)
instead.