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

      public PmdReport()
  • Method Details

    • getName

      public String getName(Locale locale)
    • getDescription

      public String getDescription(Locale 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()
      Description copied from class: AbstractPmdReport
      Specified by:
      canGenerateReport in interface org.apache.maven.reporting.MavenReport
      Overrides:
      canGenerateReport in class AbstractPmdReport
    • getSourceEncoding

      protected String getSourceEncoding()
      Overrides:
      getSourceEncoding in class AbstractPmdReport
    • getLocationTemp

      protected String getLocationTemp(String name)
      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

      public String getOutputName()
    • 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