为 Spring Boot 2.6.4 替换 ConditionalOnEnabledEndpoint

Replace ConditionalOnEnabledEndpoint for Spring Boot 2.6.4

我想迁移使用此依赖项的旧 Spring 项目:

org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnEnabledEndpoint

此 Class 需要导入:

'org.springframework.boot:spring-boot-actuator-autoconfigure:2.0.2.RELEASE'

我尝试使用最新版本:

'org.springframework.boot:spring-boot-actuator-autoconfigure:2.6.4' 但 ConditionalOnEnabledEndpoint 不可用。你知道应该使用哪个class吗?

它不再存在(参见 https://docs.spring.io/spring-boot/docs/2.6.4/api/). In version 2.2.0 it was deprecated in favour of @ConditionalOnAvailableEndpoint (see https://docs.spring.io/spring-boot/docs/2.2.0.RELEASE/api/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnEnabledEndpoint.html)。