Package ro.isdc.wro.maven.plugin
Class AbstractLinterMojo<T>
java.lang.Object
org.apache.maven.plugin.AbstractMojo
ro.isdc.wro.maven.plugin.AbstractWro4jMojo
ro.isdc.wro.maven.plugin.AbstractSingleProcessorMojo
ro.isdc.wro.maven.plugin.AbstractLinterMojo<T>
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
CssLintMojo,JsHintMojo,JsLintMojo
Contains common behavior for mojos responsible for static code analysis, example: csslint, jslint, jshint.
Type <T> indicates the type of lint errors reported by this mojo.
- Since:
- 1.6.3
- Author:
- Alex Objelean, Paul Podgorsek
-
Field Summary
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidaddReport(ResourceLintReport<T> report) Add a single report to the registry of found errors.protected abstract ReportXmlFormattercreateXmlFormatter(LintReport<T> lintReport, ReportXmlFormatter.FormatterType type) protected final ProgressIndicatorprotected abstract Fileprotected abstract Stringprotected final booleanbooleanprotected voidInvoked right after execution completion.protected voidInvoked before execution is performed.protected final voidonProcessingResource(Resource resource) A method which should be invoked on each new resource processing, having as a side effect an increment of the counter holding the number of total processed resources.voidsetFailFast(boolean failFast) voidsetFailNever(boolean failNever) voidsetFailThreshold(int failThreshold) Methods inherited from class ro.isdc.wro.maven.plugin.AbstractSingleProcessorMojo
createResourceProcessor, doExecute, getOptions, newWroManagerFactory, wantProcessGroupMethods inherited from class ro.isdc.wro.maven.plugin.AbstractWro4jMojo
execute, extendPluginClasspath, getManagerFactory, getTargetGroupsAsList, getTaskExecutor, isIncrementalBuild, isIncrementalCheckRequired, isParallelProcessing, validateMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
AbstractLinterMojo
public AbstractLinterMojo()
-
-
Method Details
-
addReport
Add a single report to the registry of found errors.- Parameters:
report- to add.
-
onBeforeExecute
protected void onBeforeExecute()Description copied from class:AbstractWro4jMojoInvoked before execution is performed.- Overrides:
onBeforeExecutein classAbstractWro4jMojo
-
onAfterExecute
protected void onAfterExecute()Description copied from class:AbstractWro4jMojoInvoked right after execution completion. This method is invoked also if the execution failed with an exception.- Overrides:
onAfterExecutein classAbstractWro4jMojo
-
createXmlFormatter
protected abstract ReportXmlFormatter createXmlFormatter(LintReport<T> lintReport, ReportXmlFormatter.FormatterType type) - Returns:
- an instance of
ReportXmlFormatterresponsible for generating lint report.
-
onProcessingResource
A method which should be invoked on each new resource processing, having as a side effect an increment of the counter holding the number of total processed resources. -
isFailAllowed
protected final boolean isFailAllowed()- Returns:
- true if the build can fail due to found errors based on existing configuration.
-
getReportFile
- Returns:
- the file where the report should be written.
-
getReportFormat
- Returns:
- the preferred format of the report.
-
getProgressIndicator
-
setFailNever
public void setFailNever(boolean failNever) - Overrides:
setFailNeverin classAbstractSingleProcessorMojo- Parameters:
failNever- the failFast to set.
-
setFailThreshold
public void setFailThreshold(int failThreshold) -
isFailNever
public boolean isFailNever()- Overrides:
isFailNeverin classAbstractSingleProcessorMojo- Returns:
- the failNever flag.
-
setFailFast
public void setFailFast(boolean failFast) - Parameters:
failFast- flag to set.
-