Search code examples
quarkus

Why does quarkus not use quarkus.profile config when it's set in $PWD/config properties file?


When I try to start my Quarkus application via a config-provided file (quarkus.config.locations=file://application.properties), quarkus.profile config field is not being set.
I can set the field in my classpath application.properties just fine, and I can set the field as a command-line system property just fine, it's only in the added file://application.properties file that I cannot set quarkus.profile.
I can set and override other fields in the config file and see them show up in my application, it's only quarkus.profile that isn't being consumed.

Following doc on https://quarkus.io/guides/config-reference to provide an application.properties file. I've seen the file being used as some fields are consumed, it's only quarkus.profile that isn't being used.

I am expecting quarkus.profile in ordinal 260 to be used if quarkus.profile isn't available anywhere else.


Solution

  • The quarkus.config.locations is a configuration that requires the Config system to be up and running to read it and do something about it. For instance, %dev.quarkus.config.locations requires loading from the dev profile. For that reason, the profile has to be set before. If quarkus.profile is set in configuration loaded by quarkus.config.locations it is ignored.