jira-importer opened a new issue, #186:
URL: https://github.com/apache/maven-jar-plugin/issues/186

   **[Sergey 
Ponomarev](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=stokito)**
 opened 
**[MJAR-314](https://issues.apache.org/jira/browse/MJAR-314?redirect=false)** 
and commented
   
   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:
   
   > 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
   
   
   ---
   
   **Issue Links:**
   - [MSHARED-1430](https://issues.apache.org/jira/browse/MSHARED-1430) Use a 
predefined constant for project.build.outputTimestamp
    (_**"Dependency"**_)
   
   **Remote Links:**
   - [GitHub Pull Request #72
   ](https://github.com/apache/maven-archiver/pull/72)
   - [GitHub Pull Request #102
   ](https://github.com/apache/maven-jar-plugin/pull/102)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to