Skip to content

Commit 444dcd8

Browse files
committed
ignore duplicate entries
1 parent e3f3a27 commit 444dcd8

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

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

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ public boolean build(Map<String, String> properties) throws IOException {
297297

298298
// build content package
299299
// if auto dependencies is active: build separate "dependency chains" between mutable and immutable packages
300+
Set<String> packageFilePaths = new HashSet<>();
300301
try (ContentPackage contentPackage = builder.build(targetFile)) {
301302
for (ContentPackageFileSet fileSet : contentPackageFileSets) {
302303
for (String environmentRunMode : fileSet.getEnvironmentRunModes()) {
@@ -322,9 +323,16 @@ public boolean build(Map<String, String> properties) throws IOException {
322323
try {
323324
for (TemporaryContentPackageFile processedFile : processedFiles) {
324325
String path = buildPackagePath(processedFile, rootPath, environmentRunMode);
325-
contentPackage.addFile(path, processedFile.getFile());
326-
if (log.isDebugEnabled()) {
327-
log.debug(" Add " + processedFile.getPackageInfoWithDependencies());
326+
if (packageFilePaths.add(path)) {
327+
contentPackage.addFile(path, processedFile.getFile());
328+
if (log.isDebugEnabled()) {
329+
log.debug(" Add " + processedFile.getPackageInfoWithDependencies());
330+
}
331+
}
332+
else {
333+
if (log.isDebugEnabled()) {
334+
log.debug(" Ignore duplicate: " + processedFile.getPackageInfoWithDependencies());
335+
}
328336
}
329337
}
330338
}

0 commit comments

Comments
 (0)