1.在pom.xml文件中加入以下依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
2.IDEA设置 File->Setting->Build,Execution,Deployment->Compiler,勾选Build project automatically
3.使用快捷键Ctrl+Shift+A,在弹出的输入框中输入Registry,在下拉框中选择Registry....,在弹出框中勾选 compiler.automake.allow.when.app.running