Related to https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/674.

This change is required to make the times produced by the git-commit-id-maven-plugin usable for Maven's reproducible builds.

Timestamp for reproducible output archive entries must either formatted as ISO 8601 yyyy-MM-dd'T'HH:mm:ssXXX or as an int representing seconds since the epoch

Example usage might be E.g.

   <properties>
     <project.build.outputTimestamp>${git.commit.time}</project.build.outputTimestamp>
   </properties>

Comment From: jonatan-ivanov

Isn't yyyy-MM-dd'T'HHH:mm:ssZ (2024-02-16T19:32:16Z) in fact conforms ISO 8601?

If the time is in UTC, add a Z directly after the time without a space. Z is the zone designator for the zero UTC offset. "09:30 UTC" is therefore represented as "09:30Z" or "T0930Z". "14:45:15 UTC" would be "14:45:15Z" or "T144515Z".

(wiki: ISO 8601)

That's what the Maven docs are using too on the page you linked above:

<project.build.outputTimestamp>2023-01-01T00:00:00Z</project.build.outputTimestamp>

Comment From: michael-o

Isn't yyyy-MM-dd'T'HHH:mm:ssZ (2024-02-16T19:32:16Z) in fact conforms ISO 8601?

If the time is in UTC, add a Z directly after the time without a space. Z is the zone designator for the zero UTC offset. "09:30 UTC" is therefore represented as "09:30Z" or "T0930Z". "14:45:15 UTC" would be "14:45:15Z" or "T144515Z".

(wiki: ISO 8601)

That's what the Maven docs are using too on the page you linked above:

<project.build.outputTimestamp>2023-01-01T00:00:00Z</project.build.outputTimestamp>

No, you are confusing to yyyy-MM-dd'T'HH:mm:ss'Z' with yyyy-MM-dd'T'HHH:mm:ssZ.

Comment From: jonatan-ivanov

Oops, indeed, I meant Z in the output (UTC + ISO 8601), I missed that in the diff too. XXX does that if the time is in UTC but I'm not sure if that is guaranteed (if it isn't maybe that should be the concern of another issue). Btw, I think you also meant HH instead of HHH.

Comment From: mhalbritter

So, git.commit.time=2024-02-19T10:18:10+0100 (RFC 822) is bad, and git.commit.time=2024-02-19T10:18:10+01:00 (ISO 8601) is good? The latter can be parsed by Instant.parse, too.

Comment From: michael-o

So, git.commit.time=2024-02-19T10:18:10+0100 is bad, and git.commit.time=2024-02-19T10:18:10+01:00 is good? The latter can be parsed by Instant.parse, too.

Correct.

Comment From: mhalbritter

Note to myself: Check what the Gradle plugin does.

Comment From: michael-o

@TheSnoozer @mhalbritter Please change the title because ISO 8601 is not aware of any timezones, but offsets only.

Comment From: mhalbritter

Thank you very much and congratulations on your first contribution :tada:!

Comment From: TheSnoozer

Great, thanks for getting this integrated :-)

Comment From: wilkinsona

This has been superseded by https://github.com/spring-projects/spring-boot/issues/40015 as we can now use the plugin's default.