SOURCE_DATE_EPOCH is perfect for Linux distributions, that do their own distro-specific packages (.rpm, .deb, .apk, ...) from the upstream project by adding some patches and some packaging instructions => having a general way to inject its own choice of timestamp through a standardized environment variable is perfect (for any language or build tool)
here, we are at upstream project level focusing on the JVM and Maven, trying to avoid the Java developer to have to run anything additional when he builds his project, and even less when he's a release manager doing the official release (with maven-release-plugin or other automation approach) That's why Maven-way to inject a predictable timestamp is not by adding (by hand or expecting a shell script) an environment variable before running mvn, but getting the value calculated inside mvn invocation but Reproducible Builds principles remain the same: a predictible timestamp is absolutely necessary to have reproducible timestamp entries in archives (based on tar & zip in general) Regards, Hervé On 2024/09/25 18:50:08 John Neffenger wrote: > A follow-up message for those not familiar with the SOURCE_DATE_EPOCH > environment variable ... > > On 9/25/24 9:22 AM, John Neffenger wrote: > > That makes sense, but in general, I always set the date like this: > > > > SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) > > export SOURCE_DATE_EPOCH > > > > I pass that to Maven with: > > > > <project.build.outputTimestamp> > > ${env.SOURCE_DATE_EPOCH} > > </project.build.outputTimestamp> > > The page below describes the variable, including a link to its > specification: > > SOURCE_DATE_EPOCH > https://reproducible-builds.org/docs/source-date-epoch/ > > The following page gives more background information: > > ReproducibleBuilds/StandardEnvironmentVariables > https://wiki.debian.org/ReproducibleBuilds/StandardEnvironmentVariables > > John > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org > For additional commands, e-mail: dev-h...@maven.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org