My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
MavenRepository  
This page explains how to edit your Maven 2 pom.xml file to use the Gettext Commons Maven repository.
Featured
Updated Aug 25, 2010 by berge...@gmail.com

Adding the repository

Add the following lines to your pom.xml file to include the Gettext Commons repository:

<project>
  ...
  <repositories>
    ...
    <repository>
      <id>gettext-commons-site</id>
      <url>http://gettext-commons.googlecode.com/svn/maven-repository/</url>
    </repository>
  </repositories>

Adding the Gettext Commons library

Add the following lines to your pom.xml file to add the Gettext Commons library as a dependency to your project:

<project>
 ...
 <dependencies> 
  ...
  <dependency>
      <groupId>org.xnap.commons</groupId>
      <artifactId>gettext-commons</artifactId>
      <version>0.9.6</version>
  </dependency>
 </dependencies>

Adding the Maven plugin

Add the following lines to your pom.xml file to make use of the maven gettext plugin for generating messages templates and deploying messages bundles.

<project>
 ...
 <pluginRepositories>
  <pluginRepository>
    <id>gettext-commons-site</id>
    <url>http://gettext-commons.googlecode.com/svn/maven-repository/</url>
    <releases>
      <updatePolicy>daily</updatePolicy>
    </releases>
  </pluginRepository>
 </pluginRepositories>
 ...
 <plugins> 
  ...
  <plugin>
    <groupId>org.xnap.commons</groupId>
    <artifactId>maven-gettext-plugin</artifactId>
    <version>1.2.3</version>
    <configuration>
      <poDirectory>${basedir}/po</poDirectory>
      <targetBundle>my.package.Messages</targetBundle>
    </configuration>
  </plugin>
 </plugins>
Comment by zpsigma, Jan 17, 2010

I follow these instructions and failed, just like this guy: http://www.mail-archive.com/dhis2-devs@lists.launchpad.net/msg00754.html

And the section "Adding the Maven plugin", maybe have somethings wrong.

I modified my pom.xml like below, and it seems work fine.

  <build>
     ...
      <plugin>
	<groupId>org.xnap.commons</groupId>
	<artifactId>maven-gettext-plugin</artifactId>
	<version>${gettextPluginVersion}</version>
	<configuration>
	  <targetBundle>Message</targetBundle>
	</configuration>
      </plugin>
    </plugins>
  </build>
Comment by project member berge...@gmail.com, Apr 22, 2010

Thanks, zpsigma, I added your changes to the wiki page.

Comment by adamf...@gmail.com, Sep 8, 2011

I would really recommend putting this up on Sonatype/Nexus and syncing with Maven central. Having it on separate repo causes all sorts of issues.


Sign in to add a comment
Powered by Google Project Hosting