diff --git a/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java b/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java index c4b22bf1..c11978e5 100644 --- a/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java +++ b/src/main/java/org/apache/maven/plugins/shade/DefaultShader.java @@ -34,6 +34,7 @@ import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; +import java.util.Calendar; import java.util.Collection; import java.util.Collections; import java.util.Enumeration; @@ -43,7 +44,6 @@ import java.util.List; import java.util.Objects; import java.util.Set; -import java.util.TimeZone; import java.util.concurrent.Callable; import java.util.jar.JarEntry; import java.util.jar.JarFile; @@ -102,7 +102,9 @@ private long getTime(ZipEntry entry) { for (ZipExtraField field : fields) { if (X5455_ExtendedTimestamp.HEADER_ID.equals(field.getHeaderId())) { // extended timestamp extra field: need to translate UTC to local time for Reproducible Builds - return entry.getTime() - TimeZone.getDefault().getRawOffset(); + Calendar cal = Calendar.getInstance(); + cal.setTimeInMillis(entry.getTime()); + return entry.getTime() - (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)); } } } catch (ZipException ze) {