yuicompressor:compress

Full name:

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

Description:

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

Attributes:

  • Requires a Maven project to be executed.
  • The goal is thread-safe and supports parallel builds.
  • 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.
User property is: maven.yuicompressor.disableOptimizations.
encoding String - Read the input file using "encoding".
Default value is: UTF-8.
User property is: file.encoding.
excludeResources boolean - Excludes files from resources directories.
Default value is: false.
excludeWarSourceDirectory boolean - Excludes files from webapp directory
excludes List - list of additional excludes
failOnWarning boolean - define if plugin must stop/fail on warnings.
Default value is: false.
User property is: maven.yuicompressor.failOnWarning.
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.
User property is: maven.yuicompressor.force.
gzip boolean - request to create a gzipped version of the yuicompressed/aggregation files.
Default value is: false.
User property is: maven.yuicompressor.gzip.
includes List - list of additional includes
jswarn boolean - [js only] Display possible errors in the code
Default value is: true.
User property is: maven.yuicompressor.jswarn.
linebreakpos int - Insert line breaks in output after the specified column number.
Default value is: -1.
User property is: maven.yuicompressor.linebreakpos.
nocompress boolean - [js only] No compression
Default value is: false.
User property is: maven.yuicompressor.nocompress.
nomunge boolean - [js only] Minify only, do not obfuscate.
Default value is: false.
User property is: maven.yuicompressor.nomunge.
nosuffix boolean - If no "suffix" must be add to output filename (maven's configuration manage empty suffix like default).
Default value is: false.
User property is: maven.yuicompressor.nosuffix.
outputDirectory File - The output directory into which to copy the resources.
User property is: project.build.outputDirectory.
preProcessAggregates boolean - aggregate files before minify
Default value is: false.
User property is: maven.yuicompressor.preProcessAggregates.
preserveAllSemiColons boolean - [js only] Preserve unnecessary semicolons.
Default value is: false.
User property is: maven.yuicompressor.preserveAllSemiColons.
resources List - The list of resources we want to transfer.
User property is: project.resources.
skip boolean - Whether to skip execution.
Default value is: false.
User property is: maven.yuicompressor.skip.
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.
User property is: maven.yuicompressor.statistics.
suffix String - The output filename suffix.
Default value is: -min.
User property is: maven.yuicompressor.suffix.
useProcessedResources boolean - Use processed resources if available
Default value is: false.
useSmallestFile boolean - use the input file as output when the compressed file is larger than the original
Default value is: true.
User property is: maven.yuicompressor.useSmallestFile.
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
  • User Property: maven.yuicompressor.disableOptimizations
  • Default: false

encoding:

Read the input file using "encoding".
  • Type: java.lang.String
  • Required: No
  • User Property: file.encoding
  • Default: UTF-8

excludeResources:

Excludes files from resources directories.
  • Type: boolean
  • Required: No
  • Default: false

excludeWarSourceDirectory:

Excludes files from webapp directory
  • Type: boolean
  • Required: No

excludes:

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

failOnWarning:

define if plugin must stop/fail on warnings.
  • Type: boolean
  • Required: No
  • User Property: 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
  • User Property: maven.yuicompressor.force
  • Default: false

gzip:

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

includes:

list of additional includes
  • Type: java.util.List
  • Required: No

jswarn:

[js only] Display possible errors in the code
  • Type: boolean
  • Required: No
  • User Property: maven.yuicompressor.jswarn
  • Default: true

linebreakpos:

Insert line breaks in output after the specified column number.
  • Type: int
  • Required: No
  • User Property: maven.yuicompressor.linebreakpos
  • Default: -1

nocompress:

[js only] No compression
  • Type: boolean
  • Required: No
  • User Property: maven.yuicompressor.nocompress
  • Default: false

nomunge:

[js only] Minify only, do not obfuscate.
  • Type: boolean
  • Required: No
  • User Property: 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
  • User Property: maven.yuicompressor.nosuffix
  • Default: false

outputDirectory:

The output directory into which to copy the resources.
  • Type: java.io.File
  • Required: No
  • User Property: project.build.outputDirectory

preProcessAggregates:

aggregate files before minify
  • Type: boolean
  • Required: No
  • User Property: maven.yuicompressor.preProcessAggregates
  • Default: false

preserveAllSemiColons:

[js only] Preserve unnecessary semicolons.
  • Type: boolean
  • Required: No
  • User Property: maven.yuicompressor.preserveAllSemiColons
  • Default: false

resources:

The list of resources we want to transfer.
  • Type: java.util.List
  • Required: No
  • User Property: project.resources

skip:

Whether to skip execution.
  • Type: boolean
  • Required: No
  • User Property: 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
  • User Property: maven.yuicompressor.statistics
  • Default: true

suffix:

The output filename suffix.
  • Type: java.lang.String
  • Required: No
  • User Property: maven.yuicompressor.suffix
  • Default: -min

useProcessedResources:

Use processed resources if available
  • Type: boolean
  • Required: No
  • Default: false

useSmallestFile:

use the input file as output when the compressed file is larger than the original
  • Type: boolean
  • Required: No
  • User Property: maven.yuicompressor.useSmallestFile
  • Default: true

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}