使用IDEA新建SpringBoot项目

1.打开IDEA,点击新建项目,选择Spring Initializr

使用IDEA新建SpringBoot项目

2.输入Group与Artifact

使用IDEA新建SpringBoot项目

3.选择web

使用IDEA新建SpringBoot项目

4.输入Project name,点击finish

使用IDEA新建SpringBoot项目

5.打开项目,可以将下面的文件删除

使用IDEA新建SpringBoot项目

6.写个测试Controller

使用IDEA新建SpringBoot项目

7.网页打开http://localhost:8080/

使用IDEA新建SpringBoot项目

8.热部署

(1)添加devtools

<!--热部署-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
</dependency>
<!--热部署-->
<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <fork>true</fork>
    </configuration>
</plugin>

(2)IDEA用户,选择 File-Settings-Compiler 勾选 Build project automatically.

使用IDEA新建SpringBoot项目

(3)快捷键ctrl+alt+shift+ /

使用IDEA新建SpringBoot项目

使用IDEA新建SpringBoot项目

完成