From 0719a47df6c6c98efb77769f1e06fbc8fb7f7ca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Sol=C3=B3rzano?= Date: Fri, 1 Dec 2023 12:49:20 +0100 Subject: [PATCH 1/4] Update Apache Maven to 3.9.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jorge Solórzano (cherry picked from commit 51ac094d2cb67670c95d76b395816d2f57ef0272) --- build-parent/pom.xml | 2 +- independent-projects/bootstrap/pom.xml | 8 ++++---- independent-projects/enforcer-rules/pom.xml | 2 +- independent-projects/extension-maven-plugin/pom.xml | 4 ++-- independent-projects/resteasy-reactive/pom.xml | 2 +- .../devtools-testing/src/main/resources/fake-catalog.json | 2 +- independent-projects/tools/pom.xml | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build-parent/pom.xml b/build-parent/pom.xml index 1866362b5538f..14eeb01c05c7a 100644 --- a/build-parent/pom.xml +++ b/build-parent/pom.xml @@ -62,7 +62,7 @@ [3.8.2,) - 3.9.5 + 3.9.6 3.2.0 8.5 ${project.version} diff --git a/independent-projects/bootstrap/pom.xml b/independent-projects/bootstrap/pom.xml index d966792760d95..42aa44afb02e2 100644 --- a/independent-projects/bootstrap/pom.xml +++ b/independent-projects/bootstrap/pom.xml @@ -47,10 +47,10 @@ 0.9.5 3.5.3.Final 5.10.0 - 3.9.5 - 0.3.5 - 3.7.1 - 1.9.13 + 3.9.6 + 0.9.0.M2 + 3.10.2 + 1.9.18 3.3.4 3.5.3 4.4.16 diff --git a/independent-projects/enforcer-rules/pom.xml b/independent-projects/enforcer-rules/pom.xml index 3be3e3b40c112..b257ed3a2aebf 100644 --- a/independent-projects/enforcer-rules/pom.xml +++ b/independent-projects/enforcer-rules/pom.xml @@ -40,7 +40,7 @@ 3.0.0-M3 3.6.0 - 3.9.5 + 3.9.6 - 3.9.5 + 3.9.6 3.2.0 8.5 From 0469ec8c84ae8356f4dd8a3c5ed31f67d75f1e0a Mon Sep 17 00:00:00 2001 From: Roberto Cortez Date: Wed, 29 Nov 2023 18:07:59 +0000 Subject: [PATCH 2/4] Print correct profiles in native image (cherry picked from commit 0a6c90239b218a47e5f3e802b3824ad630f92a6a) --- .../java/io/quarkus/deployment/steps/MainClassBuildStep.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java index de47b02e92602..d181e33c5a1f7 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/steps/MainClassBuildStep.java @@ -268,8 +268,6 @@ void build(List staticInitTasks, startupContext, mv.getMethodParam(0)); mv.invokeStaticMethod(CONFIGURE_STEP_TIME_ENABLED); - ResultHandle profiles = mv - .invokeStaticMethod(ofMethod(ConfigUtils.class, "getProfiles", List.class)); tryBlock = mv.tryBlock(); tryBlock.invokeStaticMethod(CONFIGURE_STEP_TIME_START); @@ -298,7 +296,7 @@ void build(List staticInitTasks, tryBlock.load(applicationInfo.getVersion()), tryBlock.load(Version.getVersion()), featuresHandle, - profiles, + tryBlock.invokeStaticMethod(ofMethod(ConfigUtils.class, "getProfiles", List.class)), tryBlock.load(LaunchMode.DEVELOPMENT.equals(launchMode.getLaunchMode())), tryBlock.load(launchMode.isAuxiliaryApplication())); From 58db82b31f50b9123b8c4e2c7f363cbc94c4ebd0 Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Fri, 1 Dec 2023 15:03:51 +0100 Subject: [PATCH 3/4] Config: detect injected config value mismatch for missing values - resolves #37444 - follow-up of https://github.com/quarkusio/quarkus/pull/36281 (cherry picked from commit bd98d02bd6f3bfb81023f95842d3f9e73cc8df73) --- ...onfigInjectionMissingValueFailureTest.java | 58 +++++++++++++++++++ .../ConfigStaticInitCheckInterceptor.java | 3 +- .../arc/runtime/ConfigStaticInitValues.java | 5 +- 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 extensions/arc/deployment/src/test/java/io/quarkus/arc/test/config/staticinit/StaticInitConfigInjectionMissingValueFailureTest.java diff --git a/extensions/arc/deployment/src/test/java/io/quarkus/arc/test/config/staticinit/StaticInitConfigInjectionMissingValueFailureTest.java b/extensions/arc/deployment/src/test/java/io/quarkus/arc/test/config/staticinit/StaticInitConfigInjectionMissingValueFailureTest.java new file mode 100644 index 0000000000000..76ee3650b6ee7 --- /dev/null +++ b/extensions/arc/deployment/src/test/java/io/quarkus/arc/test/config/staticinit/StaticInitConfigInjectionMissingValueFailureTest.java @@ -0,0 +1,58 @@ +package io.quarkus.arc.test.config.staticinit; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.fail; + +import java.util.Optional; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.context.Initialized; +import jakarta.enterprise.event.Observes; +import jakarta.inject.Singleton; + +import org.eclipse.microprofile.config.inject.ConfigProperty; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.quarkus.test.QuarkusUnitTest; + +public class StaticInitConfigInjectionMissingValueFailureTest { + + static final String PROPERTY_NAME = "static.init.missing.apfelstrudel"; + + @RegisterExtension + static final QuarkusUnitTest config = new QuarkusUnitTest() + .withApplicationRoot(root -> root + .addClasses(StaticInitBean.class)) + .assertException(t -> { + assertThat(t).isInstanceOf(IllegalStateException.class) + .hasMessageContainingAll( + "A runtime config property value differs from the value that was injected during the static intialization phase", + "the runtime value of '" + PROPERTY_NAME + + "' is [gizmo] but the value [null] was injected into io.quarkus.arc.test.config.staticinit.StaticInitConfigInjectionMissingValueFailureTest$StaticInitBean#value"); + }); + + @Test + public void test() { + fail(); + } + + @Singleton + public static class StaticInitBean { + + @ConfigProperty(name = PROPERTY_NAME) + Optional value; + + // bean is instantiated during STATIC_INIT + void onInit(@Observes @Initialized(ApplicationScoped.class) Object event) { + System.setProperty(PROPERTY_NAME, "gizmo"); + } + + } + + @AfterAll + static void afterAll() { + System.clearProperty(PROPERTY_NAME); + } +} diff --git a/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/ConfigStaticInitCheckInterceptor.java b/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/ConfigStaticInitCheckInterceptor.java index e02621937e7b8..dc06f683503a5 100644 --- a/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/ConfigStaticInitCheckInterceptor.java +++ b/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/ConfigStaticInitCheckInterceptor.java @@ -69,8 +69,7 @@ static void recordConfigValue(InjectionPoint injectionPoint, ConfigStaticInitVal value = getDefaultValue(injectionPoint, configProperty); } if (value == null) { - LOG.debugf("No config value found for %s", propertyName); - return; + LOG.debugf("No config value found for %s - recording value", propertyName); } if (configValues == null) { configValues = Arc.container().instance(ConfigStaticInitValues.class).get(); diff --git a/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/ConfigStaticInitValues.java b/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/ConfigStaticInitValues.java index f464416e7603f..821f458c0a265 100644 --- a/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/ConfigStaticInitValues.java +++ b/extensions/arc/runtime/src/main/java/io/quarkus/arc/runtime/ConfigStaticInitValues.java @@ -3,6 +3,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Objects; import jakarta.annotation.Priority; import jakarta.enterprise.event.Observes; @@ -43,7 +44,9 @@ void onStart(@Observes @Priority(Integer.MIN_VALUE) StartupEvent event) { List mismatches = new ArrayList<>(); for (InjectedValue injectedValue : injectedValues) { ConfigValue currentValue = config.getConfigValue(injectedValue.name); - if (currentValue.getValue() != null && !injectedValue.value.equals(currentValue.getValue())) { + if (currentValue.getValue() != null + && !Objects.equals(currentValue.getValue(), injectedValue.value)) { + // Config property is set at runtime and the value differs from the value injected during STATIC_INIT bootstrap phase mismatches.add( " - the runtime value of '" + injectedValue.name + "' is [" + currentValue.getValue() + "] but the value [" + injectedValue.value From d89dde3c5c365ab858c76cb5ecb0b2500591ff85 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Mon, 4 Dec 2023 13:19:56 +0100 Subject: [PATCH 4/4] Revert "Unlist quarkus-resteasy-qute and quarkus-resteasy-reactive-qute" This reverts commit 5e8e7e6db2b9707b33a401a450acc0fa75712b3f. This has been done too fast: - we haven't documented it at all - there are still references to these extensions in our documentation (https://quarkus.io/guides/qute-reference#resteasy_integration) and people can't find the extensions anymore (see https://github.com/quarkusio/quarkus/issues/37478) We need to finalize the documentation before actually unlisting these extensions. I would advise to target 3.7 for that. (cherry picked from commit 1db3889cd476ae1ed4c89cc0fc236dca8e143e0e) --- .../runtime/src/main/resources/META-INF/quarkus-extension.yaml | 1 - .../runtime/src/main/resources/META-INF/quarkus-extension.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/extensions/resteasy-classic/resteasy-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-classic/resteasy-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml index 0da36a3fd354e..d0391e67d3f8b 100644 --- a/extensions/resteasy-classic/resteasy-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/resteasy-classic/resteasy-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -2,7 +2,6 @@ artifact: ${project.groupId}:${project.artifactId}:${project.version} name: "RESTEasy Classic Qute" metadata: - unlisted: true keywords: - "templating" - "templates" diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml index eec8b27d0eb38..9f0006b6bf2fa 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-qute/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -1,7 +1,6 @@ name: "RESTEasy Reactive Qute" artifact: ${project.groupId}:${project.artifactId}:${project.version} metadata: - unlisted: true keywords: - "templating" - "templates"