You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2025/09/24 11:38:32 UTC

(maven-archiver) branch timestamp-1970 created (now 3b0176d)

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a change to branch timestamp-1970
in repository https://gitbox.apache.org/repos/asf/maven-archiver.git


      at 3b0176d  test non-MS DOS timestamp

This branch includes the following new commits:

     new 3b0176d  test non-MS DOS timestamp

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(maven-archiver) 01/01: test non-MS DOS timestamp

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch timestamp-1970
in repository https://gitbox.apache.org/repos/asf/maven-archiver.git

commit 3b0176d1af91005c0304bc51754a2cdcd1658ba8
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Wed Sep 24 13:38:24 2025 +0200

    test non-MS DOS timestamp
---
 .../org/apache/maven/archiver/MavenArchiverTest.java | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/test/java/org/apache/maven/archiver/MavenArchiverTest.java b/src/test/java/org/apache/maven/archiver/MavenArchiverTest.java
index 4f0e8ea..7a3a871 100644
--- a/src/test/java/org/apache/maven/archiver/MavenArchiverTest.java
+++ b/src/test/java/org/apache/maven/archiver/MavenArchiverTest.java
@@ -1436,4 +1436,24 @@ class MavenArchiverTest {
     void testShortOffset(String value, long expected) {
         assertThat(parseBuildOutputTimestamp(value)).contains(Instant.ofEpochSecond(expected));
     }
+
+    private void testJar(String name, String timestamp) throws Exception {
+        File jarFile = new File("target/test/dummy-" + name + ".jar");
+        JarArchiver jarArchiver = getCleanJarArchiver(jarFile);
+
+        MavenArchiver archiver = getMavenArchiver(jarArchiver);
+        archiver.configureReproducibleBuild(timestamp);
+
+        MavenSession session = getDummySession();
+        MavenProject project = getDummyProject();
+
+        archiver.createArchive(session, project, new MavenArchiveConfiguration());
+        assertThat(jarFile).exists();
+    }
+
+    @Test
+    void testJar() throws Exception {
+        testJar("1970", "10");
+        testJar("2000", "2000-01-01T00:00:00Z");
+    }
 }