Fork me on GitHub

xml-format:xml-format

Full name:

au.com.acegi:xml-format-maven-plugin:3.3.1:xml-format

Description:

Finds the XML files in a project and automatically reformats them.

Attributes:

  • Requires a Maven project to be executed.
  • The goal is thread-safe and supports parallel builds.
  • Binds by default to the lifecycle phase: prepare-package.

Optional Parameters

Name Type Since Description
<attributeQuoteChar> char - Quote character to use when writing attributes.
Default value is: ".
User property is: attributeQuoteChar.
<encoding> String - The encoding format.
Default value is: UTF-8.
User property is: encoding.
<excludes> String[] - A set of file patterns that allow you to exclude certain files/folders from the formatting. In addition to these exclusions, the project build directory (typically target) is always excluded if skipTargetFolder is true.
User property is: excludes.
<expandEmptyElements> boolean - Whether or not to expand empty elements to <tagName></tagName>.
Default value is: false.
User property is: expandEmptyElements.
<includes> String[] - A set of file patterns that dictate which files should be included in the formatting with each file pattern being relative to the base directory.
User property is: includes.
<indentSize> int - Indicates the number of spaces to apply when indenting.
Default value is: 2.
User property is: indentSize.
<keepBlankLines> boolean - Whether to keep blank lines. A maximum of one line is preserved between each tag.
Default value is: false.
User property is: keepBlankLines.
<lineEnding> LineEnding - Sets the line-ending of files after formatting. Valid values are:
  • "SYSTEM" - Use line endings of current system
  • "LF" - Use Unix and Mac style line endings
  • "CRLF" - Use DOS and Windows style line endings
  • "CR" - Use early Mac style line endings
This property is only used if lineSeparator has its default value. Do not set any value for lineSeparator.
Default value is: LF.
User property is: lineEnding.
<lineSeparator> String - Deprecated. Please do not set this value; use lineEnding instead
Default value is: .
User property is: lineSeparator.
<newLineAfterDeclaration> boolean - Whether or not to print new line after the XML declaration.
Default value is: false.
User property is: newLineAfterDeclaration.
<newLineAfterNTags> int - Controls when to output a line.separator every so many tags in case of no lines and total text trimming.
Default value is: 0.
User property is: newLineAfterNTags.
<newlines> boolean - The default new line flag, set to do new lines only as in original document.
Default value is: true.
User property is: newlines.
<omitEncoding> boolean - Whether or not to output the encoding in the XML declaration.
Default value is: false.
User property is: omitEncoding.
<padText> boolean - Pad string-element boundaries with whitespace.
Default value is: false.
User property is: padText.
<skip> boolean - Skip XML formatting.
Default value is: false.
User property is: xml-format.skip.
<skipTargetFolder> boolean - In addition to the exclusions, the project build directory (typically target) is always excluded if true.
Default value is: true.
User property is: skipTargetFolder.
<suppressDeclaration> boolean - Whether or not to suppress the XML declaration.
Default value is: false.
User property is: suppressDeclaration.
<tabIndent> boolean - Use tabs instead of spaces for indents. If set to true, indentSize will be ignored.
Default value is: false.
User property is: tabIndent.
<trimText> boolean - Should we preserve whitespace or not in text nodes.
Default value is: true.
User property is: trimText.
<xhtml> boolean - Whether or not to use XHTML standard.
Default value is: false.
User property is: xhtml.

Parameter Details

<attributeQuoteChar>

Quote character to use when writing attributes.
  • Type: char
  • Required: No
  • User Property: attributeQuoteChar
  • Default: "

<encoding>

The encoding format.
  • Type: java.lang.String
  • Required: No
  • User Property: encoding
  • Default: UTF-8

<excludes>

A set of file patterns that allow you to exclude certain files/folders from the formatting. In addition to these exclusions, the project build directory (typically target) is always excluded if skipTargetFolder is true.
  • Type: java.lang.String[]
  • Required: No
  • User Property: excludes

<expandEmptyElements>

Whether or not to expand empty elements to <tagName></tagName>.
  • Type: boolean
  • Required: No
  • User Property: expandEmptyElements
  • Default: false

<includes>

A set of file patterns that dictate which files should be included in the formatting with each file pattern being relative to the base directory.
  • Type: java.lang.String[]
  • Required: No
  • User Property: includes

<indentSize>

Indicates the number of spaces to apply when indenting.
  • Type: int
  • Required: No
  • User Property: indentSize
  • Default: 2

<keepBlankLines>

Whether to keep blank lines. A maximum of one line is preserved between each tag.
  • Type: boolean
  • Required: No
  • User Property: keepBlankLines
  • Default: false

<lineEnding>

Sets the line-ending of files after formatting. Valid values are:
  • "SYSTEM" - Use line endings of current system
  • "LF" - Use Unix and Mac style line endings
  • "CRLF" - Use DOS and Windows style line endings
  • "CR" - Use early Mac style line endings
This property is only used if lineSeparator has its default value. Do not set any value for lineSeparator.
  • Type: au.com.acegi.xmlformat.LineEnding
  • Required: No
  • User Property: lineEnding
  • Default: LF

<lineSeparator>

Deprecated. Please do not set this value; use lineEnding instead
New line separator.
  • Type: java.lang.String
  • Required: No
  • User Property: lineSeparator
  • Default:

<newLineAfterDeclaration>

Whether or not to print new line after the XML declaration.
  • Type: boolean
  • Required: No
  • User Property: newLineAfterDeclaration
  • Default: false

<newLineAfterNTags>

Controls when to output a line.separator every so many tags in case of no lines and total text trimming.
  • Type: int
  • Required: No
  • User Property: newLineAfterNTags
  • Default: 0

<newlines>

The default new line flag, set to do new lines only as in original document.
  • Type: boolean
  • Required: No
  • User Property: newlines
  • Default: true

<omitEncoding>

Whether or not to output the encoding in the XML declaration.
  • Type: boolean
  • Required: No
  • User Property: omitEncoding
  • Default: false

<padText>

Pad string-element boundaries with whitespace.
  • Type: boolean
  • Required: No
  • User Property: padText
  • Default: false

<skip>

Skip XML formatting.
  • Type: boolean
  • Required: No
  • User Property: xml-format.skip
  • Default: false

<skipTargetFolder>

In addition to the exclusions, the project build directory (typically target) is always excluded if true.
  • Type: boolean
  • Required: No
  • User Property: skipTargetFolder
  • Default: true

<suppressDeclaration>

Whether or not to suppress the XML declaration.
  • Type: boolean
  • Required: No
  • User Property: suppressDeclaration
  • Default: false

<tabIndent>

Use tabs instead of spaces for indents. If set to true, indentSize will be ignored.
  • Type: boolean
  • Required: No
  • User Property: tabIndent
  • Default: false

<trimText>

Should we preserve whitespace or not in text nodes.
  • Type: boolean
  • Required: No
  • User Property: trimText
  • Default: true

<xhtml>

Whether or not to use XHTML standard.
  • Type: boolean
  • Required: No
  • User Property: xhtml
  • Default: false