Mojo Build Number Maven Plugin

Locale support for formatting dates and times

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Testcase included:
    yes
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

Description

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.

Activity

Hide
Dan Tran added a comment -

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

Show
Dan Tran added a comment - 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
Hide
Dan Tran added a comment -

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

please test the latest snapshot

Show
Dan Tran added a comment - the patch files were checked in accidentally. I removed them from svn please test the latest snapshot

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: