From d6123f2eaa792799832adb62f6a95a4c84ef0ed9 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Tue, 20 Aug 2024 15:34:44 +0200 Subject: [PATCH] Condition the new config doc sections of the extension template When creating projects or extensions, the codestarts from the tooling version are always used even for older versions so we need to be careful about it. Fixes #42649 --- .../code/quarkiverse/java/docs/pom.tpl.qute.xml | 9 +++++++++ .../code/quarkiverse/java/pom.tpl.qute.xml | 2 ++ .../java/io/quarkus/maven/it/CreateExtensionMojoIT.java | 4 ++-- .../quarkus-my-quarkiverse-ext_pom.xml | 2 +- .../my-org-my-own-ext_pom.xml | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-extension/code/quarkiverse/java/docs/pom.tpl.qute.xml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-extension/code/quarkiverse/java/docs/pom.tpl.qute.xml index 899dc06c2cef3..c3b00e95e2285 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-extension/code/quarkiverse/java/docs/pom.tpl.qute.xml +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-extension/code/quarkiverse/java/docs/pom.tpl.qute.xml @@ -55,6 +55,7 @@ + {#if quarkus.version.or(quarkus.bom.version).compareVersionTo("3.14") >= 0} io.quarkus quarkus-config-doc-maven-plugin @@ -63,6 +64,7 @@ $\{project.basedir}/modules/ROOT/pages/includes/ + {/if} maven-resources-plugin @@ -75,6 +77,13 @@ $\{project.basedir}/modules/ROOT/pages/includes/ + {#if quarkus.version.or(quarkus.bom.version).compareVersionTo("3.14") < 0} + + $\{project.basedir}/../target/asciidoc/generated/config/ + {namespace.id}{extension.id}.adoc + false + + {/if} $\{project.basedir}/templates/includes attributes.adoc diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-extension/code/quarkiverse/java/pom.tpl.qute.xml b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-extension/code/quarkiverse/java/pom.tpl.qute.xml index aa0fec9fcfd2e..7c22949f418c1 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-extension/code/quarkiverse/java/pom.tpl.qute.xml +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus-extension/code/quarkiverse/java/pom.tpl.qute.xml @@ -8,6 +8,7 @@ scm:git:git@github.com:quarkiverse/quarkus-{extension.id}.git https://github.com/quarkiverse/quarkus-{extension.id} + {#if quarkus.version.or(quarkus.bom.version).compareVersionTo("3.14") >= 0} @@ -19,6 +20,7 @@ + {/if} it diff --git a/integration-tests/maven/src/test/java/io/quarkus/maven/it/CreateExtensionMojoIT.java b/integration-tests/maven/src/test/java/io/quarkus/maven/it/CreateExtensionMojoIT.java index 90a6ffe4daaaa..de7207f63ad26 100644 --- a/integration-tests/maven/src/test/java/io/quarkus/maven/it/CreateExtensionMojoIT.java +++ b/integration-tests/maven/src/test/java/io/quarkus/maven/it/CreateExtensionMojoIT.java @@ -93,7 +93,7 @@ public void testCreateQuarkiverseExtension(TestInfo testInfo) throws Throwable { Properties properties = new Properties(); properties.put("groupId", "io.quarkiverse.my-quarkiverse-ext"); properties.put("extensionId", "my-quarkiverse-ext"); - properties.put("quarkusVersion", "2.10.5.Final"); + properties.put("quarkusVersion", "3.14.0"); properties.put("extensionName", "My Quarkiverse extension"); properties.put("extensionDescription", "My Quarkiverse extension description"); properties.put("withCodestart", "true"); @@ -136,7 +136,7 @@ public void testCreateStandaloneExtension(TestInfo testInfo) throws Throwable { properties.put("groupId", "io.standalone"); properties.put("extensionId", "my-own-ext"); properties.put("namespaceId", "my-org-"); - properties.put("quarkusVersion", "2.10.5.Final"); + properties.put("quarkusVersion", "3.14.0"); InvocationResult result = setup(properties); assertThat(result.getExitCode()).isZero(); diff --git a/integration-tests/maven/src/test/resources/__snapshots__/CreateExtensionMojoIT/testCreateQuarkiverseExtension/quarkus-my-quarkiverse-ext_pom.xml b/integration-tests/maven/src/test/resources/__snapshots__/CreateExtensionMojoIT/testCreateQuarkiverseExtension/quarkus-my-quarkiverse-ext_pom.xml index fdac7d33c64c6..de822119963a5 100644 --- a/integration-tests/maven/src/test/resources/__snapshots__/CreateExtensionMojoIT/testCreateQuarkiverseExtension/quarkus-my-quarkiverse-ext_pom.xml +++ b/integration-tests/maven/src/test/resources/__snapshots__/CreateExtensionMojoIT/testCreateQuarkiverseExtension/quarkus-my-quarkiverse-ext_pom.xml @@ -30,7 +30,7 @@ 17 UTF-8 UTF-8 - 2.10.5.Final + 3.14.0 diff --git a/integration-tests/maven/src/test/resources/__snapshots__/CreateExtensionMojoIT/testCreateStandaloneExtension/my-org-my-own-ext_pom.xml b/integration-tests/maven/src/test/resources/__snapshots__/CreateExtensionMojoIT/testCreateStandaloneExtension/my-org-my-own-ext_pom.xml index 706cf653c8c3b..d8099aa75a4b5 100644 --- a/integration-tests/maven/src/test/resources/__snapshots__/CreateExtensionMojoIT/testCreateStandaloneExtension/my-org-my-own-ext_pom.xml +++ b/integration-tests/maven/src/test/resources/__snapshots__/CreateExtensionMojoIT/testCreateStandaloneExtension/my-org-my-own-ext_pom.xml @@ -18,7 +18,7 @@ 17 UTF-8 UTF-8 - 2.10.5.Final + 3.14.0 3.3.1