Skip to content

enable Reproducible Builds#21067

Open
hboutemy wants to merge 1 commit intoOpenAPITools:masterfrom
hboutemy:enable-rb
Open

enable Reproducible Builds#21067
hboutemy wants to merge 1 commit intoOpenAPITools:masterfrom
hboutemy:enable-rb

Conversation

@hboutemy
Copy link
Copy Markdown

@hboutemy hboutemy commented Apr 9, 2025

see https://maven.apache.org/guides/mini/guide-reproducible-builds.html

I just fixed what was reported by mvn artifact:check-buildplan -Prelease, which is the minimum to get noise reduction

more checks are needed, as documented with install then verify + artifact:compare to see if additional noise needs to be removed: just starting with the first step

Comment thread pom.xml
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.outputTimestamp>2025-04-09T17:14:21Z</project.build.outputTimestamp>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR. does it mean the build time stamp is hardcoded? do we need to update it regularly somehow?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is updated by versions:set when changing from SNAPSHOT to release and vice versa, or by maven-release-plugin
or you can also choose not to update but pick a purely conventional value

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend to set it instead to the timestamp of the latest git commit which can be done on every build
<project.build.outputTimestamp>${git.commit.timestamp.datetime}</project.build.outputTimestamp>

using https://github.com/qoomon/maven-git-versioning-extension

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a classical reaction from many people, as it seems a legitimate idea

just know that by doing so, you are killing any cache, as every commit will change the hash of every output archive, even if nothing changed

changing timestamp only on version updates limits the times when the cache will be de-facto flushed for any output of a multi-module Maven build

@wing328
Copy link
Copy Markdown
Member

wing328 commented Apr 10, 2025

when you've time, please review the CI test failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants