From 4da15f6ca98c427b60d4a975077cdc254c795bbb Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Tue, 9 Jan 2024 14:36:20 +0100 Subject: [PATCH 1/3] set version to 2.20.0-SNAPSHOT --- changes.xml | 6 ++++++ conga-aem-plugin/pom.xml | 4 ++-- parent/pom.xml | 8 ++++---- pom.xml | 4 ++-- tooling/conga-aem-crypto-cli/pom.xml | 6 +++--- tooling/conga-aem-maven-plugin/pom.xml | 6 +++--- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/changes.xml b/changes.xml index a9d3c19..b89991d 100644 --- a/changes.xml +++ b/changes.xml @@ -23,6 +23,12 @@ xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 https://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd"> + + + TBD + + + Update to latest io.wcm.tooling.commons.content-package-builder to fix potential problem with element ordering content packages generated from JSON files. diff --git a/conga-aem-plugin/pom.xml b/conga-aem-plugin/pom.xml index 8b53ce1..c040edc 100644 --- a/conga-aem-plugin/pom.xml +++ b/conga-aem-plugin/pom.xml @@ -25,13 +25,13 @@ io.wcm.devops.conga.plugins io.wcm.devops.conga.plugins.aem.parent - 2.19.11-SNAPSHOT + 2.20.0-SNAPSHOT ../parent/pom.xml io.wcm.devops.conga.plugins io.wcm.devops.conga.plugins.aem - 2.19.11-SNAPSHOT + 2.20.0-SNAPSHOT jar CONGA AEM Plugin diff --git a/parent/pom.xml b/parent/pom.xml index 0151a88..2838049 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -31,7 +31,7 @@ io.wcm.devops.conga.plugins io.wcm.devops.conga.plugins.aem.parent - 2.19.11-SNAPSHOT + 2.20.0-SNAPSHOT pom CONGA AEM Plugin @@ -57,18 +57,18 @@ io.wcm.devops.conga io.wcm.devops.conga.generator - 1.16.4 + 1.16.5-SNAPSHOT io.wcm.devops.conga conga-maven-plugin - 1.16.4 + 1.16.5-SNAPSHOT io.wcm.devops.conga.plugins io.wcm.devops.conga.plugins.sling - 1.3.4 + 1.4.0-SNAPSHOT diff --git a/pom.xml b/pom.xml index e166d2e..12f83fa 100644 --- a/pom.xml +++ b/pom.xml @@ -23,13 +23,13 @@ io.wcm.devops.conga.plugins io.wcm.devops.conga.plugins.aem.parent - 2.19.11-SNAPSHOT + 2.20.0-SNAPSHOT parent/pom.xml io.wcm.devops.conga.plugins io.wcm.devops.conga.plugins.aem.root - 2.19.11-SNAPSHOT + 2.20.0-SNAPSHOT pom CONGA AEM Plugin diff --git a/tooling/conga-aem-crypto-cli/pom.xml b/tooling/conga-aem-crypto-cli/pom.xml index d52d76a..de5a507 100644 --- a/tooling/conga-aem-crypto-cli/pom.xml +++ b/tooling/conga-aem-crypto-cli/pom.xml @@ -25,14 +25,14 @@ io.wcm.devops.conga.plugins io.wcm.devops.conga.plugins.aem.parent - 2.19.11-SNAPSHOT + 2.20.0-SNAPSHOT ../../parent/pom.xml io.wcm.devops.conga.plugins conga-aem-crypto-cli jar - 2.19.11-SNAPSHOT + 2.20.0-SNAPSHOT CONGA AEM Crypto Command Line Interface Command line tool to generate Crypto keys for AEM. @@ -42,7 +42,7 @@ io.wcm.devops.conga.plugins io.wcm.devops.conga.plugins.aem - 2.19.11-SNAPSHOT + 2.20.0-SNAPSHOT compile diff --git a/tooling/conga-aem-maven-plugin/pom.xml b/tooling/conga-aem-maven-plugin/pom.xml index 5d07628..735509b 100644 --- a/tooling/conga-aem-maven-plugin/pom.xml +++ b/tooling/conga-aem-maven-plugin/pom.xml @@ -25,14 +25,14 @@ io.wcm.devops.conga.plugins io.wcm.devops.conga.plugins.aem.parent - 2.19.11-SNAPSHOT + 2.20.0-SNAPSHOT ../../parent/pom.xml io.wcm.devops.conga.plugins conga-aem-maven-plugin maven-plugin - 2.19.11-SNAPSHOT + 2.20.0-SNAPSHOT CONGA AEM Maven Plugin wcm.io DevOps CONGA - CONfiguration GenerAtor Maven Plugin for AEM @@ -62,7 +62,7 @@ io.wcm.devops.conga.plugins io.wcm.devops.conga.plugins.aem - 2.19.11-SNAPSHOT + 2.20.0-SNAPSHOT compile From c4f21b0d57d2e244e150eb65b732464ba46325a3 Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Tue, 9 Jan 2024 15:03:22 +0100 Subject: [PATCH 2/3] ContentPackageOsgiConfigPostProcessor: Write OSGi configurations as .cfg.json files instead of .config files. --- changes.xml | 2 +- ...ContentPackageOsgiConfigPostProcessor.java | 2 +- ...entPackageOsgiConfigPostProcessorTest.java | 31 +++++-------------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/changes.xml b/changes.xml index b89991d..51d393a 100644 --- a/changes.xml +++ b/changes.xml @@ -25,7 +25,7 @@ - TBD + ContentPackageOsgiConfigPostProcessor: Write OSGi configurations as .cfg.json files instead of .config files. diff --git a/conga-aem-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/postprocessor/ContentPackageOsgiConfigPostProcessor.java b/conga-aem-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/postprocessor/ContentPackageOsgiConfigPostProcessor.java index 9086948..4f84efd 100644 --- a/conga-aem-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/postprocessor/ContentPackageOsgiConfigPostProcessor.java +++ b/conga-aem-plugin/src/main/java/io/wcm/devops/conga/plugins/aem/postprocessor/ContentPackageOsgiConfigPostProcessor.java @@ -151,7 +151,7 @@ public Void accept(String path, Dictionary properties) throws IO context.getLogger().info(" Include " + contentPath); // write configuration to temporary file - File tempFile = File.createTempFile(NAME, ".config"); + File tempFile = File.createTempFile(NAME, ".cfg.json"); try (OutputStream os = new FileOutputStream(tempFile)) { OsgiConfigUtil.write(os, properties); } diff --git a/conga-aem-plugin/src/test/java/io/wcm/devops/conga/plugins/aem/postprocessor/ContentPackageOsgiConfigPostProcessorTest.java b/conga-aem-plugin/src/test/java/io/wcm/devops/conga/plugins/aem/postprocessor/ContentPackageOsgiConfigPostProcessorTest.java index f9e4dd4..8c1d578 100644 --- a/conga-aem-plugin/src/test/java/io/wcm/devops/conga/plugins/aem/postprocessor/ContentPackageOsgiConfigPostProcessorTest.java +++ b/conga-aem-plugin/src/test/java/io/wcm/devops/conga/plugins/aem/postprocessor/ContentPackageOsgiConfigPostProcessorTest.java @@ -34,14 +34,14 @@ import java.io.ByteArrayInputStream; import java.io.File; -import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.Dictionary; import java.util.Map; import org.apache.commons.io.FileUtils; -import org.apache.felix.cm.file.ConfigurationHandler; +import org.apache.felix.cm.json.io.Configurations; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.slf4j.LoggerFactory; @@ -103,24 +103,9 @@ void testPostProcess() throws Exception { File zipFile = new File(target, "test.zip"); assertTrue(zipFile.exists()); - try (InputStream is = new ByteArrayInputStream(getDataFromZip(zipFile, "jcr_root/apps/test/config/my.pid.config"))) { - - // check for initial comment line - is.mark(256); - final int firstChar = is.read(); - if (firstChar == '#') { - int b; - while ((b = is.read()) != '\n') { - if (b == -1) { - throw new IOException("Unable to read configuration."); - } - } - } - else { - is.reset(); - } - - Dictionary config = ConfigurationHandler.read(is); + try (InputStream is = new ByteArrayInputStream(getDataFromZip(zipFile, "jcr_root/apps/test/config/my.pid.cfg.json")); + InputStreamReader reader = new InputStreamReader(is, StandardCharsets.UTF_8)) { + Dictionary config = Configurations.buildReader().build(reader).readConfiguration(); assertEquals("value1", config.get("stringProperty")); assertArrayEquals(new String[] { "v1", "v2", "v3" @@ -129,9 +114,9 @@ void testPostProcess() throws Exception { assertEquals(999999999999L, config.get("longProperty")); } - assertTrue(ZipUtil.containsEntry(zipFile, "jcr_root/apps/test/config/my.factory-my.pid.config")); - assertTrue(ZipUtil.containsEntry(zipFile, "jcr_root/apps/test/config.mode1/my.factory-my.pid2.config")); - assertTrue(ZipUtil.containsEntry(zipFile, "jcr_root/apps/test/config.mode2/my.pid2.config")); + assertTrue(ZipUtil.containsEntry(zipFile, "jcr_root/apps/test/config/my.factory-my.pid.cfg.json")); + assertTrue(ZipUtil.containsEntry(zipFile, "jcr_root/apps/test/config.mode1/my.factory-my.pid2.cfg.json")); + assertTrue(ZipUtil.containsEntry(zipFile, "jcr_root/apps/test/config.mode2/my.pid2.cfg.json")); Document filterXml = getXmlFromZip(zipFile, "META-INF/vault/filter.xml"); assertXpathEvaluatesTo("/apps/test/config", "/workspaceFilter/filter[1]/@root", filterXml); From 598324e0a9b9ba463b4e9f658a535f085824cfdb Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Tue, 9 Jan 2024 15:31:54 +0100 Subject: [PATCH 3/3] update dependencies --- changes.xml | 2 +- tooling/conga-aem-maven-plugin/src/it/example/pom.xml | 2 +- .../conga-aem-maven-plugin/src/it/mixed-no-package-type/pom.xml | 2 +- .../src/it/wcmio-archetype-aem65/parent/pom.xml | 2 +- .../src/it/wcmio-archetype-cloud/parent/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/changes.xml b/changes.xml index 51d393a..557baa8 100644 --- a/changes.xml +++ b/changes.xml @@ -24,7 +24,7 @@ - + ContentPackageOsgiConfigPostProcessor: Write OSGi configurations as .cfg.json files instead of .config files. diff --git a/tooling/conga-aem-maven-plugin/src/it/example/pom.xml b/tooling/conga-aem-maven-plugin/src/it/example/pom.xml index cee7d4a..baacdc7 100644 --- a/tooling/conga-aem-maven-plugin/src/it/example/pom.xml +++ b/tooling/conga-aem-maven-plugin/src/it/example/pom.xml @@ -74,7 +74,7 @@ io.wcm.devops.conga conga-maven-plugin - 1.16.4 + 1.16.5-SNAPSHOT true diff --git a/tooling/conga-aem-maven-plugin/src/it/mixed-no-package-type/pom.xml b/tooling/conga-aem-maven-plugin/src/it/mixed-no-package-type/pom.xml index 68f6d95..e93014b 100644 --- a/tooling/conga-aem-maven-plugin/src/it/mixed-no-package-type/pom.xml +++ b/tooling/conga-aem-maven-plugin/src/it/mixed-no-package-type/pom.xml @@ -67,7 +67,7 @@ io.wcm.devops.conga conga-maven-plugin - 1.16.4 + 1.16.5-SNAPSHOT true diff --git a/tooling/conga-aem-maven-plugin/src/it/wcmio-archetype-aem65/parent/pom.xml b/tooling/conga-aem-maven-plugin/src/it/wcmio-archetype-aem65/parent/pom.xml index 03e411c..9ecdefd 100644 --- a/tooling/conga-aem-maven-plugin/src/it/wcmio-archetype-aem65/parent/pom.xml +++ b/tooling/conga-aem-maven-plugin/src/it/wcmio-archetype-aem65/parent/pom.xml @@ -5,7 +5,7 @@ io.wcm.maven io.wcm.maven.aem-global-parent - 2.1.12 + 2.1.15-SNAPSHOT diff --git a/tooling/conga-aem-maven-plugin/src/it/wcmio-archetype-cloud/parent/pom.xml b/tooling/conga-aem-maven-plugin/src/it/wcmio-archetype-cloud/parent/pom.xml index ec443de..0d4f18d 100644 --- a/tooling/conga-aem-maven-plugin/src/it/wcmio-archetype-cloud/parent/pom.xml +++ b/tooling/conga-aem-maven-plugin/src/it/wcmio-archetype-cloud/parent/pom.xml @@ -5,7 +5,7 @@ io.wcm.maven io.wcm.maven.aem-global-parent - 2.1.12 + 2.1.15-SNAPSHOT