diff --git a/extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/AbstractRestClientConfigBuilder.java b/extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/AbstractRestClientConfigBuilder.java index 1f0d37b0ca1551..26faff8777282a 100644 --- a/extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/AbstractRestClientConfigBuilder.java +++ b/extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/AbstractRestClientConfigBuilder.java @@ -53,9 +53,19 @@ public abstract class AbstractRestClientConfigBuilder implements ConfigBuilder { private static final String REST_CLIENT_PREFIX = "quarkus.rest-client."; + private final boolean runtime; + + public AbstractRestClientConfigBuilder() { + this.runtime = true; + RestClientsConfig.RestClientKeysProvider.KEYS.clear(); + } + + public AbstractRestClientConfigBuilder(boolean runtime) { + this.runtime = runtime; + } + @Override public SmallRyeConfigBuilder configBuilder(final SmallRyeConfigBuilder builder) { - RestClientsConfig.RestClientKeysProvider.KEYS.clear(); List restClients = getRestClients(); Map quarkusFallbacks = new HashMap<>(); @@ -63,7 +73,9 @@ public SmallRyeConfigBuilder configBuilder(final SmallRyeConfigBuilder builder) // relocates [All Combinations] -> quarkus.rest-client."FQN".* Map relocates = new HashMap<>(); for (RegisteredRestClient restClient : restClients) { - RestClientsConfig.RestClientKeysProvider.KEYS.add(restClient.getFullName()); + if (runtime) { + RestClientsConfig.RestClientKeysProvider.KEYS.add(restClient.getFullName()); + } // FQN -> Simple Name String quotedFullName = "\"" + restClient.getFullName() + "\""; diff --git a/extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/RestClientsBuildTimeConfig.java b/extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/RestClientsBuildTimeConfig.java index 192c41fd1c72dc..47df726193404d 100644 --- a/extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/RestClientsBuildTimeConfig.java +++ b/extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/RestClientsBuildTimeConfig.java @@ -143,7 +143,7 @@ private ConfigSource getDefaultsSource() { .withCustomizers(new SmallRyeConfigBuilderCustomizer() { @Override public void configBuilder(final SmallRyeConfigBuilder builder) { - new AbstractRestClientConfigBuilder() { + new AbstractRestClientConfigBuilder(false) { @Override public List getRestClients() { return restClients;