I'm trying to register an autoconfiguration with @ConditionalOnProperty
. This configuration should be created when there is any property with a predefined prefix.
For example, this configuration should be created when there is one of the properties listed below
test.property.any-text-goes-here.some-nested-property=test
test.property.nested.nested-two=another
I've tried to use @ConditionalOnProperty
with name=test.property
, but it doesn't seem to be working. Maybe this can be sorted out using @ConditionalOnExpression
, but I have no idea how SpEL expression should look like.
I'm wondering if there a way to achieve this without the need of implementing custom Condition
.
Thanks for your help!