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 774ee4784759f..c0e5181dfa2fc 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 @@ -638,22 +638,22 @@ ReadResult run() { unknownBuildProperties.remove(property); ConfigValue value = config.getConfigValue(property); if (value.getRawValue() != null) { - allBuildTimeValues.put(value.getNameProfiled(), value); + allBuildTimeValues.put(value.getNameProfiled(), value.noProblems().withValue(value.getRawValue())); } } if (buildTimeRunTimeNames.contains(name)) { unknownBuildProperties.remove(property); ConfigValue value = config.getConfigValue(property); if (value.getRawValue() != null) { - allBuildTimeValues.put(value.getNameProfiled(), value); - buildTimeRunTimeValues.put(value.getNameProfiled(), value); + allBuildTimeValues.put(value.getNameProfiled(), value.noProblems().withValue(value.getRawValue())); + buildTimeRunTimeValues.put(value.getNameProfiled(), value.noProblems().withValue(value.getRawValue())); } } if (runTimeNames.contains(name)) { unknownBuildProperties.remove(property); ConfigValue value = runtimeConfig.getConfigValue(property); if (value.getRawValue() != null) { - runTimeValues.put(value.getNameProfiled(), value); + runTimeValues.put(value.getNameProfiled(), value.noProblems().withValue(value.getRawValue())); } } } diff --git a/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/extest/ConfigMappingTest.java b/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/extest/ConfigMappingTest.java index 7ceae79dd2046..eb3d4be1e9a2d 100644 --- a/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/extest/ConfigMappingTest.java +++ b/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/extest/ConfigMappingTest.java @@ -12,7 +12,6 @@ import io.quarkus.extest.runtime.config.TestMappingBuildTimeRunTime; import io.quarkus.extest.runtime.config.TestMappingRunTime; import io.quarkus.test.QuarkusUnitTest; -import io.smallrye.config.SmallRyeConfig; public class ConfigMappingTest { @RegisterExtension @@ -20,9 +19,6 @@ public class ConfigMappingTest { .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) .addAsResource("application.properties")); - @Inject - SmallRyeConfig config; - @Inject TestMappingBuildTimeRunTime mappingBuildTimeRunTime; @Inject diff --git a/integration-tests/test-extension/extension/runtime/src/main/java/io/quarkus/extest/runtime/config/TestMappingBuildTimeRunTime.java b/integration-tests/test-extension/extension/runtime/src/main/java/io/quarkus/extest/runtime/config/TestMappingBuildTimeRunTime.java index 781a017516036..02ba6d32dad96 100644 --- a/integration-tests/test-extension/extension/runtime/src/main/java/io/quarkus/extest/runtime/config/TestMappingBuildTimeRunTime.java +++ b/integration-tests/test-extension/extension/runtime/src/main/java/io/quarkus/extest/runtime/config/TestMappingBuildTimeRunTime.java @@ -1,8 +1,11 @@ package io.quarkus.extest.runtime.config; +import java.util.Optional; + import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; import io.smallrye.config.ConfigMapping; +import io.smallrye.config.WithDefault; @ConfigMapping(prefix = "quarkus.mapping.btrt") @ConfigRoot(phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED) @@ -12,6 +15,12 @@ public interface TestMappingBuildTimeRunTime { */ String value(); + /** + * A expression value + */ + @WithDefault("${quarkus.mapping.btrt.expression.value}") + Optional expression(); + /** * A nested Group. */