Package org.apache.maven.plugins.pmd
Klasse CpdViolationCheckMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.pmd.AbstractPmdViolationCheckMojo<Duplication>
org.apache.maven.plugins.pmd.CpdViolationCheckMojo
- Alle implementierten Schnittstellen:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Bekannte direkte Unterklassen:
AggregatorCpdViolationCheckMojo
@Mojo(name="cpd-check",
defaultPhase=VERIFY,
threadSafe=true)
@Execute(goal="cpd")
public class CpdViolationCheckMojo
extends AbstractPmdViolationCheckMojo<Duplication>
Fails the build if there were any CPD violations in the source code.
- Seit:
- 2.0
- Version:
- $Id$
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected booleanWhether to fail the build if the validation check fails.Von Klasse geerbte Felder org.apache.maven.plugins.pmd.AbstractPmdViolationCheckMojo
aggregate, projectVon Schnittstelle geerbte Felder org.apache.maven.plugin.Mojo
ROLE -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidexecute()protected List<Duplication> getErrorDetails(File cpdFile) Gets the attributes and text for the violation tag and puts them in a HashMapprotected intgetPriority(Duplication errorDetail) booleanprotected ViolationDetails<Duplication> protected voidprintError(Duplication item, String severity) Formats the failure details and prints them as an INFO messageVon Klasse geerbte Methoden org.apache.maven.plugins.pmd.AbstractPmdViolationCheckMojo
executeCheck, getMaxAllowedViolations, isAggregator, printErrorsVon Klasse geerbte Methoden org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Felddetails
-
failOnViolation
@Parameter(property="cpd.failOnViolation", defaultValue="true", required=true) protected boolean failOnViolationWhether to fail the build if the validation check fails.- Seit:
- 3.0
-
-
Konstruktordetails
-
CpdViolationCheckMojo
public CpdViolationCheckMojo()Default constructor. Initializes with the correctExcludeDuplicationsFromFile.
-
-
Methodendetails
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Löst aus:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
printError
Formats the failure details and prints them as an INFO message- Angegeben von:
printErrorin KlasseAbstractPmdViolationCheckMojo<Duplication>- Parameter:
item- either aViolationfrom PMD or aDuplicationfrom CPDseverity- the found issue is prefixed with the given severity, usually "Warning" or "Failure".
-
getErrorDetails
protected List<Duplication> getErrorDetails(File cpdFile) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException, IOException Gets the attributes and text for the violation tag and puts them in a HashMap- Angegeben von:
getErrorDetailsin KlasseAbstractPmdViolationCheckMojo<Duplication>- Parameter:
cpdFile- the xml output from PMD or CPD- Gibt zurück:
- all PMD
Violations or CPDDuplications. - Löst aus:
org.codehaus.plexus.util.xml.pull.XmlPullParserException- if the analysis file contains invalid XMLIOException- if the analysis file could be read
-
getPriority
- Angegeben von:
getPriorityin KlasseAbstractPmdViolationCheckMojo<Duplication>
-
newViolationDetailsInstance
- Angegeben von:
newViolationDetailsInstancein KlasseAbstractPmdViolationCheckMojo<Duplication>
-
isFailOnViolation
public boolean isFailOnViolation()- Setzt außer Kraft:
isFailOnViolationin KlasseAbstractPmdViolationCheckMojo<Duplication>
-