还是比较简单:
1.添加dev-tools的依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
2.Settings配置Build project automatically,如下:
3. “Shift+Ctrl+Alt+/”,选择 “Registry”,选中打勾 “compiler.automake.allow.when.app.running” 。步骤如下截图: