I use spring-boot-starter-parent as parent and add spring-boot-starter-web as denpendency.
spring-boot-starter-parent
spring-boot-starter-web
By add the @SpringBootApplication annot
@SpringBootApplication
New reply to old post. Seems this is easier to do with more recent versions of Spring Boot. Just adding the property spring.mvc.servlet.load-on-startup=1 works for me.
spring.mvc.servlet.load-on-startup=1