在原先使用eclipse的时候很容易布置了热部署
但是在idea的使用中写html的文件时候总是需要去重启浪费了很多时间
所以这篇博客主要讲解的是idea的热部署
配置idea的热部署需要两个步骤
一、
在pom文件中添加依赖
<!--添加热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>
<plugin>
<!--热部署配置-->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--fork:如果没有该项配置,整个devtools不会起作用-->
<fork>true</fork>
</configuration>
</plugin>
二、
设置IDEA的自动编译:
(1)File-Settings-Compiler勾选 Build Project automatically
(2)快捷键 ctrl + shift + alt + /,选择Registry,勾上 Compiler autoMake allow when app running
这样我们的idea的热部署就完成了!