org.apache.maven.plugin.pmd
Class AbstractPmdReport

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.reporting.AbstractMavenReport
          extended by org.apache.maven.plugin.pmd.AbstractPmdReport
All Implemented Interfaces:
ContextEnabled, Mojo, MavenMultiPageReport, MavenReport
Direct Known Subclasses:
CpdReport, PmdReport

public abstract class AbstractPmdReport
extends AbstractMavenReport

Base class for the PMD reports.

Version:
$Id: AbstractPmdReport.html 816691 2012-05-08 15:16:42Z hboutemy $
Author:
Brett Porter

Field Summary
protected  boolean aggregate
          Whether to build an aggregated report at the root, or build individual reports.
protected  String format
          Set the output format type, in addition to the HTML report.
protected  boolean includeTests
          Run PMD on the tests.
protected  File outputDirectory
          The output directory for the final HTML report.
protected  MavenProject project
          The project to analyse.
protected  List reactorProjects
          The projects in the reactor for aggregation report.
protected  File targetDirectory
          The output directory for the intermediate XML report.
 
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
AbstractPmdReport()
           
 
Method Summary
 boolean canGenerateReport()
          
protected  String constructXRefLocation(boolean test)
           
protected  Map getFilesToProcess()
          Convenience method to get the list of files where the PMD tool will be executed
protected  String getOutputDirectory()
          
protected  String getOutputEncoding()
          Gets the effective reporting output files encoding.
protected  MavenProject getProject()
          
protected  Renderer getSiteRenderer()
          
protected  String getSourceEncoding()
           
protected  boolean isHtml()
           
 
Methods inherited from class org.apache.maven.reporting.AbstractMavenReport
closeReport, execute, executeReport, generate, generate, generate, getCategoryName, getReportOutputDirectory, getSink, getSinkFactory, isExternalReport, setReportOutputDirectory
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.reporting.MavenReport
getDescription, getName, getOutputName
 

Field Detail

targetDirectory

protected File targetDirectory
The output directory for the intermediate XML report.

Is defined by:
expression:
${project.build.directory}
Is required.

outputDirectory

protected File outputDirectory
The output directory for the final HTML report. Note that this parameter is only evaluated if the goal is run directly from the command line or during the default lifecycle. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.

Is defined by:
expression:
${project.reporting.outputDirectory}
Is required.

project

protected MavenProject project
The project to analyse.

Is defined by:
expression:
${project}
Is readonly.
Is required.

format

protected String format
Set 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 required if the pmd:check goal is being used.

Is defined by:
expression:
${format}
default-value:
xml

includeTests

protected boolean includeTests
Run PMD on the tests.

Since:
2.2
Is defined by:
default-value:
false

aggregate

protected boolean aggregate
Whether to build an aggregated report at the root, or build individual reports.

Since:
2.2
Is defined by:
expression:
${aggregate}
default-value:
false

reactorProjects

protected List reactorProjects
The projects in the reactor for aggregation report.

Is defined by:
expression:
${reactorProjects}
Is readonly.
Constructor Detail

AbstractPmdReport

public AbstractPmdReport()
Method Detail

getProject

protected MavenProject getProject()

Specified by:
getProject in class AbstractMavenReport

getSiteRenderer

protected Renderer getSiteRenderer()

Specified by:
getSiteRenderer in class AbstractMavenReport

constructXRefLocation

protected String constructXRefLocation(boolean test)

getFilesToProcess

protected Map getFilesToProcess()
                         throws IOException
Convenience 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

isHtml

protected boolean isHtml()

canGenerateReport

public boolean canGenerateReport()

Specified by:
canGenerateReport in interface MavenReport
Overrides:
canGenerateReport in class AbstractMavenReport

getOutputDirectory

protected String getOutputDirectory()

Specified by:
getOutputDirectory in class AbstractMavenReport

getSourceEncoding

protected String getSourceEncoding()

getOutputEncoding

protected String getOutputEncoding()
Gets the effective reporting output files encoding.

Returns:
The effective reporting output file encoding, never null.
Since:
2.5


Copyright © 2005-2011 The Apache Software Foundation. All Rights Reserved.