org.apache.maven.plugin.pmd
Class PmdViolationCheckMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.pmd.AbstractPmdViolationCheckMojo<Violation>
          extended by org.apache.maven.plugin.pmd.PmdViolationCheckMojo
All Implemented Interfaces:
ContextEnabled, Mojo

@Mojo(name="check",
      defaultPhase=VERIFY,
      threadSafe=true)
@Execute(goal="pmd")
public class PmdViolationCheckMojo
extends AbstractPmdViolationCheckMojo<Violation>

Fail the build if there were any PMD violations in the source code.

Since:
2.0
Version:
$Id: PmdViolationCheckMojo.html 901148 2014-03-11 20:12:51Z dennisl $

Field Summary
 
Fields inherited from class org.apache.maven.plugin.pmd.AbstractPmdViolationCheckMojo
aggregate, failOnViolation, project
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
PmdViolationCheckMojo()
           
 
Method Summary
 void execute()
          
protected  List<Violation> getErrorDetails(File pmdFile)
          Gets the attributes and text for the violation tag and puts them in a HashMap
protected  int getPriority(Violation errorDetail)
           
protected  boolean isExcludedFromFailure(Violation errorDetail)
           
protected  void loadExcludeFromFailuresData(String excludeFromFailureFile)
           
protected  ViolationDetails<Violation> newViolationDetailsInstance()
           
protected  void printError(Violation item, String severity)
          Formats the failure details and prints them as an INFO message
 
Methods inherited from class org.apache.maven.plugin.pmd.AbstractPmdViolationCheckMojo
executeCheck, isFailOnViolation, printErrors
 
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
 

Constructor Detail

PmdViolationCheckMojo

public PmdViolationCheckMojo()
Method Detail

execute

public void execute()
             throws MojoExecutionException,
                    MojoFailureException

Throws:
MojoExecutionException
MojoFailureException

loadExcludeFromFailuresData

protected void loadExcludeFromFailuresData(String excludeFromFailureFile)
                                    throws MojoExecutionException
Specified by:
loadExcludeFromFailuresData in class AbstractPmdViolationCheckMojo<Violation>
Throws:
MojoExecutionException

isExcludedFromFailure

protected boolean isExcludedFromFailure(Violation errorDetail)
Specified by:
isExcludedFromFailure in class AbstractPmdViolationCheckMojo<Violation>

printError

protected void printError(Violation item,
                          String severity)
Formats the failure details and prints them as an INFO message

Specified by:
printError in class AbstractPmdViolationCheckMojo<Violation>

getErrorDetails

protected List<Violation> getErrorDetails(File pmdFile)
                                   throws XmlPullParserException,
                                          IOException
Description copied from class: AbstractPmdViolationCheckMojo
Gets the attributes and text for the violation tag and puts them in a HashMap

Specified by:
getErrorDetails in class AbstractPmdViolationCheckMojo<Violation>
Throws:
XmlPullParserException
IOException

getPriority

protected int getPriority(Violation errorDetail)
Specified by:
getPriority in class AbstractPmdViolationCheckMojo<Violation>

newViolationDetailsInstance

protected ViolationDetails<Violation> newViolationDetailsInstance()
Specified by:
newViolationDetailsInstance in class AbstractPmdViolationCheckMojo<Violation>


Copyright © 2005–2014 The Apache Software Foundation. All rights reserved.