Closed ahreurink closed 1 week ago
The bug reproduces if I use mp-meta-config.yaml (I think this is how I should have done it to begin with).
However, if I use mp-meta-config.yaml and add add-default-sources: true
, the expected behavior does occur, even if there is no microprofile-config.properties
present
Meta-config yaml replaces other configuration options of MP Config.
You can configure profile
in the meta-config.yaml
file itself (and have a different file on each environment).
Thank you for your response Thomas. I see I should have added system-properties as a source.
Profiles in helidon-mp yaml configuration do not override config parameters.
Environment Details
Problem Description
When using a meta-config.yml file to specify a configuration file, this configuration file does not respect profiles. If I have a value
And i run my program with said profile, currently the value without profile is active, where as I expect the profile version to be active.
Steps to reproduce
Starting from a new helion-mp project, this is how I came to the described situation:
Add a config parameter with profile to
microprofile-config.properties
: I added for example "%dev.app.greeting=Hello-dev" after the default line "example app.greeting=Hello". When compiling, and runningjava -Dmp.config.profile=dev -jar target/helidon-quickstart-mp.jar
, nowcurl http://localhost:8080/greet
returns the following: {"message":"Hello-dev World!"}Add the file
meta-config.yaml
with reference to the default configuration filemicroprofile-config.properties
:When I run
mvn clean package
, followed byjava -Dmp.config.profile=dev -jar target/helidon-quickstart-mp.jar
and finallycurl http://localhost:8080/greet
, I would expect the same response, but the response is {"message":"Hello World!"}