[ 
https://issues.apache.org/jira/browse/MSHARED-1430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17887798#comment-17887798
 ] 

Sergey Ponomarev commented on MSHARED-1430:
-------------------------------------------

So the Maven itself uses 2001-01-01 as the default value. This not affects 
anyone and can be changed to easily to any date at any time.

> (no reason to try to mimic others: there is no perfect or wrong choice)

Sure, but a standardization always improves and simplifies things (if done 
right). Having the same value 1 Feb 1980 will simplify search "Why my jar has 
the weird date?  You have the reproducible build. Ah, ok, ty".  But also I 
switch from Gradle to Maven then if would be less differences in artifacts.

But more importantly instead of a raw date we now can use the constant 
REPRODUCIBLE_BUILD_STATIC_DATE that makes intention clear.

> Use a predefined constant for project.build.outputTimestamp
> -----------------------------------------------------------
>
>                 Key: MSHARED-1430
>                 URL: https://issues.apache.org/jira/browse/MSHARED-1430
>             Project: Maven Shared Components
>          Issue Type: Improvement
>          Components: maven-archiver
>            Reporter: Sergey Ponomarev
>            Priority: Minor
>
> 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)

Reply via email to