jgitver-maven-plugin icon indicating copy to clipboard operation
jgitver-maven-plugin copied to clipboard

Make useGitCommitTimestamp independent of local time zone

Open johanblumenberg opened this issue 3 years ago • 0 comments

Issue

version: 1.9.0 usage context:

  • [x] maven command line: 3.8.3

Problem description:

Currently, when using <useGitCommitTimestamp> to add the commit timestamp to the generated version, the timestamp is added in the current locale of the machine where the build is done. This is a problem because the version becomes different for different developers. Everyone must be able to agree on which version a certain commit has.

Proposals

Suggesting to add another configuration to set which time zone to use, which can be set to the current time zone by default to keep backwards compatibility. Since we live in a global world where many companies and teams are spread across time zones it would make more sense to use UTC by default, but this I guess would be a breaking change.

Another idea would be to configure timestamps as <useGitCommitTimestamp>UTC</useGitCommitTimestamp>, not to have to introduce another configuration. Passing true would give the current behaviour of local time zone.

johanblumenberg avatar Dec 20 '21 13:12 johanblumenberg