Class CollectI18nArtifactsMojo

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="collect-i18n-artifacts", defaultPhase=GENERATE_RESOURCES, requiresProject=true, requiresDependencyResolution=RUNTIME) 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:
Tony Chemit - chemit@codelutin.com
  • Field Details

    • src

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

      @Parameter(property="localRepository", required=true, readonly=true) protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
      Local Repository.
      Since:
      1.0.2
    • dependencyTreeBuilder

      @Component protected org.apache.maven.shared.dependency.graph.DependencyGraphBuilder dependencyTreeBuilder
      Dependency tree builder component.
      Since:
      1.0.2
  • Constructor Details

    • CollectI18nArtifactsMojo

      public CollectI18nArtifactsMojo()
  • Method Details

    • 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
      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
    • storeCollectI18nResources

      protected void storeCollectI18nResources(File bundleOut, URL[] urls) throws IOException
      Throws:
      IOException
    • detectI18nArtifacts

      protected I18nArtifact[] detectI18nArtifacts() throws IOException, org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException
      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.graph.DependencyGraphBuilderException
    • 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