@Mojo(name="cpd-check",
defaultPhase=VERIFY,
threadSafe=true)
@Execute(goal="cpd")
public class CpdViolationCheckMojo
extends AbstractPmdViolationCheckMojo<Duplication>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
failOnViolation
Whether to fail the build if the validation check fails.
|
aggregate, project| Constructor and Description |
|---|
CpdViolationCheckMojo()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute() |
protected List<Duplication> |
getErrorDetails(File cpdFile)
Gets the attributes and text for the violation tag and puts them in a HashMap
|
protected int |
getPriority(Duplication errorDetail) |
boolean |
isFailOnViolation() |
protected ViolationDetails<Duplication> |
newViolationDetailsInstance() |
protected void |
printError(Duplication item,
String severity)
Formats the failure details and prints them as an INFO message
|
executeCheck, getMaxAllowedViolations, isAggregator, printErrors@Parameter(property="cpd.failOnViolation",
defaultValue="true",
required=true)
protected boolean failOnViolation
public CpdViolationCheckMojo()
ExcludeDuplicationsFromFile.public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected void printError(Duplication item, String severity)
printError in class AbstractPmdViolationCheckMojo<Duplication>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 List<Duplication> getErrorDetails(File cpdFile) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException, IOException
getErrorDetails in class AbstractPmdViolationCheckMojo<Duplication>cpdFile - the xml output from PMD or CPDViolations
or CPD Duplications.org.codehaus.plexus.util.xml.pull.XmlPullParserException - if the analysis file contains invalid XMLIOException - if the analysis file could be readprotected int getPriority(Duplication errorDetail)
getPriority in class AbstractPmdViolationCheckMojo<Duplication>protected ViolationDetails<Duplication> newViolationDetailsInstance()
newViolationDetailsInstance in class AbstractPmdViolationCheckMojo<Duplication>public boolean isFailOnViolation()
isFailOnViolation in class AbstractPmdViolationCheckMojo<Duplication>Copyright © 2005–2024 The Apache Software Foundation. All rights reserved.