UPDATE: As of 1/14/2008, the message bundle is generated to the source directory, not the build output directory. The Ant task will not overwrite a file that hasn't changed, so the only time you'll earn a build manager's wrath for mucking with source-managed files is when you forget to check in the generated message bundle file. So don't forget. I've added a wiki page detailing most of what's below without the color commentary provided by yours truly. So don't click it and keep reading... 
Having added an i18n utility for your component and reveled in how nice it is to write your messages directly in the code, you need to actually generate the message properties bundle. That's where the Hulp i18n Ant task comes in. You may want to take a quick gander at my blog entry detailing how to add Ant tasks to your Maven project; that'll tell you where to add the targets I'll detail below. Let's dive right in...
<!-- define the i18n task -->
<taskdef name="i18n" classname="net.java.hulp.i18n.buildtools.I18NTask">
<classpath>
<pathelement location="${maven.repo.local}/net/java/hulp/i18ntask/net.java.hulp.i18ntask/2.1-SNAPSHOT/net.java.hulp.i18ntask-2.1-SNAPSHOT.jar"/>
</classpath>
</taskdef>
<!-- call the i18n task -->
<i18n dir="${project.build.outputDirectory}"
file="${project.build.sourceDirectory}/com/sun/jbi/engine/xslt/msgs.properties"
prefix=""
pattern="(XSLTSE-[4-7]\d\d\d)(: )(.*)"/>
<!-- Copy the generated file to the build output directory to be packaged with jar -->
<copy file="${project.build.sourceDirectory}/com/sun/jbi/engine/xslt/msgs.properties"
todir="${project.build.outputDirectory}/com/sun/jbi/engine/xslt"/>
The taskdef is straightforward, though you'll need to add a dependency on the Hulp i18n Ant task library in your pom. A closer look at i18n's attributes:
- dir
- The Ant task parses the compiled binary files searching for messages by the specified message identifier pattern, which is why the task is called after the compile phase. This attribute points to the build output directory for your component project.
- file
- This is the location to which the message bundle file is generated. Note the generation occurs to the build source directory, which is usually a no-no because no build step is allowed to overwrite source-managed files. The Ant task will not overwrite a file that hasn't changed since the last generation. Keep this in mind when managing your source files in version control and ALWAYS check in the newly generated bundle file.
- prefix
- The component prefix which begins every message, comprising the alpha portion of the message's unique id. Remember, pass an empty value if the prefix is already part of the message identifier pattern.
- pattern
- The message identifier pattern, which MUST match the pattern given to your component's I18n utility implementation's constructor.
Here's the dependency to add to your pom to ensure that the Hulp i18n Ant task is available for the taskdef's classpath:
<dependency>
<groupId>net.java.hulp.i18ntask</groupId>
<artifactId>net.java.hulp.i18ntask</artifactId>
<version>2.1-SNAPSHOT</version>
</dependency>
Add the taskdef and i18n targets, plus the dependency, to your pom and you should be ready to go. Feel free to email me with questions.
