From 9ea9a9f24e0cb5a33967387d8c9c369a234a71ca Mon Sep 17 00:00:00 2001 From: Roberto Cortez Date: Tue, 19 Nov 2024 12:30:31 +0000 Subject: [PATCH] Remove customizer mappings from runtime recording Config (cherry picked from commit ada7e07ff98abf80371b5f58ebf4bd8e482816a6) --- .../configuration/BuildTimeConfigurationReader.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java b/core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java index d5e5bf8e364c9..b160e70246a94 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java @@ -84,6 +84,7 @@ import io.smallrye.config.SecretKeys; import io.smallrye.config.SmallRyeConfig; import io.smallrye.config.SmallRyeConfigBuilder; +import io.smallrye.config.SmallRyeConfigBuilderCustomizer; import io.smallrye.config.SysPropConfigSource; import io.smallrye.config.common.AbstractConfigSource; @@ -1112,6 +1113,17 @@ private SmallRyeConfig getConfigForRuntimeRecording() { builder.getProfiles().add(""); builder.getSources().clear(); builder.getSourceProviders().clear(); + builder.withCustomizers(new SmallRyeConfigBuilderCustomizer() { + @Override + public void configBuilder(final SmallRyeConfigBuilder builder) { + builder.getMappingsBuilder().getMappings().clear(); + } + + @Override + public int priority() { + return Integer.MAX_VALUE; + } + }); builder.setAddDefaultSources(false) // Customizers may duplicate sources, but not much we can do about it, we need to run them .addDiscoveredCustomizers()