Class GenerateCsvBundleMojo

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="generate-csv-bundle", defaultPhase=GENERATE_RESOURCES, requiresProject=true, requiresDependencyResolution=RUNTIME) public class GenerateCsvBundleMojo extends AbstractCsvBundleMojo
To generate a csv file from the full bundle of the module. The csv file will have a first column with i18n keys, and a column for each locale defined in AbstractI18nMojo.locales. Created on 7/26/14.
Since:
3.3
Author:
Tony Chemit - chemit@codelutin.com
  • Field Details

    • bundleOutputName

      @Parameter(property="i18n.bundleOutputName", defaultValue="${project.artifactId}-i18n", required=true) protected String bundleOutputName
      Name of the bundle to use.
    • bundleInputEncoding

      @Parameter(property="i18n.bundleInputEncoding") protected String bundleInputEncoding
      Encoding used to read any i18n property files. If not defined, will use the AbstractI18nMojo.encoding parameter.
    • bundleOutputEncoding

      @Parameter(property="i18n.bundleOutputEncoding") protected String bundleOutputEncoding
      Encoding used to write any files. If not defined, will use the AbstractI18nMojo.encoding parameter.
    • bundleOutputDir

      @Parameter(property="i18n.bundleOutputDir", defaultValue="${project.build.directory}/generated-sources/resources", required=true) protected File bundleOutputDir
      Root directory where to generate aggregated bundles (this directory will be added as resources of the project).
    • bundleOutputPackage

      @Parameter(property="i18n.bundleOutputPackage", defaultValue="META-INF", required=true) protected String bundleOutputPackage
      Package name of the generate aggregated bundles. Note: By default we use the 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
       
    • addInClassPath

      @Parameter(property="i18n.addInClassPath", defaultValue="true") protected boolean addInClassPath
      To add the generated csv file in the classpath. If bundleCsvDirectory is filled, then will add the generated csv file at the root of class-path, otherwise will add add it in the bundleOutputPackage package.
    • bundleCsvFileName

      @Parameter(property="i18n.bundleCsvFile", defaultValue="${i18n.bundleOutputName}-i18n.csv", required=true) protected String bundleCsvFileName
      Location of the csv file to split.
    • bundleCsvDirectory

      @Parameter(property="i18n.bundleCsvDirectory") protected File bundleCsvDirectory
      If you want to specify where to generate the csv file. If not filled, then will generate it in the same directory where bundles are stored.
    • outputFolder

      protected File outputFolder
      The definitive directory where to load the bundles (includes the package of bundle).
    • bundleCsvFile

      protected File bundleCsvFile
      The definitive file where to write the csv file.
  • Constructor Details

    • GenerateCsvBundleMojo

      public GenerateCsvBundleMojo()
  • 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
    • getBundleOutputFolder

      protected File getBundleOutputFolder()