diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchHealthIndicatorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchHealthIndicatorAutoConfiguration.java index fd527ffb7f..20bcd7be08 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchHealthIndicatorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchHealthIndicatorAutoConfiguration.java @@ -32,6 +32,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration; import org.springframework.boot.autoconfigure.elasticsearch.jest.JestAutoConfiguration; @@ -55,6 +56,7 @@ import org.springframework.context.annotation.Configuration; public class ElasticsearchHealthIndicatorAutoConfiguration { @Configuration + @ConditionalOnClass(Client.class) @ConditionalOnBean(Client.class) @EnableConfigurationProperties(ElasticsearchHealthIndicatorProperties.class) static class ElasticsearchClientHealthIndicatorConfiguration extends @@ -87,6 +89,7 @@ public class ElasticsearchHealthIndicatorAutoConfiguration { } @Configuration + @ConditionalOnClass(JestClient.class) @ConditionalOnBean(JestClient.class) static class ElasticsearchJestHealthIndicatorConfiguration extends CompositeHealthIndicatorConfiguration {