1、环境
JDK
C:\Users\Administrator>java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
maven
C:\Users\Administrator>mvn -v
Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T23:06:16+08:00)
Maven home: D:\Maven\apache-maven-3.6.2\bin\..
Java version: 1.8.0_121, vendor: Oracle Corporation, runtime: D:\Java\jdk1.8.0_121\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
SpringBoot
Spring Boot 2.4.0+
IDEA
2019.3.4
2、创建项目
官方网站下载JAR包
官网:https://spring.io/projects/spring-boot
官方提供了一个快速生成的网站。IDEA集成了这个网站。
SpringBoot的依赖使用spring-boot-starter开头。
<dependencies>
<!--启动器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>