添加时,在pom.xml文件中添加,如一个web应用就会有spring-boot-starter-web,如果要添加其他的,可以去spring.io查找文档。添加进pom中后,springBoot会将需要的依赖自动注入。