Currently the buildnumber plugin just uses the platform default locale when formatting dates and times. This is troublesome as it makes the build result depend on system- or user-specific settings.
The attached patch adds an "locale" configuration option that can be used to explicitly specify the locale to use for formatting. The default is still the platform default locale, so this change should introduce no backwards compatibility issues. I included a "@since 1.0-beta-2" for the configuration option, hoping that this change could be included in the next release.
There's also a simple unit test for the added locale support. To simplify the tests I moved the shared code for getting the base directory up to the setUp() method.
patch applied, thanks
Revision: 8551
Author: dantran
Date: 9:05:47 PM, Tuesday, January 06, 2009
Message:
MOJO-1193:support display date with localeAdded : /trunk/mojo/buildnumber-maven-plugin/buildnumber-locale.patch
Added : /trunk/mojo/buildnumber-maven-plugin/buildnumber-maven-plugin.patch
Modified : /trunk/mojo/buildnumber-maven-plugin/pom.xml
Modified : /trunk/mojo/buildnumber-maven-plugin/src/main/java/org/codehaus/mojo/build/BuildMojo.java
Modified : /trunk/mojo/buildnumber-maven-plugin/src/test/java/org/codehaus/mojo/build/TestBuildMojo.java