org.nuiton.i18n.plugin.bundle
Class AbstractMakeI18nBundleMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.nuiton.plugin.AbstractPlugin
          extended by org.nuiton.i18n.plugin.AbstractI18nMojo
              extended by org.nuiton.i18n.plugin.bundle.AbstractI18nBundleMojo
                  extended by org.nuiton.i18n.plugin.bundle.AbstractMakeI18nBundleMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.plugin.Plugin, org.nuiton.plugin.PluginWithEncoding
Direct Known Subclasses:
BundleMojo, TapestryBundleMojo

public abstract class AbstractMakeI18nBundleMojo
extends AbstractI18nBundleMojo

Common mojo to all final bundle maker.

Since:
2.0
Author:
tchemit

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
protected  File bundleOutputDir
          Directory where to generate aggregated bundles.
protected  String bundleOutputName
          Name of the bundle to generate.
protected  boolean checkBundle
          A flag to check that bundles are complete (no missing i18n translations).
protected  boolean failsIfWarning
          A flag to make the build fails if there is some warnings while generating bundle, says when it misses some translations.
protected  boolean showEmpty
          A flag to show missing i18n translation.
protected  Map<Locale,SortedSet<String>> unsafeMapping
          to keep all none translated i18n keys by locale.
 
Fields inherited from class org.nuiton.i18n.plugin.bundle.AbstractI18nBundleMojo
collectOutputDir, collectOutputName
 
Fields inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo
artifactId, bundles, encoding, genSrc, locales, out, project, silent, src, strictMode, verbose
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractMakeI18nBundleMojo()
           
 
Method Summary
protected  void failsIfWarning()
           
 void init()
           
 
Methods inherited from class org.nuiton.i18n.plugin.bundle.AbstractI18nBundleMojo
getCollectI18nResources, getCollectOutputFile, getLinesAsURL
 
Methods inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo
addGetter, backupFile, checkBundle, checkPackaging, getArtifactId, getBackupFile, getEncoding, getGetterFile, getI18nFile, getProject, isSilent, isStrictMode, isVerbose, needGeneration, setEncoding, setProject, setVerbose
 
Methods inherited from class org.nuiton.plugin.AbstractPlugin
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, checkEncoding, checkResource, checkRunOnceDone, checkSkip, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, doAction, execute, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, 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 Detail

bundleOutputDir

protected File bundleOutputDir
Directory where to generate aggregated bundles.

Since:
1.0.0
Is defined by:
expression:
${i18n.bundleOutputDir}
default-value:
${basedir}/target/generated-sources/resources/META-INF
Is required.

bundleOutputName

protected String bundleOutputName
Name of the bundle to generate.

Since:
1.0.2
Is defined by:
expression:
${i18n.bundleOutputName}
default-value:
${project.artifactId}-i18n
Is required.

checkBundle

protected boolean checkBundle
A flag to check that bundles are complete (no missing i18n translations).

Note : This behaviour will be activated is failsIfWarning is on.

Since:
1.0.0
Is defined by:
expression:
${i18n.checkBundle}
default-value:
true

showEmpty

protected boolean showEmpty
A flag to show missing i18n translation.

Note : Need the checkBundle to be activated).

Since:
1.0.0
Is defined by:
expression:
${i18n.showEmpty}
default-value:
false

failsIfWarning

protected boolean failsIfWarning
A flag to make the build fails if there is some warnings while generating bundle, says when it misses some translations.

Note : This parameter should be used in a release profile to ensure bundles are complete.

Since:
2.0
Is defined by:
expression:
${i18n.failsIfWarning}
default-value:
false

unsafeMapping

protected Map<Locale,SortedSet<String>> unsafeMapping
to keep all none translated i18n keys by locale.

Constructor Detail

AbstractMakeI18nBundleMojo

public AbstractMakeI18nBundleMojo()
Method Detail

init

public void init()
          throws Exception
Overrides:
init in class AbstractI18nMojo
Throws:
Exception

failsIfWarning

protected void failsIfWarning()
                       throws org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoFailureException


Copyright © 2007-2010 CodeLutin. All Rights Reserved.