Class GenerateMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.plugin.Plugin, org.nuiton.plugin.PluginWithEncoding

@Mojo(name="gen",
      defaultPhase=GENERATE_RESOURCES)
@Execute(goal="get")
public class GenerateMojo
extends AbstractI18nGenerateMojo
Merge new generated i18n bundles with older existing ones.
Author:
Julien Ruchaud - ruchaud@codelutin.com, Tony Chemit - chemit@codelutin.com
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin

    org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected BundleValidation bundleValidation  
    protected boolean checkBundle
    A flag to check that bundles are complete (no missing i18n translations).
    protected boolean failsIfAnyKeyMissingInBundle
    A flag to make the build fails if there is some missing keys.
    protected boolean failsIfAnyKeyMissingValue
    A flag to make the build fails if there is some missing key values.
    protected boolean failsIfWarning
    Deprecated.
    protected boolean genSrc
    To update generated files to user i18n files.
    protected boolean keepBackup
    To keep a backup of old i18n bundles (suffiex by a ~).
    protected boolean keepGetters
    To keep generated getter files.
    protected boolean showEmpty
    A flag to show missing i18n translation.
    protected java.io.File src
    Directory where to find project i18n files.
    protected boolean strictMode
    Strict mode to only keep in user i18n detected i18n keys and remove obsolete keys.

    Fields inherited from class org.nuiton.i18n.plugin.AbstractI18nGenerateMojo

    artifactId, out

    Fields inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo

    bundles, encoding, locales, mavenSession, project, silent, verbose

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors 
    Constructor Description
    GenerateMojo()  
  • Method Summary

    Modifier and Type Method Description
    protected boolean checkSkip()  
    protected void doAction()  

    Methods inherited from class org.nuiton.i18n.plugin.AbstractI18nGenerateMojo

    addGetter, getGetterFile, needGeneration

    Methods inherited from class org.nuiton.plugin.AbstractPlugin

    acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, checkEncoding, checkResource, checkRunOnceDone, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, needInvoke, needInvoke, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFile

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.maven.plugin.Mojo

    execute, getLog, setLog
  • Field Details

    • src

      @Parameter(property="i18n.src", defaultValue="${basedir}/src/main/resources/i18n", required=true) protected java.io.File src
      Directory where to find project i18n files.
    • genSrc

      @Parameter(property="i18n.genSrc", defaultValue="true") protected boolean genSrc
      To update generated files to user i18n files. Note : By default, this is active, in order to have a project uptodate with last i18n bundles detected.
    • strictMode

      @Parameter(property="i18n.strictMode", defaultValue="false") protected boolean 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.
    • checkBundle

      @Parameter(property="i18n.checkBundle", defaultValue="true", required=true) protected boolean checkBundle
      A flag to check that bundles are complete (no missing i18n translations).
      Since:
      1.0.0
    • showEmpty

      @Parameter(property="i18n.showEmpty", defaultValue="false", required=true) protected boolean showEmpty
      A flag to show missing i18n translation. Note : Need the checkBundle to be activated).
      Since:
      1.0.0
    • failsIfWarning

      @Parameter(property="i18n.failsIfWarning", defaultValue="false") @Deprecated protected boolean failsIfWarning
      Deprecated.
    • failsIfAnyKeyMissingValue

      @Parameter(property="i18n.failsIfAnyKeyMissingValue", defaultValue="false") protected boolean failsIfAnyKeyMissingValue
      A flag to make the build fails if there is some missing key values. Note : This parameter should be used in a release profile to ensure bundles are complete.
      Since:
      3.5.1
    • failsIfAnyKeyMissingInBundle

      @Parameter(property="i18n.failsIfAnyKeyMissingInBundle", defaultValue="false") protected boolean failsIfAnyKeyMissingInBundle
      A flag to make the build fails if there is some missing keys. Note : This parameter should be used in a release profile to ensure bundles are complete.
      Since:
      3.5.1
    • keepBackup

      @Parameter(property="i18n.keepBackup", defaultValue="false") protected boolean keepBackup
      To keep a backup of old i18n bundles (suffiex by a ~). Note: By default, this property is not active.
    • keepGetters

      @Parameter(property="i18n.keepGetters", defaultValue="false") protected boolean keepGetters
      To keep generated getter files. Note: By default, this property is not active.
    • bundleValidation

      protected BundleValidation bundleValidation
  • Constructor Details

  • Method Details

    • checkSkip

      protected boolean checkSkip()
      Overrides:
      checkSkip in class org.nuiton.plugin.AbstractPlugin
    • doAction

      protected void doAction() throws java.lang.Exception
      Specified by:
      doAction in class org.nuiton.plugin.AbstractPlugin
      Throws:
      java.lang.Exception