“Spring Boot 自动配置特性”的版本间的差异

来自姬鸿昌的知识库
跳到导航 跳到搜索
第20行: 第20行:
 
       <artifactId>spring-boot-starter-tomcat</artifactId>
 
       <artifactId>spring-boot-starter-tomcat</artifactId>
 
       <version>2.3.4.RELEASE</version>
 
       <version>2.3.4.RELEASE</version>
 +
      <scope>compile</scope>
 +
    </dependency>
 +
</syntaxhighlight>
 +
 +
 +
 +
=== 自动配置好 Spring MVC ===
 +
spring-boot-starter-web-x.x.x.RELEASE.pom<syntaxhighlight lang="xml">
 +
    <dependency>
 +
      <groupId>org.springframework</groupId>
 +
      <artifactId>spring-web</artifactId>
 +
      <version>5.2.9.RELEASE</version>
 +
      <scope>compile</scope>
 +
    </dependency>
 +
    <dependency>
 +
      <groupId>org.springframework</groupId>
 +
      <artifactId>spring-webmvc</artifactId>
 +
      <version>5.2.9.RELEASE</version>
 
       <scope>compile</scope>
 
       <scope>compile</scope>
 
     </dependency>
 
     </dependency>
 
</syntaxhighlight>
 
</syntaxhighlight>

2023年2月1日 (三) 09:39的版本

https://www.bilibili.com/video/BV19K4y1L7MT/?p=7

怎么自动配好 Tomcat的?

怎么引入 tomcat 依赖的?

boot-01-helloworld - pom.xml

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

    </dependencies>


spring-boot-starter-web-x.x.x.RELEASE.pom

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


自动配置好 Spring MVC

spring-boot-starter-web-x.x.x.RELEASE.pom

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>5.2.9.RELEASE</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>5.2.9.RELEASE</version>
      <scope>compile</scope>
    </dependency>