htmlcompressor:html

Full name:

com.github.hazendaz.maven:htmlcompressor-maven-plugin:1.10.0:html

Description:

Compress HTML files.

Attributes:

  • The goal is thread-safe and supports parallel builds.
  • Binds by default to the lifecycle phase: compile.

Optional Parameters

Name Type Since Description
<closureCustomExternsOnly> boolean - Disable default built-in closure externs.
Default: false
User Property: htmlcompressor.closureCustomExternsOnly
<closureExterns> String[] - Sets custom closure externs file list.
User Property: htmlcompressor.closureExterns
<closureOptLevel> String - closureOptLevel = "simple", "advanced" or "whitespace".
Default: simple
User Property: htmlcompressor.closureOptLevel
<compressCss> boolean - compress inline css.
Default: false
User Property: htmlcompressor.compressCss
<compressJavaScript> boolean - compress inline javascript.
Default: false
User Property: htmlcompressor.compressJavaScript
<cssCompressor> Compressor - css compressor.
User Property: htmlcompressor.cssCompressor
<enabled> boolean - if false all compression is off (default is true).
Default: true
User Property: htmlcompressor.enabled
<encoding> String - Charset encoding for files to read and create.
Default: UTF-8
User Property: htmlcompressor.encoding
<fileExt> String[] -
Deprecated.
use fileExtensions

file types to be processed.
User Property: htmlcompressor.fileExt
<fileExtensions> String[] - File extensions to be processed.
User Property: htmlcompressor.fileExtensions
<generateStatistics> boolean - HTML compression statistics.
Default: true
User Property: htmlcompressor.generateStatistics
<htmlCompressionStatistics> String - file where statistics of html compression is stored.
Default: ${project.build.directory}/htmlcompressor/html-compression-statistics.txt
User Property: htmlcompressor.htmlCompressionStatistics
<javaScriptCompressor> Compressor - javascript compression.
User Property: htmlcompressor.javaScriptCompressor
<javascriptHtmlSprite> boolean - Create javascript file which includes all compressed html files as json object. If set to true then javascriptHtmlSpriteIntegrationFile param is required, otherwise it will throw exception.
Default: true
User Property: htmlcompressor.javascriptHtmlSprite
<javascriptHtmlSpriteIntegrationFile> String - JavaScript sprite integration file (first occurrence of "%s" will be substituted by json with all compressed html strings).
Default: ${basedir}/src/main/resources/html/integration.js
User Property: htmlcompressor.javascriptHtmlSpriteIntegrationFile
<javascriptHtmlSpriteTargetFile> String - The target JavaScript sprite file with compressed html files as json object.
Default: ${project.build.directory}/htmlcompressor/html/integration.js
User Property: htmlcompressor.javascriptHtmlSpriteTargetFile
<jsCompressor> String - javascript compression: "yui" or "closure".
Default: yui
User Property: htmlcompressor.jsCompressor
<predefinedPreservePatterns> String[] - predefined patterns for most often used custom preservation rules: PHP_TAG_PATTERN and SERVER_SCRIPT_TAG_PATTERN.
User Property: htmlcompressor.predefinedPreservePatterns
<preserveLineBreaks> boolean - preserves original line breaks.
Default: false
User Property: htmlcompressor.preserveLineBreaks
<preservePatternFiles> File[] - list of files containing preserve patterns.
User Property: htmlcompressor.preservePatternFiles
<preservePatterns> String[] - preserve patterns.
User Property: htmlcompressor.preservePatterns
<removeComments> boolean - if false keeps HTML comments (default is true).
Default: true
User Property: htmlcompressor.removeComments
<removeFormAttributes> boolean - remove optional attributes from form tags.
Default: false
User Property: htmlcompressor.removeFormAttributes
<removeHttpProtocol> boolean - replace "http://" with "//" inside tag attributes.
Default: false
User Property: htmlcompressor.removeHttpProtocol
<removeHttpsProtocol> boolean - replace "https://" with "//" inside tag attributes.
Default: false
User Property: htmlcompressor.removeHttpsProtocol
<removeInputAttributes> boolean - remove optional attributes from input tags.
Default: false
User Property: htmlcompressor.removeInputAttributes
<removeIntertagSpaces> boolean - removes iter-tag whitespace characters.
Default: false
User Property: htmlcompressor.removeIntertagSpaces
<removeJavaScriptProtocol> boolean - remove "javascript:" from inline event handlers.
Default: false
User Property: htmlcompressor.removeJavaScriptProtocol
<removeLinkAttributes> boolean - remove optional attributes from link tags.
Default: false
User Property: htmlcompressor.removeLinkAttributes
<removeMultiSpaces> boolean - if false keeps multiple whitespace characters (default is true).
Default: true
User Property: htmlcompressor.removeMultiSpaces
<removeQuotes> boolean - removes unnecessary tag attribute quotes.
Default: false
User Property: htmlcompressor.removeQuotes
<removeScriptAttributes> boolean - remove optional attributes from script tags.
Default: false
User Property: htmlcompressor.removeScriptAttributes
<removeStyleAttributes> boolean - remove optional attributes from style tags.
Default: false
User Property: htmlcompressor.removeStyleAttributes
<simpleBooleanAttributes> boolean - remove values from boolean tag attributes.
Default: false
User Property: htmlcompressor.simpleBooleanAttributes
<simpleDoctype> boolean - simplify existing doctype.
Default: false
User Property: htmlcompressor.simpleDoctype
<skip> boolean - Skip run of plugin.
Default: false
User Property: skip
Alias: skip
<srcFolder> String - source folder where html files are located.
Default: ${basedir}/src/main/resources
User Property: htmlcompressor.srcFolder
<targetFolder> String - target folder where compressed html files will be placed.
Default: ${project.build.directory}/classes
User Property: htmlcompressor.targetFolder
<yuiCssLineBreak> int - --line-break param for Yahoo YUI Compressor.
Default: -1
User Property: htmlcompressor.yuiCssLineBreak
<yuiJsDisableOptimizations> boolean - --disable-optimizations param for Yahoo YUI Compressor.
Default: false
User Property: htmlcompressor.yuiJsDisableOptimizations
<yuiJsLineBreak> int - --line-break param for Yahoo YUI Compressor.
Default: -1
User Property: htmlcompressor.yuiJsLineBreak
<yuiJsNoMunge> boolean - --nomunge param for Yahoo YUI Compressor.
Default: false
User Property: htmlcompressor.yuiJsNoMunge
<yuiJsPreserveAllSemiColons> boolean - --preserve-semi param for Yahoo YUI Compressor.
Default: false
User Property: htmlcompressor.yuiJsPreserveAllSemiColons

Parameter Details

<closureCustomExternsOnly>

Disable default built-in closure externs.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.closureCustomExternsOnly
  • Default: false

<closureExterns>

Sets custom closure externs file list.
  • Type: java.lang.String[]
  • Required: No
  • User Property: htmlcompressor.closureExterns

<closureOptLevel>

closureOptLevel = "simple", "advanced" or "whitespace".
  • Type: java.lang.String
  • Required: No
  • User Property: htmlcompressor.closureOptLevel
  • Default: simple

<compressCss>

compress inline css.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.compressCss
  • Default: false

<compressJavaScript>

compress inline javascript.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.compressJavaScript
  • Default: false

<cssCompressor>

css compressor.
  • Type: com.googlecode.htmlcompressor.compressor.Compressor
  • Required: No
  • User Property: htmlcompressor.cssCompressor

<enabled>

if false all compression is off (default is true).
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.enabled
  • Default: true

<encoding>

Charset encoding for files to read and create.
  • Type: java.lang.String
  • Required: No
  • User Property: htmlcompressor.encoding
  • Default: UTF-8

<fileExt>

Deprecated.
use fileExtensions

file types to be processed.
  • Type: java.lang.String[]
  • Required: No
  • User Property: htmlcompressor.fileExt

<fileExtensions>

File extensions to be processed.
  • Type: java.lang.String[]
  • Required: No
  • User Property: htmlcompressor.fileExtensions

<generateStatistics>

HTML compression statistics.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.generateStatistics
  • Default: true

<htmlCompressionStatistics>

file where statistics of html compression is stored.
  • Type: java.lang.String
  • Required: No
  • User Property: htmlcompressor.htmlCompressionStatistics
  • Default: ${project.build.directory}/htmlcompressor/html-compression-statistics.txt

<javaScriptCompressor>

javascript compression.
  • Type: com.googlecode.htmlcompressor.compressor.Compressor
  • Required: No
  • User Property: htmlcompressor.javaScriptCompressor

<javascriptHtmlSprite>

Create javascript file which includes all compressed html files as json object. If set to true then javascriptHtmlSpriteIntegrationFile param is required, otherwise it will throw exception.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.javascriptHtmlSprite
  • Default: true

<javascriptHtmlSpriteIntegrationFile>

JavaScript sprite integration file (first occurrence of "%s" will be substituted by json with all compressed html strings).
  • Type: java.lang.String
  • Required: No
  • User Property: htmlcompressor.javascriptHtmlSpriteIntegrationFile
  • Default: ${basedir}/src/main/resources/html/integration.js

<javascriptHtmlSpriteTargetFile>

The target JavaScript sprite file with compressed html files as json object.
  • Type: java.lang.String
  • Required: No
  • User Property: htmlcompressor.javascriptHtmlSpriteTargetFile
  • Default: ${project.build.directory}/htmlcompressor/html/integration.js

<jsCompressor>

javascript compression: "yui" or "closure".
  • Type: java.lang.String
  • Required: No
  • User Property: htmlcompressor.jsCompressor
  • Default: yui

<predefinedPreservePatterns>

predefined patterns for most often used custom preservation rules: PHP_TAG_PATTERN and SERVER_SCRIPT_TAG_PATTERN.
  • Type: java.lang.String[]
  • Required: No
  • User Property: htmlcompressor.predefinedPreservePatterns

<preserveLineBreaks>

preserves original line breaks.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.preserveLineBreaks
  • Default: false

<preservePatternFiles>

list of files containing preserve patterns.
  • Type: java.io.File[]
  • Required: No
  • User Property: htmlcompressor.preservePatternFiles

<preservePatterns>

preserve patterns.
  • Type: java.lang.String[]
  • Required: No
  • User Property: htmlcompressor.preservePatterns

<removeComments>

if false keeps HTML comments (default is true).
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.removeComments
  • Default: true

<removeFormAttributes>

remove optional attributes from form tags.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.removeFormAttributes
  • Default: false

<removeHttpProtocol>

replace "http://" with "//" inside tag attributes.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.removeHttpProtocol
  • Default: false

<removeHttpsProtocol>

replace "https://" with "//" inside tag attributes.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.removeHttpsProtocol
  • Default: false

<removeInputAttributes>

remove optional attributes from input tags.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.removeInputAttributes
  • Default: false

<removeIntertagSpaces>

removes iter-tag whitespace characters.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.removeIntertagSpaces
  • Default: false

<removeJavaScriptProtocol>

remove "javascript:" from inline event handlers.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.removeJavaScriptProtocol
  • Default: false

<removeLinkAttributes>

remove optional attributes from link tags.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.removeLinkAttributes
  • Default: false

<removeMultiSpaces>

if false keeps multiple whitespace characters (default is true).
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.removeMultiSpaces
  • Default: true

<removeQuotes>

removes unnecessary tag attribute quotes.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.removeQuotes
  • Default: false

<removeScriptAttributes>

remove optional attributes from script tags.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.removeScriptAttributes
  • Default: false

<removeStyleAttributes>

remove optional attributes from style tags.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.removeStyleAttributes
  • Default: false

<simpleBooleanAttributes>

remove values from boolean tag attributes.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.simpleBooleanAttributes
  • Default: false

<simpleDoctype>

simplify existing doctype.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.simpleDoctype
  • Default: false

<skip>

Skip run of plugin.
  • Type: boolean
  • Required: No
  • User Property: skip
  • Default: false
  • Alias: skip

<srcFolder>

source folder where html files are located.
  • Type: java.lang.String
  • Required: No
  • User Property: htmlcompressor.srcFolder
  • Default: ${basedir}/src/main/resources

<targetFolder>

target folder where compressed html files will be placed.
  • Type: java.lang.String
  • Required: No
  • User Property: htmlcompressor.targetFolder
  • Default: ${project.build.directory}/classes

<yuiCssLineBreak>

--line-break param for Yahoo YUI Compressor.
  • Type: int
  • Required: No
  • User Property: htmlcompressor.yuiCssLineBreak
  • Default: -1

<yuiJsDisableOptimizations>

--disable-optimizations param for Yahoo YUI Compressor.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.yuiJsDisableOptimizations
  • Default: false

<yuiJsLineBreak>

--line-break param for Yahoo YUI Compressor.
  • Type: int
  • Required: No
  • User Property: htmlcompressor.yuiJsLineBreak
  • Default: -1

<yuiJsNoMunge>

--nomunge param for Yahoo YUI Compressor.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.yuiJsNoMunge
  • Default: false

<yuiJsPreserveAllSemiColons>

--preserve-semi param for Yahoo YUI Compressor.
  • Type: boolean
  • Required: No
  • User Property: htmlcompressor.yuiJsPreserveAllSemiColons
  • Default: false