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, project
Von Schnittstelle geerbte Felder org.apache.maven.plugin.Mojo
ROLE
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
execute()
getErrorDetails
(File pmdFile) Gets the attributes and text for the violation tag and puts them in a HashMapprotected int
getPriority
(Violation errorDetail) protected ViolationDetails
<Violation> protected void
printError
(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, printErrors
Von 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.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
printError
Formats the failure details and prints them as an INFO message- Angegeben von:
printError
in KlasseAbstractPmdViolationCheckMojo<Violation>
- Parameter:
item
- either aViolation
from PMD or aDuplication
from 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:AbstractPmdViolationCheckMojo
Gets the attributes and text for the violation tag and puts them in a HashMap- Angegeben von:
getErrorDetails
in KlasseAbstractPmdViolationCheckMojo<Violation>
- Parameter:
pmdFile
- the xml output from PMD or CPD- Gibt zurück:
- all PMD
Violation
s or CPDDuplication
s. - 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:
getPriority
in KlasseAbstractPmdViolationCheckMojo<Violation>
-
newViolationDetailsInstance
- Angegeben von:
newViolationDetailsInstance
in KlasseAbstractPmdViolationCheckMojo<Violation>
-