[ https://issues.apache.org/jira/browse/MJAR-314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17888427#comment-17888427 ]
ASF GitHub Bot commented on MJAR-314: ------------------------------------- stokito commented on PR #72: URL: https://github.com/apache/maven-archiver/pull/72#issuecomment-2406007149 Oh I see, so this will be enabled not just for the Maven itself but by default for all projects that use the Maven (including the Maven itself). Then yes, the PR is not needed. The only thing worth to be changed is the default static time. It would be better to use same date as Gradle use 1 Feb 1980. This was already discussed and while the Maven 4 is in beta it's good time to change it. I'll try the Maven 4 later, maybe I don't need to change anything in a project to get reproducible build. > Use a predefined constant for project.build.outputTimestamp > ----------------------------------------------------------- > > Key: MJAR-314 > URL: https://issues.apache.org/jira/browse/MJAR-314 > Project: Maven JAR Plugin > Issue Type: Improvement > Reporter: Sergey Ponomarev > Priority: Major > > The "Configuring for Reproducible Builds" guide shows and example how to > specify a static outputTimestamp: > > <project.build.outputTimestamp>2023-01-01T00:00:00Z</project.build.outputTimestamp> > The date inside is really doesn't matter and I used the property as is but > was afraid of being asked on a review why the 2023 year was used so used the > current year. > But still during a review I was asked: > bq. these changes are likely going to confuse future developers ("This date > shouldn't be static! Lets make it a variable!"). > The Gradle has an option preserveFileTimestamps = false that will just put 1 > Feb 1980 as a date. The 1 Jan 1980 is a minimal date in Zip archive but the 1 > Jan has some special treatment by Java that's why the Gradle team used the 1 > Feb. > See more detailed description in CONSTANT_TIME_FOR_ZIP_ENTRIES > https://github.com/gradle/gradle/blob/master/platforms/core-runtime/files/src/main/java/org/gradle/api/internal/file/archive/ZipEntryConstants.java#L39 > I don't think it worth to declare some new property e.g. > <preserveFileTimestamps>true</preserveFileTimestamps> > But we can simply make a special constant value like: > > <project.build.outputTimestamp>REPRODUCIBLE_BUILD_STATIC_DATE</project.build.outputTimestamp> > Then the constant will be replaced with the same 1 Feb 1980 to be similar > with Gradle produced artifacts. > This constant should make it more clear intention of the outputTimestamp but > also easier to find an explanation for this. > The outputTimestamp parsing is performed in the maven-archiver but the > maven-compiler-plugin and maven-jar-plugin would need to update a JavaDoc for > the outputTimestamp config option -- This message was sent by Atlassian Jira (v8.20.10#820010)