Skip to content

Commit

Permalink
OF-2877 Reproducible builds
Browse files Browse the repository at this point in the history
Pin the build timestamp and disable Built-By, Created-By and Build-Jdk-Spec fields from generated manifest.
The Maven JAR plugin is updated to latest version that has the new option addDefaultEntries
  • Loading branch information
stokito committed Sep 22, 2024
1 parent 71ae021 commit 87ca30a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
4 changes: 4 additions & 0 deletions i18n/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<artifactId>i18n</artifactId>
<name>Internationalization files for Openfire</name>
<description>These files are shared among the starter and xmppserver modules</description>
<properties>
<!-- Use static build timestamp for reproducible builds -->
<project.build.outputTimestamp>2024-01-01T00:00:00Z</project.build.outputTimestamp>
</properties>
<build>
<resources>
<resource>
Expand Down
10 changes: 9 additions & 1 deletion plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Use static build timestamp for reproducible builds -->
<project.build.outputTimestamp>2024-01-01T00:00:00Z</project.build.outputTimestamp>

<!-- The name of the Openfire plugin (defaults to ${project.artifactId}. This value is somewhat particular:
- * It is used as a Java package name (and thus, cannot contain characters like dashes and dots.
Expand Down Expand Up @@ -280,8 +282,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<version>3.4.2</version>
<configuration>
<archive>
<manifest>
<!-- Don't add Created-By and Build-Jdk-Spec fields to manifest for reproducible builds -->
<addDefaultEntries>false</addDefaultEntries>
</manifest>
</archive>
<excludes>
<exclude>**/*_jsp.java</exclude>
</excludes>
Expand Down
6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Use static build timestamp for reproducible builds -->
<project.build.outputTimestamp>2024-01-01T00:00:00Z</project.build.outputTimestamp>

<!-- Versions -->
<!-- Note; the following jetty.version should be identical to the jetty.version in plugins/pom.xml -->
Expand Down Expand Up @@ -225,12 +227,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<version>3.4.2</version>
<configuration>
<archive>
<manifest>
<addClasspath>false</addClasspath>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<!-- Don't add Created-By and Build-Jdk-Spec fields to manifest for reproducible builds -->
<addDefaultEntries>false</addDefaultEntries>
</manifest>
<manifestEntries>
<Built-By>Jive Software (www.igniterealtime.org)</Built-By>
Expand Down
2 changes: 2 additions & 0 deletions starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<name>Starter for Openfire</name>
<description>Starts Openfire and also launches the web admin interface in a web browser</description>
<properties>
<!-- Use static build timestamp for reproducible builds -->
<project.build.outputTimestamp>2024-01-01T00:00:00Z</project.build.outputTimestamp>
</properties>
<build>
<plugins>
Expand Down
4 changes: 4 additions & 0 deletions xmppserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<name>Core XMPP Server</name>

<properties>
<!-- Use static build timestamp for reproducible builds -->
<project.build.outputTimestamp>2024-01-01T00:00:00Z</project.build.outputTimestamp>
<warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>
</properties>

Expand Down Expand Up @@ -106,6 +108,8 @@
<archive>
<manifest>
<addClasspath>true</addClasspath>
<!-- Don't add Created-By and Build-Jdk-Spec fields to manifest for reproducible builds -->
<addDefaultEntries>false</addDefaultEntries>
</manifest>
</archive>
<excludes>
Expand Down

0 comments on commit 87ca30a

Please sign in to comment.