1.首先在pom.xml中添加依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>2.0.4.RELEASE</version>
</dependency>
2.然后将编译方式写上(也是在pom.xml文件中):
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
3.设置如图:

image.png

image.png
4.设置tomcat使用exploded包:

image.png
5.设置tomcat:

image.png
6.最后将浏览器的缓存关闭:
关闭浏览器的缓存文件功能,我是使用谷歌的chome
那么就把disable cache勾选 ,其他浏览器也需要关闭的,这里就不展示。

image.png
总结:热部署需要使用debug模式启动,不然后端代码热部署将无法生效