设置spring boot 热重启之后,idea会自动监听代码的改动,发现改动之后会自动编译,无需手动重启就能看到修改之后的运行效果。
一:在maven里添加依赖
复制代码
1
2
3
4
5
6
7<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope><!-- --> <optional>true</optional> </dependency>
二:在settings(ctrl +alt+s) -> Build,Execution,Deployment -> compiler, 添加"Build project automatically"
三:使用快捷键ctrl+shift+a,然后输入registry,然后点击进入,勾选compiler.automake.allow.when.app.running
四:重启IntellijIDEA。
Note:不过经过我测试,一般修改代码一分钟左右才会自动编译,反应比较慢…
最后
以上就是犹豫音响最近收集整理的关于IntellijIDEA设置实现spring boot 热重启的全部内容,更多相关IntellijIDEA设置实现spring内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复