[MNG-8258] Change the fixed reproducible build outputTimestamp to 1 Feb 1980 (#1813)

The Maven used the year 2001 (beginning of 21st century).
But the Gradle already use the 1 Feb 1980 for preserveFileTimestamps.

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

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
This commit is contained in:
Sergey Ponomarev 2024-10-17 18:05:39 +03:00 committed by GitHub
parent 107f81da51
commit 989f798c9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 9 additions and 5 deletions

View File

@ -26,7 +26,8 @@ under the License.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.outputTimestamp>2001-01-01T00:00:00Z</project.build.outputTimestamp>
<!-- Fixed date for reproducible build -->
<project.build.outputTimestamp>1980-02-01T00:00:00Z</project.build.outputTimestamp>
</properties>
<build>

View File

@ -26,7 +26,8 @@ under the License.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.outputTimestamp>2001-01-01T00:00:00Z</project.build.outputTimestamp>
<!-- Fixed date for reproducible build -->
<project.build.outputTimestamp>1980-02-01T00:00:00Z</project.build.outputTimestamp>
</properties>
<build>

View File

@ -1355,7 +1355,7 @@ class PomConstructionTest {
assertEquals("project-property", pom.getValue("properties[1]/itProperty"));
assertEquals("UTF-8", pom.getValue("properties[1]/project.build.sourceEncoding"));
assertEquals("UTF-8", pom.getValue("properties[1]/project.reporting.outputEncoding"));
assertEquals("2001-01-01T00:00:00Z", pom.getValue("properties[1]/project.build.outputTimestamp"));
assertEquals("1980-02-01T00:00:00Z", pom.getValue("properties[1]/project.build.outputTimestamp"));
assertEquals(1, ((List<?>) pom.getValue("dependencyManagement/dependencies")).size());
assertEquals("org.apache.maven.its", pom.getValue("dependencyManagement/dependencies[1]/groupId"));

View File

@ -26,7 +26,8 @@ under the License.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.outputTimestamp>2001-01-01T00:00:00Z</project.build.outputTimestamp>
<!-- Fixed date for reproducible build -->
<project.build.outputTimestamp>1980-02-01T00:00:00Z</project.build.outputTimestamp>
</properties>
<build>

View File

@ -26,7 +26,8 @@ under the License.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.outputTimestamp>2001-01-01T00:00:00Z</project.build.outputTimestamp>
<!-- Fixed date for reproducible build -->
<project.build.outputTimestamp>1980-02-01T00:00:00Z</project.build.outputTimestamp>
</properties>
<build>