参考:https://blog.youkuaiyun.com/qq_38262266/article/details/107447406
说明:我用的是idea2020.3
1.确保依赖中已经加入了spring-boot-devtools,并保证optional选项为true,就像下面这样:
<!-- 开启热部署 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
如果不放心该依赖是否成功添加,点击view -> Tool Windows -> Maven,看到依赖已经成功加载
2.IntelliJ IDEA -> Preferences -> Compiler 将如下选项进行勾选