Class MojoSupport

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codelibs.maven.yuicompressor.MojoSupport
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
JSLintMojo, YuiCompressorMojo

public abstract class MojoSupport extends org.apache.maven.plugin.AbstractMojo
Abstract base class for YUI Compressor Maven plugin mojos. Provides common functionality for file scanning and processing.
Author:
David Bernard, CodeLibs Project
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.sonatype.plexus.build.incremental.BuildContext
     
    protected boolean
    Define if plugin must stop/fail on warnings.
     
    protected boolean
    [js only] Display possible errors in the code.
    protected org.apache.maven.project.MavenProject
     

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    Called after all processing is complete.
    protected abstract void
    Called before processing starts.
    void
     
    protected abstract String[]
    Returns the default file includes pattern.
    protected abstract void
    Processes a single file.

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • project

      @Parameter(property="project", readonly=true, required=true) protected org.apache.maven.project.MavenProject project
    • jswarn

      @Parameter(property="maven.yuicompressor.jswarn", defaultValue="true") protected boolean jswarn
      [js only] Display possible errors in the code.
    • failOnWarning

      @Parameter(property="maven.yuicompressor.failOnWarning", defaultValue="false") protected boolean failOnWarning
      Define if plugin must stop/fail on warnings.
    • buildContext

      @Component protected org.sonatype.plexus.build.incremental.BuildContext buildContext
    • jsErrorReporter

      protected ErrorReporter4Mojo jsErrorReporter
  • Constructor Details

    • MojoSupport

      public MojoSupport()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • getDefaultIncludes

      protected abstract String[] getDefaultIncludes() throws IOException
      Returns the default file includes pattern.
      Returns:
      array of include patterns
      Throws:
      IOException - if an error occurs
    • beforeProcess

      protected abstract void beforeProcess() throws IOException
      Called before processing starts.
      Throws:
      IOException - if an error occurs
    • afterProcess

      protected abstract void afterProcess() throws IOException
      Called after all processing is complete.
      Throws:
      IOException - if an error occurs
    • processFile

      protected abstract void processFile(SourceFile src) throws IOException
      Processes a single file.
      Parameters:
      src - the source file to process
      Throws:
      IOException - if an error occurs