i18n:parserXml

Full name:

org.nuiton.i18n:i18n-maven-plugin:4.1:parserXml

Description:

To obtain i18n keys from xml files using the userRulesFiles (and an optional coreRuleFile if any serves your purpose). Note: this goal must always be invoked before the process-resources phase, otherwise all files will be considered as uptodate.

Attributes:

  • Requires a Maven project to be executed.
  • The goal is not marked as thread-safe and thus does not support parallel builds.
  • Since version: 2.0.
  • Binds by default to the lifecycle phase: generate-resources.

Required Parameters

Name Type Since Description
<basedir> File 2.0 Default directory where to look for files.
Default value is: ${basedir}/src/main/resources.
User property is: i18n.xmlBasedir.
<bundles> String 2.0 Locales to treate, separated by comma. Example :
fr_FR,en_GB

Default value is: fr_FR,en_GB.
User property is: i18n.bundles.
<encoding> String 2.0 Encoding used to load and store properties.
Default value is: ${project.build.sourceEncoding}.
User property is: i18n.encoding.
<includes> String 2.0 Defines files to parse.
User property is: i18n.xmlIncludes.
<out> File 2.0 Directory where to generate i18n files.
Default value is: ${basedir}/target/generated-sources/i18n.
User property is: i18n.out.
<outputGetter> String 2.0 Defines the file name of the getter where to put detected i18n keys while getter phase.
Default value is: xmlUser.getter.
User property is: i18n.outputGetter.
<src> File 2.0 Directory where to find project i18n files.
Default value is: ${basedir}/src/main/resources/i18n.
User property is: i18n.src.

Optional Parameters

Name Type Since Description
<acceptKeyFormat> String 2.5 A regex pattern to accept incoming keys. Only incoming keys which match the pattern will be kept.
User property is: i18n.acceptKeyFormat.
<backupGetter> boolean 1.0.2 Flag to save previous getter in a backup before doing parsing. Note: by default, do not perform backup (but it was here originaly so let it possible...)
Default value is: false.
User property is: i18n.backupGetter.
<coreRuleFile> String 2.0 Defines an optional files which contain xpath rules to obtain i18n keys in xml files and is defined in plugin.
User property is: i18n.coreRuleFiles.
<cp> File 2.0 Build directory (used to know if files in sources are up-to-date).
Default value is: ${basedir}/target/classes.
User property is: i18n.cp.
<entries> I18nSourceEntry[] 2.0 Source entries (src+includes+excludes) to process.
User property is: i18n.entries.
<force> boolean 1.2 To force reparse of all sources.
Default value is: false.
User property is: i18n.force.
<namespaces> Map 2.0 Defines namespaces mapping if needed. Example :
<namespaces>
<s>http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd</s>
</namespaces>

<showTouchedFiles> boolean 0.9 Flag to display touched files while parsing. Note: the value will be always true if verbose is set at true.
Default value is: ${maven.verbose}.
User property is: i18n.showTouchedFiles.
<silent> boolean 1.0.0-rc-5 Silent flag to see only errors in console.
Default value is: false.
User property is: i18n.silent.
<strictMode> boolean 2.0 Strict mode to only keep in user i18n detected i18n keys and remove obsolete keys. Note : By default not active. Use this with care since it can delete keys. Moreover if this flag is activated, then all files will be parsed.
Default value is: false.
User property is: i18n.strictMode.
<treateDefaultEntry> boolean 2.0 To treat default entry offered by the mojo.
Default value is: true.
User property is: i18n.treateDefaultEntry.
<userRulesFiles> String[] 2.0 Extra rules files to use for detecting i18n keys in xml validation files. Note : If the coreRulesFile is not defined, then you must fill this parameter.
<verbose> boolean 2.0 Verbose flag. Note : if not setted, we used the maven.verbose property.
Default value is: ${maven.verbose}.
User property is: i18n.verbose.

Parameter Details

<acceptKeyFormat>

A regex pattern to accept incoming keys. Only incoming keys which match the pattern will be kept.
  • Type: java.lang.String
  • Since: 2.5
  • Required: No
  • User Property: i18n.acceptKeyFormat

<backupGetter>

Flag to save previous getter in a backup before doing parsing. Note: by default, do not perform backup (but it was here originaly so let it possible...)
  • Type: boolean
  • Since: 1.0.2
  • Required: No
  • User Property: i18n.backupGetter
  • Default: false

<basedir>

Default directory where to look for files.
  • Type: java.io.File
  • Since: 2.0
  • Required: Yes
  • User Property: i18n.xmlBasedir
  • Default: ${basedir}/src/main/resources

<bundles>

Locales to treate, separated by comma. Example :
fr_FR,en_GB
  • Type: java.lang.String
  • Since: 2.0
  • Required: Yes
  • User Property: i18n.bundles
  • Default: fr_FR,en_GB

<coreRuleFile>

Defines an optional files which contain xpath rules to obtain i18n keys in xml files and is defined in plugin.
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: i18n.coreRuleFiles

<cp>

Build directory (used to know if files in sources are up-to-date).
  • Type: java.io.File
  • Since: 2.0
  • Required: No
  • User Property: i18n.cp
  • Default: ${basedir}/target/classes

<encoding>

Encoding used to load and store properties.
  • Type: java.lang.String
  • Since: 2.0
  • Required: Yes
  • User Property: i18n.encoding
  • Default: ${project.build.sourceEncoding}

<entries>

Source entries (src+includes+excludes) to process.
  • Type: org.nuiton.i18n.plugin.parser.I18nSourceEntry[]
  • Since: 2.0
  • Required: No
  • User Property: i18n.entries

<force>

To force reparse of all sources.
  • Type: boolean
  • Since: 1.2
  • Required: No
  • User Property: i18n.force
  • Default: false

<includes>

Defines files to parse.
  • Type: java.lang.String
  • Since: 2.0
  • Required: Yes
  • User Property: i18n.xmlIncludes

<namespaces>

Defines namespaces mapping if needed. Example :
<namespaces>
<s>http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd</s>
</namespaces>
  • Type: java.util.Map
  • Since: 2.0
  • Required: No

<out>

Directory where to generate i18n files.
  • Type: java.io.File
  • Since: 2.0
  • Required: Yes
  • User Property: i18n.out
  • Default: ${basedir}/target/generated-sources/i18n

<outputGetter>

Defines the file name of the getter where to put detected i18n keys while getter phase.
  • Type: java.lang.String
  • Since: 2.0
  • Required: Yes
  • User Property: i18n.outputGetter
  • Default: xmlUser.getter

<showTouchedFiles>

Flag to display touched files while parsing. Note: the value will be always true if verbose is set at true.
  • Type: boolean
  • Since: 0.9
  • Required: No
  • User Property: i18n.showTouchedFiles
  • Default: ${maven.verbose}

<silent>

Silent flag to see only errors in console.
  • Type: boolean
  • Since: 1.0.0-rc-5
  • Required: No
  • User Property: i18n.silent
  • Default: false

<src>

Directory where to find project i18n files.
  • Type: java.io.File
  • Since: 2.0
  • Required: Yes
  • User Property: i18n.src
  • Default: ${basedir}/src/main/resources/i18n

<strictMode>

Strict mode to only keep in user i18n detected i18n keys and remove obsolete keys. Note : By default not active. Use this with care since it can delete keys. Moreover if this flag is activated, then all files will be parsed.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: i18n.strictMode
  • Default: false

<treateDefaultEntry>

To treat default entry offered by the mojo.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: i18n.treateDefaultEntry
  • Default: true

<userRulesFiles>

Extra rules files to use for detecting i18n keys in xml validation files. Note : If the coreRulesFile is not defined, then you must fill this parameter.
  • Type: java.lang.String[]
  • Since: 2.0
  • Required: No

<verbose>

Verbose flag. Note : if not setted, we used the maven.verbose property.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: i18n.verbose
  • Default: ${maven.verbose}