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
  • 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

      public String getName(Locale locale)
    • getDescription

      public String getDescription(Locale locale)
    • getI18nString

      protected String getI18nString(Locale locale, String key)
      Parameters:
      locale - The locale
      key - The key to search for
      Returns:
      The text appropriate for the locale.
    • setRulesets

      public void setRulesets(String[] rulesets)
      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

      public void executeReport(Locale locale) throws org.apache.maven.reporting.MavenReportException
      Specified by:
      executeReport in class org.apache.maven.reporting.AbstractMavenReport
      Throws:
      org.apache.maven.reporting.MavenReportException
    • canGenerateReport

      public boolean canGenerateReport() throws org.apache.maven.reporting.MavenReportException
      Specified by:
      canGenerateReport in interface org.apache.maven.reporting.MavenReport
      Overrides:
      canGenerateReport in class org.apache.maven.reporting.AbstractMavenReport
      Throws:
      org.apache.maven.reporting.MavenReportException
    • getLocationTemp

      protected String getLocationTemp(String name, int position)
      Convenience method to get the location of the specified file name.
      Parameters:
      name - the name of the file whose location is to be resolved
      position - position in the list of rulesets (1-based)
      Returns:
      a String that contains the absolute file name of the file
    • getOutputName

      @Deprecated public String getOutputName()
      Deprecated.
    • getOutputPath

      public String getOutputPath()
    • createRenderer

      @Deprecated public final net.sourceforge.pmd.renderers.Renderer createRenderer() throws org.apache.maven.reporting.MavenReportException
      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