--- apache-ivy-2.5.2/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java 2023-09-19 08:19:56.006332869 +0200 +++ apache-ivy-2.5.2/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java 2023-09-19 08:20:15.856475360 +0200 @@ -1472,7 +1472,7 @@ } private Artifact getDefaultMetadataArtifact(ModuleRevisionId mrid) { - return new DefaultArtifact(mrid, new Date(), "metadata", "metadata", "ivy", true); + return new DefaultArtifact(mrid, System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date(), "metadata", "metadata", "ivy", true); } // not used any more, but may be useful for finer grained locking when downloading artifacts --- apache-ivy-2.5.2/src/java/org/apache/ivy/core/module/descriptor/DefaultArtifact.java 2023-09-19 08:19:56.009666226 +0200 +++ apache-ivy-2.5.2/src/java/org/apache/ivy/core/module/descriptor/DefaultArtifact.java 2023-09-19 08:20:27.823227936 +0200 @@ -100,7 +100,7 @@ throw new NullPointerException("null arid not allowed"); } if (publicationDate == null) { - publicationDate = new Date(); + publicationDate = System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date(); } this.publicationDate = publicationDate; this.arid = arid; --- apache-ivy-2.5.2/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java 2023-09-19 08:19:56.009666226 +0200 +++ apache-ivy-2.5.2/src/java/org/apache/ivy/core/module/descriptor/DefaultModuleDescriptor.java 2023-09-19 08:21:12.330214087 +0200 @@ -272,7 +272,7 @@ this.resolvedRevId = id; this.status = status; this.publicationDate = pubDate; - this.resolvedPublicationDate = publicationDate == null ? new Date() : publicationDate; + this.resolvedPublicationDate = publicationDate == null ? (System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date()) : publicationDate; this.isDefault = isDefault; this.parser = XmlModuleDescriptorParser.getInstance(); } @@ -308,7 +308,7 @@ public void setPublicationDate(Date publicationDate) { this.publicationDate = publicationDate; if (resolvedPublicationDate == null) { - resolvedPublicationDate = publicationDate == null ? new Date() : publicationDate; + resolvedPublicationDate = publicationDate == null ? (System.getenv("SOURCE_DATE_EPOCH") != null ? new Date(1000 * Long.parseLong(System.getenv("SOURCE_DATE_EPOCH"))) : new Date()) : publicationDate; } }