From ef41b1ece82e7fe456d897ffe027a64f1eecb325 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Tue, 23 Aug 2022 13:14:57 +0300 Subject: [PATCH] Add system properties source to CodeGenerator config sources Resolves: #27431 --- .../src/main/java/io/quarkus/deployment/CodeGenerator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/CodeGenerator.java b/core/deployment/src/main/java/io/quarkus/deployment/CodeGenerator.java index 87c70a6c30e1e..ef90eeee63e2b 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/CodeGenerator.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/CodeGenerator.java @@ -21,6 +21,7 @@ import io.quarkus.runtime.configuration.ConfigUtils; import io.smallrye.config.PropertiesConfigSource; import io.smallrye.config.SmallRyeConfig; +import io.smallrye.config.SysPropConfigSource; /** * A set of methods to initialize and execute {@link CodeGenProvider}s. @@ -149,6 +150,7 @@ public static boolean trigger(ClassLoader deploymentClassLoader, return callWithClassloader(deploymentClassLoader, () -> { final PropertiesConfigSource pcs = new PropertiesConfigSource(properties, "Build system"); + final SysPropConfigSource spcs = new SysPropConfigSource(); // Discovered Config classes may cause issues here, because this goal runs before compile final SmallRyeConfig config = ConfigUtils.configBuilder(false, false, launchMode) @@ -156,7 +158,7 @@ public static boolean trigger(ClassLoader deploymentClassLoader, .setAddDiscoveredInterceptors(false) .setAddDiscoveredConverters(false) .withProfile(launchMode.getDefaultProfile()) - .withSources(pcs) + .withSources(pcs, spcs) .build(); CodeGenProvider provider = data.provider;