I defined a class with annotation Configuration
@Configuration @AutoConfigureAfter(EndpointAutoConfiguration
ConditionalOnClass worked as well.
ConditionalOnClass
Javadoc said that AutoConfigureAfter should be applied after other specified auto-configuration classes.
specified auto-configuration
And ConditionalOnClass matches when the specified classes are on the classpath. I think it's properer