org.nuiton.i18n.plugin.bundle
Class CollectI18nArtifactsMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
org.nuiton.i18n.plugin.AbstractI18nMojo
org.nuiton.i18n.plugin.bundle.AbstractI18nBundleMojo
org.nuiton.i18n.plugin.bundle.CollectI18nArtifactsMojo
- All Implemented Interfaces:
- org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.plugin.Plugin, org.nuiton.plugin.PluginWithEncoding
public class CollectI18nArtifactsMojo
- extends AbstractI18nBundleMojo
Detects any i18n artifacts in the dependencies of the project and store
their references in a file.
The generated file will be used by bundle mojo to generate the final
aggregated bundle.
- Since:
- 1.0.2
- Author:
- tchemit
- Is defined by the goal name:
- collect-i18n-artifacts
- Is bound to the specified phase of the standard build lifecycle:
- generate-resources
- Requires the dependencies in this specified scope:
- runtime
- Requires a Maven project to run:
- true
| Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin |
org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging |
|
Field Summary |
protected org.apache.maven.artifact.metadata.ArtifactMetadataSource |
artifactMetadataSource
Artifact metadata source component. |
protected org.apache.maven.artifact.resolver.ArtifactCollector |
collector
Artifact collector component. |
protected org.apache.maven.shared.dependency.tree.DependencyTreeBuilder |
dependencyTreeBuilder
Dependency tree builder component. |
protected org.apache.maven.artifact.factory.ArtifactFactory |
factory
Artifact Factory component. |
protected org.apache.maven.artifact.repository.ArtifactRepository |
localRepository
Local Repository. |
| 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 |
| 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, 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 |
localRepository
protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
- Local Repository.
- Since:
- 1.0.2
- Is defined by:
- expression:
- ${localRepository}
- Is readonly.
- Is required.
dependencyTreeBuilder
protected org.apache.maven.shared.dependency.tree.DependencyTreeBuilder dependencyTreeBuilder
- Dependency tree builder component.
- Since:
- 1.0.2
- Is a Plexus component defined by:
factory
protected org.apache.maven.artifact.factory.ArtifactFactory factory
- Artifact Factory component.
- Since:
- 1.0.2
- Is a Plexus component defined by:
artifactMetadataSource
protected org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource
- Artifact metadata source component.
- Since:
- 1.0.2
- Is a Plexus component defined by:
collector
protected org.apache.maven.artifact.resolver.ArtifactCollector collector
- Artifact collector component.
- Since:
- 1.0.2
- Is a Plexus component defined by:
CollectI18nArtifactsMojo
public CollectI18nArtifactsMojo()
init
public void init()
throws Exception
- Overrides:
init in class AbstractI18nMojo
- Throws:
Exception
doAction
protected void doAction()
throws Exception
- Specified by:
doAction in class org.nuiton.plugin.AbstractPlugin
- Throws:
Exception
getCollectI18nResources
protected URL[] getCollectI18nResources(Locale locale)
throws IOException,
org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException
- Description copied from class:
AbstractI18nBundleMojo
- Pour obtenir les urls des fichiers i18n d'un projet (avec recherche dans
ses dépendances).
Note: L'ordre des urls reflète l'ordre des dépendances.
- Specified by:
getCollectI18nResources in class AbstractI18nBundleMojo
- Parameters:
locale - la locale a traiter
- Returns:
- les urls des bundles i18n detectees pour le projet.
- Throws:
IOException
org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException
storeCollectI18nResources
protected void storeCollectI18nResources(File bundleOut,
URL[] urls)
throws IOException
- Throws:
IOException
detectI18nArtifacts
protected I18nArtifact[] detectI18nArtifacts()
throws IOException,
org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException
- Detecte les
I18nArtifact et les retourne dans l'ordre de
chargement dans le système i18n, i.e l'ordre des dependances entre
artifacts.
- Returns:
- les artifacts i18nables triés par leur ordre de chargement dans
le système i18n.
- Throws:
IOException - while detecting bundles from
artifacts
org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException - if any error while building the
depencendy tree
detectBundles
protected void detectBundles(I18nArtifact i18nArtifact,
List<org.apache.maven.artifact.Artifact> artifacts,
Map<org.apache.maven.artifact.Artifact,I18nArtifact> dico)
throws IOException
- Throws:
IOException
Copyright © 2007-2011 CodeLutin. All Rights Reserved.