From 6a1ce77eb4a32d90038db776f48575c66f8cc529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Sol=C3=B3rzano?= Date: Tue, 28 Jun 2022 10:57:20 +0200 Subject: [PATCH] [MSOURCES-132] - Update Maven Archiver to 3.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jorge Solórzano --- pom.xml | 7 ++++++- src/it/reproducible/verify.groovy | 12 +++++++++++- .../maven/plugins/source/AbstractSourceJarMojo.java | 4 +--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 654d1d3..82d87fa 100644 --- a/pom.xml +++ b/pom.xml @@ -120,13 +120,18 @@ under the License. org.apache.maven maven-archiver - 3.5.0 + 3.6.0 org.codehaus.plexus plexus-utils 3.4.2 + + commons-io + commons-io + 2.11.0 + org.apache.maven.plugin-testing diff --git a/src/it/reproducible/verify.groovy b/src/it/reproducible/verify.groovy index 54ebe23..19b8af7 100644 --- a/src/it/reproducible/verify.groovy +++ b/src/it/reproducible/verify.groovy @@ -18,6 +18,8 @@ * under the License. */ +import java.nio.file.attribute.FileTime; +import java.time.Instant; import org.apache.commons.compress.archivers.zip.*; File deployDir = new File( basedir, 'target/repo/org/apache/maven/its/reproducible/1.0' ) @@ -63,13 +65,21 @@ long javaToDosTime( Date d ) d.getSeconds() >> 1; } +// Normalize to UTC +long millis = Instant.parse( "2019-08-21T18:28:52Z" ).toEpochMilli(); +Calendar cal = Calendar.getInstance(); +cal.setTimeInMillis( millis ); +millis = millis - ( cal.get( Calendar.ZONE_OFFSET ) + cal.get( Calendar.DST_OFFSET ) ); +FileTime timestamp = FileTime.fromMillis( millis ); + for ( ZipArchiveEntry zae : zipFile.getEntries() ) { r.append( sprintf( "%d %4d (%3d) %8x %d %