file. I see that the checksum for every WAR generated is always different from the last inspite of no code changes. I came across this issue (https://stackoverflow.com/questions/53006925/gradle-same-checksum-for-repeated-build/53012937#53012937) which says
The generated class files get a creation/modification timestamp of the time they were created
This modification date is added as metadata to the generated jar/zip archives which results in the checksum differences
How can I verify if it indeed is true? I do not see sources in the answer
I found diffoscope https://reproducible-builds.org/tools/ and this issue for Ant (https://bz.apache.org/bugzilla/show_bug.cgi?id=61269) which means the issue is true. Seems there is no native way to compare the differences, though I found the diff (time diff in my case) using the diffoscope
Did you try what's described in the documentation? tasks.withType(AbstractArchiveTask).configureEach { preserveFileTimestamps = false reproducibleFileOrder = true } https://docs.gradle.org/current/userguide/working_with_files.html#sec:reproducible_archives
I do not use gradle, unfortunately. I use Ant
Ah, ok, got it
my question was how do I verify why my build is not reproducible
Because file attributes are added to zip/jar. And your compiled class files, and basically any other generated resource (log4j/logback configs, application.properties, etc.) will have the timestamp of the time when you executed build.
Here's what I find. Seems, it's not supported. Only manual workaround - set fixed timestamp to all files, and order files ((( https://bz.apache.org/bugzilla/show_bug.cgi?id=61269
Обсуждают сегодня