-
Notifications
You must be signed in to change notification settings - Fork 40.4k
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
@ConditionalOnProperty for branch of values not match #41621
Comments
Your YAML file above has defined two properties:
If you want a condition that matches when any property whose name begins with |
Actually Mapping to map can be usefull.
|
Yes, that's to be expected. I didn't say otherwise above. When you bind properties to a map, the "property" that you're binding is actually the prefix. It's the keys that are added to the map that are the properties. I still don't think this is generally useful and has a number of limitations as explained above. As such, it's better suited to a custom condition in your application where you can accommodate any limitations more easily. We can reconsider in the future if things change or there's significant demand for it. |
A have sample yaml property file:
I want use
@ConditionalOnProperty
and create bean whenbranch2conditioned
is defined in application.It does not work actually.
I tried:
'''
@ConditionalOnProperty("prefix.branch1.branch2conditioned")
@ConditionalOnProperty(prefix ="prefix.branch1", name="branch2conditioned")
@ConditionalOnProperty(prefix ="prefix.branch1.branch2conditioned")
'''
Neither condition match.
The text was updated successfully, but these errors were encountered: