We use SNAPSHOTs a lot and rebuild frequently, and have found that even if the source was unchanged the resulting artifact was not binary identical to the artifact built last time.
I would like them to be.
To my understanding from a SO post I cannot find again there are two reasons they change:
- JAR/WAR/etc files are zip files with extra metadata, and each entry has a timestamp which is either "assembly time" or "compile time".
- Signed jars contain signing information, which is not sorted (i.e. the order may change between JVMs)
We do not use signed jars at the moment, and I can live with all datestamps in the JAR/WAR/etc files being 0 if that will buy me binary identity.
Apparently that means I need to get Maven Archiver to explicitly set date stamps when assembling the jar, but I cannot locate the place in the documentation where I can set this, so it most likely does not exist. A quick look at the maven-jar-plugin and maven-war-plugin to see where the information is collected did not make me much wiser of how to change it.
My question is, how should I approach this?