1、在pom.xml中添加devtools依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
2、在idea中配置
File->Settings->Build,Execution,Deployment->Compiler->勾选Build Project automatically
如果要取消热部署的话直接不勾选Build Project automatically就可以了。
注:
直接修改jsp页面以及新增文件和文件夹Tomcat会重启,如果需要上传文件请取消热部署。