1、引入依赖pom.xml
<!-- 配置Spring Boot热部署依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- 实现热部署的设置 -->
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
2、Preferences->Build, Execution, Deployment->Complier
3、Mac环境下使用Command+Shift+A(Windows为:ctrl + shift + alt + / )的快捷键,输入Registry,选择第一个(下图的红框有点问题)。
4、勾中compiler.automake.allow.when.app.running:设置自动编译