From: Martin Stockhammer Date: Fri, 30 Aug 2019 17:16:07 +0000 (+0200) Subject: Reducing time resolution for meta artifacts X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=51171b98a28979bde71377122806e2930bf40cf9;p=archiva.git Reducing time resolution for meta artifacts --- diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java index 3ee8ea894..e2fdea2e6 100644 --- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java +++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java @@ -25,6 +25,8 @@ import org.apache.commons.collections4.bidimap.DualHashBidiMap; import javax.xml.bind.annotation.XmlRootElement; import java.time.Instant; import java.time.ZonedDateTime; +import java.time.temporal.ChronoUnit; +import java.time.temporal.TemporalUnit; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; @@ -141,7 +143,8 @@ public class ArtifactMetadata } public void setWhenGathered(ZonedDateTime whenGathered) { - this.whenGathered = whenGathered.withZoneSameInstant(ModelInfo.STORAGE_TZ); + // We set the resolution to milliseconds, because it's the resolution that all current backends support + this.whenGathered = whenGathered.withZoneSameInstant(ModelInfo.STORAGE_TZ).truncatedTo(ChronoUnit.MILLIS); } public void setMd5(String md5) {