@ComponentScan({"com.test.cloud"})
@SpringBootApplication
public class TestClass  {

    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(TestClass.class, args);
    }
}
public class TestClass2{

@EventListener(ApplicationReadyEvent.class)
    public void testMethod() {
      .....
      .....
 }
}

Here if I remove @ComponentScan({"com.test.cloud"}) annotation then the testMethod is triggered. But when I use @ComponentScan({"com.test.cloud"}) then the testMethod is not triggered.

SpringBoot Version: 1.5.10.RELEASE

Comment From: snicoll

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.