引入了devtools
依赖,目的是能够在配置、代码更新时,能够热启动项目,不用每次都手动停止,再启动,不过在Idea
中需要进行如下两步,完成配置:
Ctrl+Shift+Alt+/
打开maintenance
面板,选择第一个registry
, 勾选compiler.automake.allow.when.app.running
保存;Ctrl+Alt+S
, 打开配置面板,在File | Settings | Build, Execution, Deployment | Compiler下勾选Build project automatically
;
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>