springboot热部署
需求分析
在我们开发的过程中,最烦的,最浪费时间的就是无论代码改动大小都要频繁的重启服务,而热部署正好解决了这样的问题
实现方案
springboot实现热部署的方案比较简单,仅需要加入相应的依赖即可。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
如果使用视图层渲染(例如:freemarker),则需要把设置视图层缓存为false
freemarker 设置方式
spring:
freemarker:cache: false
Thymeleaf 设置方式:
spring:
thymeleaf:cache: false
源代码链接:https://github.com/myNameIssls/springboot-study
还没有评论,来说两句吧...