一、项目pom.xml添加devtools依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
二、父工程添加插件
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
三、设置自动构建
File -> Settings -> Build,Execution,Deployment -> Compiler -> 选中Build project automatically
四、按快捷键 “ctrl+shift+alt+/”
显示如下菜单,点击Registry选项
找到
compiler.automake.allow.when.app.running
actionSystem.assertFocusAccessFromEdt
选项,选中后面的复选框