@Mojo(name="bundle",
defaultPhase=GENERATE_RESOURCES,
requiresProject=true,
requiresDependencyResolution=RUNTIME)
@Execute(goal="collect-i18n-artifacts")
public class BundleMojo
extends AbstractI18nBundleMojo
| Modifier and Type | Field and Description |
|---|---|
protected File |
bundleCsvFile
Deprecated.
since 3.3, prefer use the new mojo generate-csv-bundle instead
|
protected String |
bundleCsvSeparator
Deprecated.
since 3.3, prefer use the new mojo generate-csv-bundle instead
|
protected String |
bundleFormatConverter
Converter used to change format of bundles.
|
protected Map<String,BundleFormatConverter> |
bundleFormatConverters
Map of all availables
BundleFormatConverter. |
protected String |
bundleInputEncoding
Encoding used to load any i18n property files.
|
protected File |
bundleOutputDir
Root directory where to generate aggregated bundles (this directory will
be added as resources of the project).
|
protected String |
bundleOutputEncoding
Encoding used to write any i18n property files.
|
protected String |
bundleOutputName
Name of the bundle to generate.
|
protected String |
bundleOutputPackage
Package name of the generate aggregated bundles.
|
protected BundleValidation |
bundleValidation
Contains validation result after
AbstractI18nMojo.checkBundle(Locale, Properties, boolean, BundleValidation). |
protected boolean |
checkBundle
A flag to check that bundles are complete (no missing i18n translations).
|
protected BundleFormatConverter |
converter
Format converter to apply if
|
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 |
generateCsvFile
Deprecated.
since 3.3, prefer use the new mojo generate-csv-bundle instead
|
protected boolean |
generateDefaultLocale
A flag to generate a bundle with the first locale defined as a default
bundle (with no locale specialization).
|
protected boolean |
generateDefinitionFile
A flag to generate the i18n definition file.
|
protected File |
outputFolder
The definitive directory where to generate the bundles (includes the
package of bundle).
|
protected boolean |
showEmpty
A flag to show missing i18n translation.
|
collectOutputDir, collectOutputNamebundles, encoding, locales, mavenSession, project, silent, verbose| Constructor and Description |
|---|
BundleMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyConversion(Properties properties)
Apply conversion over
properties with internal converter. |
protected void |
doAction() |
protected void |
failsIfWarning() |
protected void |
generateCsvFile()
Generates a csv file with all translations.
|
protected void |
generateDefaultBundle()
Generates the default bundle, says the bundle with no locale specialized.
|
protected void |
generateDefinitionFile(String version,
Map<Locale,String> bundleDico) |
protected File |
getBundleFile(File root,
String artifactId,
Locale locale,
boolean create) |
String |
getBundleInputEncoding() |
String |
getBundleOutputEncoding() |
protected File |
getBundleOutputFolder() |
protected URL[] |
getCollectI18nResources(Locale locale)
Pour obtenir les urls des fichiers i18n d'un projet (avec recherche dans
ses dépendances).
|
void |
init() |
getCollectOutputFilebackupFile, checkBundle, checkPackaging, getBackupFile, getEncoding, getProject, isSilent, isVerbose, setEncoding, setProject, setVerboseacceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, checkEncoding, checkResource, checkRunOnceDone, checkSkip, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, needInvoke, needInvoke, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFilegetLog, getPluginContext, setLog, setPluginContext@Parameter(property="i18n.bundleInputEncoding") protected String bundleInputEncoding
AbstractI18nMojo.encoding parameter.@Parameter(property="i18n.bundleOutputEncoding") protected String bundleOutputEncoding
AbstractI18nMojo.encoding parameter.@Parameter(property="i18n.bundleOutputDir",
defaultValue="${basedir}/target/generated-sources/resources",
required=true)
protected File bundleOutputDir
@Parameter(property="i18n.bundleOutputPackage",
defaultValue="META-INF",
required=true)
protected String bundleOutputPackage
META-INF package
since it is the favorite package of I18n runtime initializer.
The package name is dotted as it will be stored as folder like in Java
language.
Example :
package name : foo.bar
directory : foo/bar
@Parameter(property="i18n.bundleOutputName",
defaultValue="${project.artifactId}-i18n",
required=true)
protected String bundleOutputName
@Parameter(property="i18n.generateDefaultLocale",
defaultValue="false")
protected boolean generateDefaultLocale
@Parameter(property="i18n.checkBundle",
defaultValue="true")
protected boolean checkBundle
failsIfWarning is on.@Parameter(property="i18n.showEmpty",
defaultValue="false")
protected boolean showEmpty
checkBundle to be activated).@Parameter(property="i18n.failsIfWarning",
defaultValue="false")
protected boolean failsIfWarning
protected BundleValidation bundleValidation
AbstractI18nMojo.checkBundle(Locale, Properties, boolean, BundleValidation).
May be null if validation is disabled.protected File outputFolder
@Parameter(property="i18n.generateDefinitionFile",
defaultValue="true")
protected boolean generateDefinitionFile
@Parameter(property="i18n.generateCsvFile",
defaultValue="false")
@Deprecated
protected boolean generateCsvFile
@Parameter(property="i18n.bundleCsvFile",
defaultValue="${basedir}/target/${project.artifactId}-i18n.csv")
@Deprecated
protected File bundleCsvFile
generateCsvFile is on.@Parameter(property="i18n.bundleCsvSeparator",
defaultValue="\t")
@Deprecated
protected String bundleCsvSeparator
generateCsvFile is on.@Parameter(property="i18n.bundleFormatConverter") protected String bundleFormatConverter
@Component(role=BundleFormatConverter.class) protected Map<String,BundleFormatConverter> bundleFormatConverters
BundleFormatConverter.protected BundleFormatConverter converter
public void init()
throws Exception
init in class AbstractI18nMojoExceptionprotected void doAction()
throws Exception
doAction in class org.nuiton.plugin.AbstractPluginExceptionprotected File getBundleFile(File root, String artifactId, Locale locale, boolean create) throws IOException
IOExceptionprotected void generateDefinitionFile(String version, Map<Locale,String> bundleDico) throws IOException
IOExceptionprotected URL[] getCollectI18nResources(Locale locale) throws IOException
AbstractI18nBundleMojogetCollectI18nResources in class AbstractI18nBundleMojolocale - la locale a traiterIOExceptionprotected void applyConversion(Properties properties)
properties with internal converter.properties - Properties to walk throughprotected void generateCsvFile()
throws IOException
IOException - if any IO problem while the copy.protected void failsIfWarning()
throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureExceptionprotected void generateDefaultBundle()
throws IOException
IOException - if any IO problem while the copy.protected File getBundleOutputFolder()
public String getBundleOutputEncoding()
public String getBundleInputEncoding()
Copyright © 2007–2016 CodeLutin. All rights reserved.