If you dont have the same package as the package of your main application then you have to add @EntityScan("package where to find the entitys").
Edit: Normal Spring Boot package scan doesnt recognize outside of the application base package where entities are therefore you can use @EntityScan which allows to scan independently from @ComponentScan to scan for JPA entities. Heres the javadoc for @EntityScan https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/autoconfigure/domain/EntityScan.html which