Skip to content

Commit c9d52d5

Browse files
committed
conga-aem-maven-plugin: Ensure last modification dates for content package ZIP file entries are kept the same when rebuilding the "all" package.
1 parent e57dc46 commit c9d52d5

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

changes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
<action type="update" dev="sseifert">
2828
conga-aem-maven-plugin: Check bundle status before package manager install status as the latter may report errors if certain bundles are restarted.
2929
</action>
30+
<action type="fix" dev="sseifert">
31+
conga-aem-maven-plugin: Ensure last modification dates for content package ZIP file entries are kept the same when rebuilding the "all" package.
32+
</action>
3033
</release>
3134

3235
<release version="2.18.2" date="2022-06-20">

tooling/conga-aem-maven-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/maven/allpackage/AllPackageBuilder.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ private List<TemporaryContentPackageFile> processContentPackage(ContentPackageFi
557557
props.put(NAME_PACKAGE_TYPE, packageType);
558558
}
559559

560-
ZipEntry zipOutEntry = new ZipEntry(zipInEntry.getName());
560+
ZipEntry zipOutEntry = newZipEntry(zipInEntry);
561561
zipOut.putNextEntry(zipOutEntry);
562562
props.storeToXML(zipOut, null);
563563
processedEntry = true;
@@ -589,7 +589,7 @@ else if (StringUtils.equals(FilenameUtils.getExtension(zipInEntry.getName()), "z
589589

590590
// otherwise transfer the binary data 1:1
591591
if (!processedEntry) {
592-
ZipEntry zipOutEntry = new ZipEntry(zipInEntry.getName());
592+
ZipEntry zipOutEntry = newZipEntry(zipInEntry);
593593
zipOut.putNextEntry(zipOutEntry);
594594
IOUtils.copy(is, zipOut);
595595
}
@@ -615,6 +615,17 @@ else if (StringUtils.equals(FilenameUtils.getExtension(zipInEntry.getName()), "z
615615
return result;
616616
}
617617

618+
private static ZipEntry newZipEntry(ZipEntry in) {
619+
ZipEntry out = new ZipEntry(in.getName());
620+
if (in.getCreationTime() != null) {
621+
out.setCreationTime(in.getCreationTime());
622+
}
623+
if (in.getLastModifiedTime() != null) {
624+
out.setLastModifiedTime(in.getLastModifiedTime());
625+
}
626+
return out;
627+
}
628+
618629
/**
619630
* Add dependency information to dependencies string in properties (if it does not exist already).
620631
* @param props Properties

0 commit comments

Comments
 (0)