yuicompressor:compress

Full name:

net.alchim31.maven:yuicompressor-maven-plugin:1.1:compress

Description:

Apply compression on JS and CSS (using YUI Compressor).

Attributes:

  • Requires a Maven 2.0 project to be executed.
  • Binds by default to the lifecycle phase: process-resources.

Optional Parameters

Name Type Since Description
aggregations Aggregation[] - a list of aggregation/concatenation to do after processing, for example to create big js files that contain several small js files. Aggregation could be done on any type of file (js, css, ...).
disableOptimizations boolean - [js only] disable all micro optimizations.
Default value is: false.
encoding String - Read the input file using "encoding".
Default value is: UTF-8.
excludes List - list of additionnal excludes
failOnWarning boolean - define if plugin must stop/fail on warnings.
Default value is: false.
force boolean - force the compression of every files, else if compressed file already exists and is younger than source file, nothing is done.
Default value is: false.
gzip boolean - request to create a gzipped version of the yuicompressed/aggregation files.
Default value is: false.
jswarn boolean - [js only] Display possible errors in the code
Default value is: true.
linebreakpos int - Insert line breaks in output after the specified column number.
Default value is: 0.
nomunge boolean - [js only] Minify only, do not obfuscate.
Default value is: false.
nosuffix boolean - If no "suffix" must be add to output filename (maven's configuration manage empty suffix like default).
Default value is: false.
outputDirectory File - The output directory into which to copy the resources.
preserveAllSemiColons boolean - [js only] Preserve unnecessary semicolons.
Default value is: false.
resources List - The list of resources we want to transfer.
skip boolean - Whether to skip execution.
Default value is: false.
sourceDirectory File - Javascript source directory. (result will be put to outputDirectory). This allow project with "src/main/js" structure.
statistics boolean - show statistics (compression ratio).
Default value is: true.
suffix String - The output filename suffix.
Default value is: -min.
warSourceDirectory File - Single directory for extra files to include in the WAR.
webappDirectory File - The directory where the webapp is built.

Parameter Details

aggregations:

a list of aggregation/concatenation to do after processing, for example to create big js files that contain several small js files. Aggregation could be done on any type of file (js, css, ...).
  • Type: net_alchim31_maven_yuicompressor.Aggregation[]
  • Required: No

disableOptimizations:

[js only] disable all micro optimizations.
  • Type: boolean
  • Required: No
  • Expression: ${maven.yuicompressor.disableOptimizations}
  • Default: false

encoding:

Read the input file using "encoding".
  • Type: java.lang.String
  • Required: No
  • Expression: ${file.encoding}
  • Default: UTF-8

excludes:

list of additionnal excludes
  • Type: java.util.List
  • Required: No

failOnWarning:

define if plugin must stop/fail on warnings.
  • Type: boolean
  • Required: No
  • Expression: ${maven.yuicompressor.failOnWarning}
  • Default: false

force:

force the compression of every files, else if compressed file already exists and is younger than source file, nothing is done.
  • Type: boolean
  • Required: No
  • Expression: ${maven.yuicompressor.force}
  • Default: false

gzip:

request to create a gzipped version of the yuicompressed/aggregation files.
  • Type: boolean
  • Required: No
  • Expression: ${maven.yuicompressor.gzip}
  • Default: false

jswarn:

[js only] Display possible errors in the code
  • Type: boolean
  • Required: No
  • Expression: ${maven.yuicompressor.jswarn}
  • Default: true

linebreakpos:

Insert line breaks in output after the specified column number.
  • Type: int
  • Required: No
  • Expression: ${maven.yuicompressor.linebreakpos}
  • Default: 0

nomunge:

[js only] Minify only, do not obfuscate.
  • Type: boolean
  • Required: No
  • Expression: ${maven.yuicompressor.nomunge}
  • Default: false

nosuffix:

If no "suffix" must be add to output filename (maven's configuration manage empty suffix like default).
  • Type: boolean
  • Required: No
  • Expression: ${maven.yuicompressor.nosuffix}
  • Default: false

outputDirectory:

The output directory into which to copy the resources.
  • Type: java.io.File
  • Required: No
  • Expression: ${project.build.outputDirectory}

preserveAllSemiColons:

[js only] Preserve unnecessary semicolons.
  • Type: boolean
  • Required: No
  • Expression: ${maven.yuicompressor.preserveAllSemiColons}
  • Default: false

resources:

The list of resources we want to transfer.
  • Type: java.util.List
  • Required: No
  • Expression: ${project.resources}

skip:

Whether to skip execution.
  • Type: boolean
  • Required: No
  • Expression: ${maven.yuicompressor.skip}
  • Default: false

sourceDirectory:

Javascript source directory. (result will be put to outputDirectory). This allow project with "src/main/js" structure.
  • Type: java.io.File
  • Required: No
  • Expression: ${project.build.sourceDirectory}/../js

statistics:

show statistics (compression ratio).
  • Type: boolean
  • Required: No
  • Expression: ${maven.yuicompressor.statistics}
  • Default: true

suffix:

The output filename suffix.
  • Type: java.lang.String
  • Required: No
  • Expression: ${maven.yuicompressor.suffix}
  • Default: -min

warSourceDirectory:

Single directory for extra files to include in the WAR.
  • Type: java.io.File
  • Required: No
  • Expression: ${basedir}/src/main/webapp

webappDirectory:

The directory where the webapp is built.
  • Type: java.io.File
  • Required: No
  • Expression: ${project.build.directory}/${project.build.finalName}