From 51171b98a28979bde71377122806e2930bf40cf9 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Fri, 30 Aug 2019 19:16:07 +0200 Subject: [PATCH] Reducing time resolution for meta artifacts --- .../org/apache/archiva/metadata/model/ArtifactMetadata.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 2.39.5