Package org.apache.maven.plugins.pmd
Klasse PmdViolationCheckMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.pmd.AbstractPmdViolationCheckMojo<Violation>
org.apache.maven.plugins.pmd.PmdViolationCheckMojo
- Alle implementierten Schnittstellen:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Bekannte direkte Unterklassen:
AggregatorPmdViolationCheckMojo
@Mojo(name="check",
defaultPhase=VERIFY,
threadSafe=true)
@Execute(goal="pmd")
public class PmdViolationCheckMojo
extends AbstractPmdViolationCheckMojo<Violation>
Fails the build if there were any PMD violations in the source code.
- Seit:
- 2.0
- Version:
- $Id$
-
Feldübersicht
Von Klasse geerbte Felder org.apache.maven.plugins.pmd.AbstractPmdViolationCheckMojo
aggregate, failOnViolation, projectVon Schnittstelle geerbte Felder org.apache.maven.plugin.Mojo
ROLE -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidexecute()getErrorDetails(File pmdFile) Gets the attributes and text for the violation tag and puts them in a HashMapprotected intgetPriority(Violation errorDetail) protected ViolationDetails<Violation> protected voidprintError(Violation 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, isFailOnViolation, printErrorsVon Klasse geerbte Methoden org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Konstruktordetails
-
PmdViolationCheckMojo
public PmdViolationCheckMojo()Default constructor. Initializes with the correctExcludeViolationsFromFile.
-
-
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<Violation>- Parameter:
item- either aViolationfrom PMD or aDuplicationfrom CPDseverity- the found issue is prefixed with the given severity, usually "Warning" or "Failure".
-
getErrorDetails
protected List<Violation> getErrorDetails(File pmdFile) throws org.codehaus.plexus.util.xml.pull.XmlPullParserException, IOException Beschreibung aus Klasse kopiert:AbstractPmdViolationCheckMojoGets the attributes and text for the violation tag and puts them in a HashMap- Angegeben von:
getErrorDetailsin KlasseAbstractPmdViolationCheckMojo<Violation>- Parameter:
pmdFile- 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<Violation>
-
newViolationDetailsInstance
- Angegeben von:
newViolationDetailsInstancein KlasseAbstractPmdViolationCheckMojo<Violation>
-