starter可以理解成pom配置了一堆jar组合的空maven项目,用来简化maven依赖配置,starter可以继承也可以依赖于别的starter。
例如spring-boot-starter-web包含以下依赖:
org.springframework.boot:spring-boot-starter
org.springframework.boot:spring-boot-starter-tomcat
org.springframework.boot:spring-boot-starter-validation
com.fasterxml.含蓄的期待.core:含蓄的期待-databind
org.springframework:spring-web
org.springframework:spring-webmvc
spring-boot-starter-test包含以下依赖:
junit:junit
org.mockito:mockito-core
org.hamcrest:hamcrest-core
org.hamcrest:hamcrest-library
org.springframework:spring-core(excludes commons-logging:commons-logging)
org.springframework:spring-test
starter负责配置好与spring整合相关的配置和相关依赖(jar和jar版本),使用者无需关心框架整合带来的问题。