Issue Details (XML | Word | Printable)

Key: MOJO-1193
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Dan Tran
Reporter: Jukka Zitting
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Mojo

Locale support for formatting dates and times

Created: 30/Jul/08 07:48 AM   Updated: 06/Jan/09 11:13 PM   Resolved: 06/Jan/09 11:08 PM
Component/s: buildnumber
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Text File buildnumber-locale.patch (5 kB)


Complexity: Intermediate
Testcase included: yes
Patch Submitted: Yes


 Description  « Hide

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.



Dan Tran added a comment - 06/Jan/09 11:08 PM

patch applied, thanks

Revision: 8551
Author: dantran
Date: 9:05:47 PM, Tuesday, January 06, 2009
Message:
MOJO-1193:support display date with locale


Added : /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


Dan Tran added a comment - 06/Jan/09 11:13 PM

the patch files were checked in accidentally. I removed them from svn

please test the latest snapshot