ContextEnabled
, Mojo
@Mojo(name="check", defaultPhase=VERIFY, threadSafe=true) @Execute(goal="pmd") public class PmdViolationCheckMojo extends AbstractPmdViolationCheckMojo<Violation>
aggregate, failOnViolation, project
Constructor | Description |
---|---|
PmdViolationCheckMojo() |
Default constructor.
|
Modifier and Type | Method | Description |
---|---|---|
void |
execute() |
|
protected java.util.List<Violation> |
getErrorDetails(java.io.File pmdFile) |
Gets the attributes and text for the violation tag and puts them in a HashMap
|
protected int |
getPriority(Violation errorDetail) |
|
protected ViolationDetails<Violation> |
newViolationDetailsInstance() |
|
protected void |
printError(Violation item,
java.lang.String severity) |
Formats the failure details and prints them as an INFO message
|
getLog, getPluginContext, setLog, setPluginContext
executeCheck, getMaxAllowedViolations, isFailOnViolation, printErrors
public PmdViolationCheckMojo()
ExcludeViolationsFromFile
.public void execute() throws MojoExecutionException, MojoFailureException
protected void printError(Violation item, java.lang.String severity)
printError
in class AbstractPmdViolationCheckMojo<Violation>
item
- either a Violation
from PMD
or a Duplication
from CPDseverity
- the found issue is prefixed with the given severity, usually "Warning" or "Failure".protected java.util.List<Violation> getErrorDetails(java.io.File pmdFile) throws XmlPullParserException, java.io.IOException
AbstractPmdViolationCheckMojo
getErrorDetails
in class AbstractPmdViolationCheckMojo<Violation>
pmdFile
- the xml output from PMD or CPDViolation
s
or CPD Duplication
s.XmlPullParserException
- if the analysis file contains invalid XMLjava.io.IOException
- if the analysis file could be readprotected int getPriority(Violation errorDetail)
getPriority
in class AbstractPmdViolationCheckMojo<Violation>
protected ViolationDetails<Violation> newViolationDetailsInstance()
newViolationDetailsInstance
in class AbstractPmdViolationCheckMojo<Violation>
Copyright © 2005–2018 The Apache Software Foundation. All rights reserved.