java.lang.Object
org.apache.maven.plugin.AbstractMojo
net.alchim31.maven.yuicompressor.MojoSupport
net.alchim31.maven.yuicompressor.YuiCompressorMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="compress", defaultPhase=PROCESS_RESOURCES, requiresProject=true, threadSafe=true) public class YuiCompressorMojo extends MojoSupport
Apply compression on JS and CSS (using YUI Compressor).
  • Constructor Details

    • YuiCompressorMojo

      public YuiCompressorMojo()
  • Method Details

    • getDefaultIncludes

      protected String[] getDefaultIncludes()
      Description copied from class: MojoSupport
      Gets the default includes.
      Specified by:
      getDefaultIncludes in class MojoSupport
      Returns:
      the default includes
    • beforeProcess

      public void beforeProcess() throws IOException
      Description copied from class: MojoSupport
      Before process.
      Specified by:
      beforeProcess in class MojoSupport
      Throws:
      IOException - the IO exception
    • afterProcess

      protected void afterProcess() throws IOException
      Description copied from class: MojoSupport
      After process.
      Specified by:
      afterProcess in class MojoSupport
      Throws:
      IOException - the IO exception
    • processFile

      protected void processFile(SourceFile src) throws IOException, org.apache.maven.plugin.MojoExecutionException
      Description copied from class: MojoSupport
      Process file.
      Specified by:
      processFile in class MojoSupport
      Parameters:
      src - the src
      Throws:
      IOException - the IO exception
      org.apache.maven.plugin.MojoExecutionException - the mojo execution exception
    • gzipIfRequested

      protected File gzipIfRequested(File file) throws IOException
      Gzip if requested.
      Parameters:
      file - the file
      Returns:
      the file
      Throws:
      IOException - the IO exception
    • ratioOfSize

      protected long ratioOfSize(File file100, File fileX)
      Ratio of size.
      Parameters:
      file100 - the file 100
      fileX - the file X
      Returns:
      the long