I create :
- one library using Spring (common-spring)
- one springboot project which use this library.
In my library common-spring, I have create multiple HealthIndicator
(Actuator).
In my HealhIndicator I define the @ConditionalOnEnabledHealthIndicator
@ConditionalOnEnabledHealthIndicator("mailServiceIndicator")
@Component
public class MailServiceHealthIndicator implements HealthIndicator
I would like to indicate that all these Indicator are disabled by default. So, I add in my library application.properties :
management.health.mailServiceIndicator.enabled=false
My problem is : this properties is not take account when I run my springboot application. It's seem that the application.properties of my library is not use.
I try to change the name of my libray application.properties
to common-spring.properties
and add in a @Configuration
class :
@PropertySource({
"classpath:common-spring.properties",
"classpath:application.properties"
})
But that no change the behavior. (When I do that and I read the propertySource, properties from library are well found but not use in my Indicator in the library)
If I was clear, does anyone have any idea how to get my libraria to use the application.properties
?
Thanks