文章目录
使用Idea 开发SpringBoot项目, 修改完代码以后,要重新启动 Application 才可以看到效果。这样做开发效率肯定是大受影响的。可以通过热部署、热更新来实时加载更改,提高效率。
添加热部署插件的依赖:
<!--热部署插件-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!--这个设置为true热部署才会生效-->
</dependency>
Idea需要进行两处的配置。
File
-->
Settings…
–>
Build,Excution,Deployment
Compiler
,选中
Build project automatically
Ctrl+Shift+A
->搜索
registry
,找到
Registry...
,(注意是后面有三个点),然后找到
compiler.automake.allow.when.app.running
,勾选即可: