-
Notifications
You must be signed in to change notification settings - Fork 40.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix plugin timezone dependency #34428
Conversation
@nielsbasjes Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@nielsbasjes Thank you for signing the Contributor License Agreement! |
I installed this version of the plugin locally and then when I use that version in my reproduction project I actually get the right timestamps and all files (using all timezones in docker) are binary identical and the timestamp looks exact like what was configured: 2011-11-11 22:22 . https://github.com/nielsbasjes/BugreportSpringPluginTimezone |
@nielsbasjes I don't think manipulating the time zone like this is the right way to approach the fix. Looking at the Unlike Maven, Spring Boot does not apply the Would you like to try this change instead? |
The problem is not in the parsing of the timestamp. That is done correctly. The parsed timestamp is then persisted in an instance of The proposed It is then the Zip creation code (from commons-compress) that converts the epoch into something else using an instance of Calendar which is based on the system default Timezone. As far as I can tell all the code in the Spring project correctly handles the timestamps. |
Also: It is possible to provide the desired timestamp as epoch which cannot have a timestamp and thus a timezone must be chosen. The current choice is the local system timezone, my proposal is to force (or make configurable?) this to be the UTC timezone. |
I wonder if we can change this logic in JarWriter.writeToArchive(...) so that |
@philwebb So you shift the epoch timestamp using the current timezone, because you expect the underlying code to shift it back again? I would vote against such code. |
Yeah. The reason I prefer it is because |
That was my concern too, that this could have unpredictable side-effects that are difficult to diagnose. |
Yes that is true. |
I'll have a look tomorrow if I can make this nasty time shifting work reliable. |
I discovered the javadoc for Thanks for raising the issue and providing the analysis. |
This is a proposed fix for the reproducibility problem described here
#34424