And also, I would like to add to that sometimes when you have a project structure where your controllers need to be in a different package than your SpringBootProject class annotated, you can add how many path to be scanned by Spring boot, just like
@ComponentScan({"com.path1", "com.path2"})