Spring Boot @ConditionalOnMissingClass Annotation Example
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL7ORk-MfAMU5I4AVm36c0aQ_Fr_QFEq9wmosrqi14QczpD_JMe-GfI2bai2rTV29YCMg-9B1MfvFx_qDfGz4cZ9zxcUp7sgAnRrvPe6CBlp_vA4UF53ta5uoxwS8Ddo4FJsroVQfzQZ4CDDCfympT5zVtYQkcOR6LHq93cqnNWJX5c5KztKiRN4a80A/w400-h159/missingclass.png)
In this section we will learn about @ConditionalOnMissingClass Annotation. The @ConditionalOnMissingClass can be used to register a bean only when the given class(es) cannot be found on the class-path. For example, when providing library/framework classes to other developers, this annotation can be used to active certain beans only based on the absence of specific classes. The @ConditionalOnMissingClass annotation may be used on any class annotated with @Configuration , @Component , @Service & @Repository or on methods annotated with @Bean . 1. Using @ConditionalOnMissingClass on @Bean method To illustrate the use of @ConditionalOnMissingClass , we will create one simple service classe, SMSNotificationService class. public class SMSNotificationService { public SMSNotificationService() { System.out.println( "Inside SMSNotificationService Constructor" ); } public void sendSmsNotification() { System.out.println( "Sending S