In my Quarkus application, I don’t want passwords to be versionned by Git.
I don’t have any issue with the
prod profile because I have a config file in
dev profile, I’m using the
.env approach which contains properties such as :
I’m trying to setup tests and I need some separate conf for tests.
So I have the following config in my
Unfortunately, the test value (
bar) is overriden by the
.env value (
foo) which is supposed to be dedicated to the
I don’t find an elegant way to fix it.
Based on https://quarkus.io/guides/config#overriding-properties-at-runtime I have 5 possible approachs:
.envfile: Could work, but I can’t specifiy value for
devprofile only (aka
$PWD/config/application.propertiesfile: well, this is for dev mode, I don’t find it convinient as target is cleared and I have to copy again the
configfolder after each
ConfigSourceProvider. I know this one could work, but I prefer to avoid doing specific stuff in my project, and stay with the builtin Quarkus config.
I just found that I was wrong about that :
.envfile: Could work, but I can’t specifiy value for dev profile only (aka
It is possible to have custom profile values in
.env file :
As I can prefix the property with
_DEV_[...], this value is for
dev profile only: the
test property is not overriden anymore.