How exactly does the @ConditionalOnClass
annotation work?
My goal is to load a specific bean only if the jar
providing this class is included i
Good catch!
You can use on @Bean
method level, but in that case you have to specify your class as a String literal:
@Bean
@ConditionalOnClass(name ="de.MyService")
public MyConditionalBean statistics() {
return new MyConditionalBean();
}
I don't remeber already "why", but it is from an existing code of Spring Boot sources.