org.apache.maven.plugin.pmd
Class CpdViolationCheckMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugin.pmd.AbstractPmdViolationCheckMojo<Duplication>
org.apache.maven.plugin.pmd.CpdViolationCheckMojo
- All Implemented Interfaces:
- ContextEnabled, Mojo
@Mojo(name="cpd-check",
defaultPhase=VERIFY,
threadSafe=true)
@Execute(goal="cpd")
public class CpdViolationCheckMojo
- extends AbstractPmdViolationCheckMojo<Duplication>
Fail the build if there were any CPD violations in the source code.
- Since:
- 2.0
- Version:
- $Id: CpdViolationCheckMojo.html 853015 2013-03-04 21:10:54Z olamy $
Field Summary |
protected boolean |
failOnViolation
Whether to fail the build if the validation check fails. |
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 |
failOnViolation
@Parameter(property="cpd.failOnViolation",
defaultValue="true",
required=true)
protected boolean failOnViolation
- Whether to fail the build if the validation check fails.
- Since:
- 3.0
CpdViolationCheckMojo
public CpdViolationCheckMojo()
execute
public void execute()
throws MojoExecutionException,
MojoFailureException
-
- Throws:
MojoExecutionException
MojoFailureException
printError
protected void printError(Duplication item,
String severity)
- Formats the failure details and prints them as an INFO message
- Specified by:
printError
in class AbstractPmdViolationCheckMojo<Duplication>
getErrorDetails
protected List<Duplication> getErrorDetails(File cpdFile)
throws XmlPullParserException,
IOException
- Gets the attributes and text for the violation tag and puts them in a
HashMap
- Specified by:
getErrorDetails
in class AbstractPmdViolationCheckMojo<Duplication>
- Throws:
XmlPullParserException
IOException
isExcludedFromFailure
protected boolean isExcludedFromFailure(Duplication errorDetail)
- Specified by:
isExcludedFromFailure
in class AbstractPmdViolationCheckMojo<Duplication>
loadExcludeFromFailuresData
protected void loadExcludeFromFailuresData(String excludeFromFailureFile)
throws MojoExecutionException
- Specified by:
loadExcludeFromFailuresData
in class AbstractPmdViolationCheckMojo<Duplication>
- Throws:
MojoExecutionException
getPriority
protected int getPriority(Duplication errorDetail)
- Specified by:
getPriority
in class AbstractPmdViolationCheckMojo<Duplication>
newViolationDetailsInstance
protected ViolationDetails<Duplication> newViolationDetailsInstance()
- Specified by:
newViolationDetailsInstance
in class AbstractPmdViolationCheckMojo<Duplication>
isFailOnViolation
public boolean isFailOnViolation()
- Overrides:
isFailOnViolation
in class AbstractPmdViolationCheckMojo<Duplication>
Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.