Class AbstractLinterMojo<T>

java.lang.Object
org.apache.maven.plugin.AbstractMojo
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 <T> indicates the type of lint errors reported by this mojo.

Since:
1.6.3
Author:
Alex Objelean, Paul Podgorsek
  • Constructor Details

    • AbstractLinterMojo

      public AbstractLinterMojo()
  • Method Details

    • addReport

      protected final void addReport(ResourceLintReport<T> report)
      Add a single report to the registry of found errors.
      Parameters:
      report - to add.
    • onBeforeExecute

      protected void onBeforeExecute()
      Description copied from class: AbstractWro4jMojo
      Invoked before execution is performed.
      Overrides:
      onBeforeExecute in class AbstractWro4jMojo
    • 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 ReportXmlFormatter createXmlFormatter(LintReport<T> lintReport, ReportXmlFormatter.FormatterType type)
      Returns:
      an instance of ReportXmlFormatter responsible for generating lint report.
    • onProcessingResource

      protected final void onProcessingResource(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 File getReportFile()
      Returns:
      the file where the report should be written.
    • getReportFormat

      protected abstract String getReportFormat()
      Returns:
      the preferred format of the report.
    • getProgressIndicator

      protected final ProgressIndicator getProgressIndicator()
    • setFailNever

      public void setFailNever(boolean failNever)
      Overrides:
      setFailNever in class AbstractSingleProcessorMojo
      Parameters:
      failNever - the failFast to set.
    • setFailThreshold

      public void setFailThreshold(int failThreshold)
    • isFailNever

      public boolean isFailNever()
      Overrides:
      isFailNever in class AbstractSingleProcessorMojo
      Returns:
      the failNever flag.
    • setFailFast

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