The most commonly used and important spring boot annotations are as below:
@EnableAutoConfiguration
– It enable auto-configuration mechanism.@ComponentScan
– enable component scanning in application classpath.@SpringBootApplication
– enable all 3 above three things in one step i.e. enable auto-configuration mechanism, enable component scanning and register extra beans in the context.- @ImportAutoConfiguration
@AutoConfigureBefore, @AutoConfigureAfter, @AutoConfigureOrder
– shall be used if the configuration needs to be applied in a specific order (before of after).@Conditional
– annotations such as @ConditionalOnBean, @ConditionalOnWebApplication or
@ConditionalOnClass allow to register a bean only when the condition meets.