Skip to content

Commit a5d0bd4

Browse files
authored
Feature: Locally reproducible builds (#108)
1 parent 2a82e48 commit a5d0bd4

2 files changed

Lines changed: 48 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Changes to prior versions can be found on the [Github release page](https://gith
1212
### Added
1313
- Changelog file
1414
- Maven wrapper script ([#103](https://github.com/cryptomator/cryptolib/pull/103))
15+
- Locally reproducible builds ([#106](https://github.com/cryptomator/cryptolib/pull/106))
1516

1617
### Changed
1718
- Pin CI actions

pom.xml

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<properties>
1717
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1818
<maven.compiler.release>8</maven.compiler.release>
19+
<project.build.outputTimestamp>2026-01-28T08:00:00Z</project.build.outputTimestamp>
1920

2021
<!-- dependencies -->
2122
<gson.version>2.12.1</gson.version>
@@ -31,9 +32,22 @@
3132
<jmh.version>1.37</jmh.version>
3233

3334
<!-- build plugin dependencies -->
35+
<central-publishing.version>0.10.0</central-publishing.version>
3436
<dependency-check.version>12.1.9</dependency-check.version>
37+
<exec-maven.version>3.6.2</exec-maven.version>
3538
<jacoco.version>0.8.14</jacoco.version>
36-
<central-publishing.version>0.7.0</central-publishing.version>
39+
<mvn-compiler.version>3.14.1</mvn-compiler.version>
40+
<mvn-clean.version>3.5.0</mvn-clean.version>
41+
<mvn-deploy.version>3.1.4</mvn-deploy.version>
42+
<mvn-enforcer.version>3.6.2</mvn-enforcer.version>
43+
<mvn-install.version>3.1.4</mvn-install.version>
44+
<mvn-javadoc.version>3.12.0</mvn-javadoc.version>
45+
<mvn-jar.version>3.5.0</mvn-jar.version>
46+
<mvn-gpg.version>3.2.8</mvn-gpg.version>
47+
<mvn-resources.version>3.3.1</mvn-resources.version>
48+
<mvn-shade.version>3.6.1</mvn-shade.version>
49+
<mvn-source.version>3.4.0</mvn-source.version>
50+
<mvn-surefire.version>3.5.4</mvn-surefire.version>
3751

3852
<!-- Property used by surefire to determine jacoco engine -->
3953
<surefire.jacoco.args />
@@ -134,7 +148,7 @@
134148
<plugin>
135149
<groupId>org.apache.maven.plugins</groupId>
136150
<artifactId>maven-enforcer-plugin</artifactId>
137-
<version>3.6.2</version>
151+
<version>${mvn-enforcer.version}</version>
138152
<executions>
139153
<execution>
140154
<id>enforce-java</id>
@@ -154,7 +168,7 @@
154168
</plugin>
155169
<plugin>
156170
<artifactId>maven-compiler-plugin</artifactId>
157-
<version>3.14.1</version>
171+
<version>${mvn-compiler.version}</version>
158172
<configuration>
159173
<encoding>UTF-8</encoding>
160174
<showWarnings>true</showWarnings>
@@ -192,7 +206,7 @@
192206
</plugin>
193207
<plugin>
194208
<artifactId>maven-shade-plugin</artifactId>
195-
<version>3.6.1</version>
209+
<version>${mvn-shade.version}</version>
196210
<executions>
197211
<execution>
198212
<phase>package</phase>
@@ -230,7 +244,7 @@
230244
<plugin>
231245
<groupId>org.codehaus.mojo</groupId>
232246
<artifactId>exec-maven-plugin</artifactId>
233-
<version>3.6.2</version>
247+
<version>${exec-maven.version}</version>
234248
<executions>
235249
<execution>
236250
<phase>package</phase>
@@ -243,6 +257,7 @@
243257
<arguments>
244258
<argument>--verbose</argument>
245259
<argument>--update</argument>
260+
<argument>--date=${project.build.outputTimestamp}</argument>
246261
<argument>--file=${project.build.directory}/${project.build.finalName}.jar</argument>
247262
<argument>META-INF/versions/9/module-info.class</argument>
248263
<argument>META-INF/versions/22/module-info.class</argument>
@@ -254,15 +269,15 @@
254269
<plugin>
255270
<groupId>org.apache.maven.plugins</groupId>
256271
<artifactId>maven-surefire-plugin</artifactId>
257-
<version>3.5.4</version>
272+
<version>${mvn-surefire.version}</version>
258273
<configuration>
259274
<argLine>@{surefire.jacoco.args} -Dnet.bytebuddy.experimental=true</argLine>
260275
</configuration>
261276
</plugin>
262277
<plugin>
263278
<groupId>org.apache.maven.plugins</groupId>
264279
<artifactId>maven-jar-plugin</artifactId>
265-
<version>3.5.0</version>
280+
<version>${mvn-jar.version}</version>
266281
<configuration>
267282
<archive>
268283
<manifestEntries>
@@ -274,7 +289,7 @@
274289
</plugin>
275290
<plugin>
276291
<artifactId>maven-source-plugin</artifactId>
277-
<version>3.4.0</version>
292+
<version>${mvn-source.version}</version>
278293
<executions>
279294
<execution>
280295
<id>attach-sources</id>
@@ -286,7 +301,7 @@
286301
</plugin>
287302
<plugin>
288303
<artifactId>maven-javadoc-plugin</artifactId>
289-
<version>3.12.0</version>
304+
<version>${mvn-javadoc.version}</version>
290305
<executions>
291306
<execution>
292307
<id>attach-javadocs</id>
@@ -325,6 +340,28 @@
325340
</tags>
326341
</configuration>
327342
</plugin>
343+
344+
<!-- for reproducible builds, fix version for plugins bound in built-in jar lifecycle -->
345+
<plugin>
346+
<groupId>org.apache.maven.plugins</groupId>
347+
<artifactId>maven-clean-plugin</artifactId>
348+
<version>${mvn-clean.version}</version>
349+
</plugin>
350+
<plugin>
351+
<groupId>org.apache.maven.plugins</groupId>
352+
<artifactId>maven-install-plugin</artifactId>
353+
<version>${mvn-install.version}</version>
354+
</plugin>
355+
<plugin>
356+
<groupId>org.apache.maven.plugins</groupId>
357+
<artifactId>maven-deploy-plugin</artifactId>
358+
<version>${mvn-deploy.version}</version>
359+
</plugin>
360+
<plugin>
361+
<groupId>org.apache.maven.plugins</groupId>
362+
<artifactId>maven-resources-plugin</artifactId>
363+
<version>${mvn-resources.version}</version>
364+
</plugin>
328365
</plugins>
329366
</build>
330367

@@ -394,7 +431,7 @@
394431
<plugins>
395432
<plugin>
396433
<artifactId>maven-gpg-plugin</artifactId>
397-
<version>3.2.8</version>
434+
<version>${mvn-gpg.version}</version>
398435
<executions>
399436
<execution>
400437
<id>sign-artifacts</id>

0 commit comments

Comments
 (0)