Class AbstractLinterMojo<T>

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    CssLintMojo, JsHintMojo, JsLintMojo

    public abstract class AbstractLinterMojo<T>
    extends AbstractSingleProcessorMojo
    Contains common behavior for mojos responsible for static code analysis, example: csslint, jslint, jshint.

    Type indicates the type of lint errors reported by this mojo.

    Since:
    1.6.3
    Author:
    Alex Objelean
    • Constructor Detail

      • AbstractLinterMojo

        public AbstractLinterMojo()
    • Method Detail

      • addReport

        protected final void addReport​(ro.isdc.wro.extensions.support.lint.ResourceLintReport<T> report)
        Add a single report to the registry of found errors.
        Parameters:
        report - to add.
      • onAfterExecute

        protected void onAfterExecute()
        Description copied from class: AbstractWro4jMojo
        Invoked right after execution completion. This method is invoked also if the execution failed with an exception.
        Overrides:
        onAfterExecute in class AbstractWro4jMojo
      • createXmlFormatter

        protected abstract ro.isdc.wro.extensions.support.lint.ReportXmlFormatter createXmlFormatter​(ro.isdc.wro.extensions.support.lint.LintReport<T> lintReport,
                                                                                                     ro.isdc.wro.extensions.support.lint.ReportXmlFormatter.FormatterType type)
        Returns:
        an instance of ReportXmlFormatter responsible for generating lint report.
      • onProcessingResource

        protected final void onProcessingResource​(ro.isdc.wro.model.resource.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.
      • isFailAllowed

        protected final boolean isFailAllowed()
        Returns:
        true if the build can fail due to found errors based on existing configuration.
      • getReportFile

        protected abstract java.io.File getReportFile()
        Returns:
        the file where the report should be written.
      • getReportFormat

        protected abstract java.lang.String getReportFormat()
        Returns:
        the preferred format of the report.
      • setFailThreshold

        public void setFailThreshold​(int failThreshold)
      • setFailFast

        public void setFailFast​(boolean failFast)
        Parameters:
        failFast - flag to set.