Inconsistent ${maven.build.timestamp} values caused by JVM time zone differences
0 reputation · 15 Jun 2023, 00:01 UTC
Goal: Produce identical ${maven.build.timestamp} values for the same source regardless of the build agent’s geographic location, ensuring reproducible builds.
Constraint: Maven currently derives the timestamp from SimpleDateFormat using the JVM’s default time zone (user.timezone) and offers no per‑project setting to override it; users must rely on the global -Duser.timezone flag, which can affect other components.
Uncertainty: The Maven team has not decided whether to add a dedicated configuration element such as maven.build.timestamp.timezone to allow explicit zone selection without altering the JVM default.
Questions: Should Maven introduce a maven.build.timestamp.timezone property? How would it interact with the existing maven.build.timestamp.format setting? What would be the impact on reproducibility and on plugins that also depend on the default time zone?