Fork me on GitHub

Usage

i18n Maven Plugin goals are bound to different phases in the maven build life cycle. So when you execute a specific phase, the Plugin goals bound to it are also executed. Aside from this, each goal can also be explicitly executed from the command line.

Plugin

<project>
  ...
  <build>
   ...
   <plugins>
     ...
     <plugin>
       <groupId>com.benasmussen.maven</groupId>
       <artifactId>i18n-maven-plugin</artifactId>
       <version>1.0.0</version>
        <executions>
          <execution>
            <id>i18n</id>
            <phase>generate-resources</phase>
            <goals>
               <goal>i18n</goal>
            </goals>
          </execution>
        </executions>
     </plugin>
     ...
   </plugins>
   ...
  </build>
  ...
</project>

Plugin Configuration

<build>
  <plugins>
    <plugin>
      <groupId>com.benasmussen.maven</groupId>
      <artifactId>i18n-maven-plugin</artifactId>
      <version>1.0.0-SNAPSHOT</version>
      <executions>
        <execution>
          <id>i18n</id>
          <phase>generate-resources</phase>
          <goals>
            <goal>i18n</goal>
          </goals>
        </execution>
      </executions>
      <configuration>
        <localeCell>C1</localeCell>
        <keyCell>B4</keyCell>
        <files>
          <file>src/main/resources/test.xls</file>
        </files>
        <outputFormat>
          <format>properties</format>
          <format>json</format>
          <format>xml</format>
        </outputFormat>
        <outputDirectory>target/i18n</outputDirectory>
        <outputEncoding>UTF-8</outputEncoding>
      </configuration>
    </plugin>
  </plugins>
</build>

Maven Repository

Add the following maven repository to your pom.xml file to use the plugin.

<project>
  ...
  <pluginRepositories>
    <pluginRepository>
      <id>github-plugin-releases</id>
      <url>http://basmussen.github.io/repos/maven/plugins/releases/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>  
  ...
</project>