Skip to content

Commit 1ececbe

Browse files
committed
Use reproducible time stamps for Maven build artifacts
Unfortunately, JAR files store time stamps of the files inside them. These time stamps depend on the build time of these files hence breaking bit for bit reproducibility. By setting all time stamps to a predefined value and removing superfluous build artifacts this issue can be avoided. Conventionally, UNIX time stamp 1 signifies an intentionally set time stamp (in contrast to UNIX time stamp 0) which has no meaning and is easy to recognize.
1 parent 56abb9c commit 1ececbe

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ pkgs.stdenv.mkDerivation rec {
6767
then ''
6868
mvn javadoc:javadoc
6969
JEKYLL_ENV=production PAGES_REPO_NWO=VariantSync/DiffDetective JEKYLL_BUILD_REVISION= github-pages build
70+
rm -rf _site/target
7071
''
7172
else ""
7273
}

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1414
<maven.compiler.source>17</maven.compiler.source>
1515
<maven.compiler.target>17</maven.compiler.target>
16+
<!-- Override the time stamps of build artifacts to ensure reproducibility -->
17+
<project.build.outputTimestamp>1</project.build.outputTimestamp>
1618
</properties>
1719

1820
<build>

0 commit comments

Comments
 (0)