-
Notifications
You must be signed in to change notification settings - Fork 41.2k
spring.config.activate.on-profile cannot be used in profile specific file #24990
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
Comments
Thanks for the report. I was going to close this as a duplicate of #24941 but this case is a little different. The change in behaviour is due to #24733. The intent of this issue was to start failing when a property is used that was previously being silently ignored. However, in this case the property wasn't being silently ignored. With the example above, when the We'll need to decide how we want to handle |
It would be nice, if you consider the combination of profile specific files with on-profile as feature, because it allows for better structuring thus smaller properties files. |
We're going to try to support |
If I get the intention right from @markusheiden it would indeed be benefitial to have multiple yaml files contains application properties and each files is sub-structured in sections having their own value for spring.config.activate.on-profile. This way, larger setups with lot's of properties would be very well supported. Example: application-logging.yaml
You can then organize all logging configuration properties in one property file and depending on the active profile, the part of the yaml file is used. @wilkinsona: Is that what you have in mind by saying "We're going to try to support spring.config.activate.on-profile in a profile-specific file." in your comment above? Thanks in advance for a short answer on this. If I understand correctly how it works in 2.4.1, you need to have any of the following profile combinations in your list of active profiles: "logging, production", "logging, staging" or "logging,local". Is this correct? I never tried this myself with 2.4.1 since we are currently upgrading directly to 2.4.2. Another option would be, to ignore the suffix of the filename application-suffix.yaml and just interpret this file as another application.yaml. This way, the files won't get too long and the profile-specific config for logging is just activated by having any of the following profiles in the list of active profiles: "staging", "production" or "local". |
@larsduelfer Short answer: yes. Slightly longer answer: Yes, although you may want to use a |
We use the "multi properties files in one" feature of Spring Boot 2.4.
With the change from Spring Boot 2.4.1 to 2.4.2 the following does no longer work:
application-xxx.properties
If I incorrectly used this feature I apologize upfront.
The text was updated successfully, but these errors were encountered: