org.apache.maven.plugin.pmd
Class AbstractPmdViolationCheckMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugin.pmd.AbstractPmdViolationCheckMojo
- All Implemented Interfaces:
- ContextEnabled, Mojo
- Direct Known Subclasses:
- CpdViolationCheckMojo, PmdViolationCheckMojo
public abstract class AbstractPmdViolationCheckMojo
- extends AbstractMojo
Base class for mojos that check if there were any PMD violations.
- Version:
- $Id: AbstractPmdViolationCheckMojo.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 MavenProject |
project
The project to analyze. |
Fields inherited from interface org.apache.maven.plugin.Mojo |
ROLE |
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.plugin.Mojo |
execute |
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
project
protected MavenProject project
- The project to analyze.
- Is defined by:
- expression:
- ${project}
- Is readonly.
- Is required.
AbstractPmdViolationCheckMojo
public AbstractPmdViolationCheckMojo()
executeCheck
protected void executeCheck(String filename,
String tagName,
String key,
int failurePriority)
throws MojoFailureException,
MojoExecutionException
- Throws:
MojoFailureException
MojoExecutionException
printErrors
protected void printErrors(List failures,
List warnings)
- Prints the warnings and failures
- Parameters:
failures
- list of failureswarnings
- list of warnings
printError
protected abstract void printError(Map item,
String severity)
- Formats the failure details and prints them as an INFO message
- Parameters:
item
-
getErrorDetails
protected abstract Map getErrorDetails(XmlPullParser xpp)
throws XmlPullParserException,
IOException
- Gets the attributes and text for the violation tag and puts them in a
HashMap
- Parameters:
xpp
-
- Throws:
XmlPullParserException
IOException
Copyright © 2005-2011 The Apache Software Foundation. All Rights Reserved.