关于JRebel 热部署
感觉更新和生成日志文件较多,不过可以配置或者更改代码更新时间
关注我的另一篇文章
idea如何安装热部署Jrebel
1、方式一配置含有tomcat项目运行的程序
解决中文乱码
-Dfile.encoding=UTF-8
2、方式二配置springboot项目运行的程序热部署
2.1、idea是2019版本
2.2、按住快捷键 ctrl+shift+alt + / 选择Register
2.3、勾选compiler.automake.allow.when.app.running
Allow auto-make to start even if developed application is currently running. Note that automatically started make may eventually delete some classes that are required by the application.
2.4、pom.xml文件加载热部署
<!--SpringBoot热部署插件-->
<!-- devtools 热部署依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<!-- optional 表示依赖是否向下传递 true表示不向下传递 默认值是false向下传递 -->
<scope>runtime</scope>
<optional>true</optional>
</dependency>
3.方式三配置文件中开启热部署
在application.properties 里添加配置
#热部署生效
spring.devtools.restart.enabled: true
#设置重启的目录
spring.devtools.restart.additional-paths: src/main/java
idea是2021版本后更新这位置
静态资源不更新问题解决
# 开启模板缓存(默认值: true )
spring.thymeleaf.cache=false //更改为false