Maven Gettext Plugin

A plugin to integrate gettext tools into a Maven build.

This plugin is for Maven 1.x. A Maven 2.x plugin is available as well.


There are two alternative ways to install the plugin. Choose one:

  • The easiest way to install the gettext plugin is through Maven:
    maven plugin:download -DartifactId=maven-gettext-plugin -DgroupId=xnap-commons -Dversion=1.1
  • Alternatively add a dependency to your project.xml:
  • And add the XNap Commons repository to your

    maven.repo.remote =,


Expected Project Layout

If you are using the XNap Commons for internationalization (i18n) and if your project is layed out as shown below, the plugin will not require any configuration through properties.

+ po
  - keys.pot
  - xy.po
+ src
  + java

Build process integration

Invoke the merge goal to create or update your key template and po files:

maven gettext:merge

Additionally create a file called maven.xml in your project's base directory:

  <postGoal name="java:compile">
    <attainGoal name="gettext:dist"/>

This will update your Java class or property files from the po files each time the project is compiled.