If I build a kotlin jar twice, will those jars be ...
# getting-started
u
If I build a kotlin jar twice, will those jars be bit equal? (i.e. their sha equal)
m
This is from decades ago and Java, so things may have changed or I could be remember wrong, but I did something where I extracted all the files from the a jar and then added them back into a new jar and the checksums didn't match.
e
jars are zipfiles, and contain timestamps on their entries
Gradle 9 defaults to setting the timestamps to a fixed value (zero) with the goal of making the jars reproducible
but other tools will not
u
neat, im on 9 for sime time, thanks!
j
For what it's worth, the Kotlin Toolchain also ensures reproducible jars by setting timestamps and using a stable entry order.
e
didn't see that documented anywhere, but that's nice
it seems Maven finally changed their defaults too https://issues.apache.org/jira/browse/MNG-8258
j
> didn't see that documented anywhere Fair enough, I will fix that. It seemed like an implementation detail to me, but, as this thread shows, some more advanced users are proactively looking for this info 🙂