Starters

来自姬鸿昌的知识库
Jihongchang讨论 | 贡献2023年2月1日 (三) 07:30的版本
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索

https://docs.spring.io/spring-boot/docs/2.7.8/reference/html/using.html#using.build-systems.starters

所有官方启动器都遵循类似的命名模式; spring-boot-starter-*,其中 * 是特定类型的应用程序。

artifactId 描述
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
spring-boot父pom,继承 spring-boot-dependencies,引入依赖
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
spring-boot-starter核心包

包括了自动配置的支持,日志和YAML

<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
web 启动器,用来构建 web,包括 RESTful 和 应用 Spring MVC 的应用程序。

使用 Tomcat 作为默认的内嵌容器

创建自定义 starter,命名应该是 thirdpartyproject-spring-boot-starter


所有 starter 最底层的依赖:

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter</artifactId>
      <version>x.x.x.RELEASE</version>
      <scope>compile</scope>
    </dependency>