New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add note about change in processing order of configuration files to release notes #24497
Comments
@philwebb How do our smoke tests pass in that case? |
I can't reproduce the reported issue in 2.4.1, nor in current master branch |
I've asked the OP to provide a sample |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
I have packaged the maven project as a zip file. |
The behavior is reproducible when the spring.config.use-legacy-processing is set to false. |
Hi, thanks for providing the sample. Still can't reproduce your issue thou, I'm getting |
It happens on two Systems: |
Have you modified the property 'spring.config.use-legacy-processing' in /application.yml when testing or have you created a new property in /src/main/resources/application.yml? |
In my tests it is enough to just modify the existing property in /application.yml to get the two different behaviors. |
I created a project to demonstrate this bug https://github.com/pearsonradu/spring-boot-24497. This project showcases the context I was in when I discovered this issue. Essentially there are two spring profiles,
Additional, I have a test case with
|
Hi, @pearsonradu this is a slightly different issue, I've raised a separate issue for that #24798 |
Such behavior is inline with the documentation https://docs.spring.io/spring-boot/docs/2.4.0/reference/htmlsingle/#boot-features-external-config
The change is effective from 2.4.0 as part of #22497 |
Thanks for the sample @ibiko. @encircled Thanks for the suggestion. We should add a note about the change in behavior to the release notes. |
Could you please clarify on how OP's issue about using |
It's not that the If you're seeing that the |
I think I get that part, up until 2.4.1 having |
@ideazinfinite That is not the behavior I'm seeing with the sample provided above. I see the same behavior with 2.4.1 and 2.4.2. If you think you have found a bug in 2.4.2, please raise another issue with a small sample that can be run to reproduce it. |
Closing this issue as this has already been documented in the migration guide. |
See https://spring.io/blog/2020/08/14/config-file-processing-in-spring-boot-2-4#comment-5188826974
project/application.yml:
project/src/test/resources/application-test.yml:
When the test is run with spring boot 2.4.1 the value from
application.yml
is injected.When the test is run with spring boot 2.3.6 the value from
application-test.yml
is injected.When the test is run with spring boot 2.4.1 and
spring.config.use-legacy-processing: true
the value fromapplication-test.yml
is injected.The text was updated successfully, but these errors were encountered: