Skip to content

GH-1724: Set project.build.outputTimestamp for reproducible builds - #1727

Open
rzo1 wants to merge 2 commits into
mainfrom
gh-1724-output-timestamp
Open

rzo1 wants to merge 2 commits into
mainfrom
gh-1724-output-timestamp

Conversation

@rzo1

@rzo1 rzo1 commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1724.

Declares project.build.outputTimestamp in the root pom.xml, so maven-release-plugin sets it to the release time; until now builds inherited the date of the Apache parent POM. Two clean builds now give identical jars, source and binary archives, including the PDF manual built in different time zones.

The PDF needs a workaround: it is rendered by docbkx-maven-plugin 2.0.17, which is no longer maintained and is bound to FOP 1.1. FOP 1.1 writes the build time and a random document ID into every PDF, with no option to set them, and FOP 2.x cannot be used, because it removed FopFactory.newInstance() and setUserConfig(Configuration), which docbkx calls. An antrun step in opennlp-docs therefore replaces the dates with project.build.outputTimestamp and the ID with a checksum of the content; the values keep their length, so the offsets in the PDF stay valid. .mvn/jvm.config runs Maven in UTC, because FOP writes the time zone as +01'00' or Z, with a length that depends on the machine. Moving the manual to a maintained format in the long run, for example AsciiDoc as used by the website, would remove docbkx, FOP 1.1 and this step.

Declare the property in the root pom.xml. Builds inherited the value of
the Apache parent POM, and maven-release-plugin only sets it to the
release time when the project declares it.

Signed-off-by: Richard Zowalla <rzo1@apache.org>
@rzo1 rzo1 added this to the 3.0.1 milestone Dec 3, 2026
@rzo1 rzo1 added task Maintenance or housekeeping work (Jira: Task) component: build Build, packaging, CI and test infrastructure labels Dec 3, 2026
@rzo1 rzo1 self-assigned this Dec 3, 2026
FOP writes the build time and a random ID into the PDF. Replace them
after rendering with project.build.outputTimestamp and a checksum of the
content. The values keep their length, so the offsets in the PDF stay
valid. Run Maven in UTC (.mvn/jvm.config), because FOP writes the time
zone with a length that depends on it.

Signed-off-by: Richard Zowalla <rzo1@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport: 2.x Also needs to go to the opennlp-2.x branch component: build Build, packaging, CI and test infrastructure task Maintenance or housekeeping work (Jira: Task)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set project.build.outputTimestamp for reproducible builds

1 participant