aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/metadata/metadata-model
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2019-08-30 19:16:07 +0200
committerMartin Stockhammer <martin_s@apache.org>2019-08-30 19:17:31 +0200
commit51171b98a28979bde71377122806e2930bf40cf9 (patch)
treef57bd2119b8aaeb6751dbc068bf6126d28a0559d /archiva-modules/metadata/metadata-model
parent9ea6ed448b13d15ce23abf767517efad2ee3f244 (diff)
downloadarchiva-51171b98a28979bde71377122806e2930bf40cf9.tar.gz
archiva-51171b98a28979bde71377122806e2930bf40cf9.zip
Reducing time resolution for meta artifacts
Diffstat (limited to 'archiva-modules/metadata/metadata-model')
-rw-r--r--archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ArtifactMetadata.java5
1 files changed, 4 insertions, 1 deletions
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) {