[MRRESOURCES-135] Show projectTimespan
year in UTC
#39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Show the 'current' year in the
projectTimespan
(used for example in https://github.com/apache/maven-apache-resources/blob/master/jar/src/main/resources/META-INF/NOTICE.vm#L21 ) in UTC.By default,
SimpleDateFormat
formats thejava.util.Date
(which does not carry a timezone) in the 'current' timezone. This is not reproducible, as whenproject.build.outputTimestamp
is set to a time close to new years', two builds in different timezones may produce a different year.This change makes sure the year is shown in UTC. This especially makes sense when
project.build.outputTimestamp
is given in seconds since epoch, since epoch is defined to be given relative to 00:00:00 UTC on Thursday, 1 January 1970. It is also likely the most common timezone when specifyingproject.build.outputTimestamp
as a date.I did not introduce a new unit test to test this behaviour, but I did update an existing test to be more likely to fail in this case (specifically, when building with for example
TZ=GMT-7
).