IDEA Springboot 热部署
第一步
首先 在application.properties里关闭thymeleaf缓存
Spring.thymelf.cache=false, 默认是打开缓存的
IDEA JAR包运行
方法一 自动 定时执行
- Alt+Shift+M 勾选compiler.automalk.allow.when.app.running
- Ctrl+Alt+S Builde,Exception,Deployment ->Compiler- 勾选Builder progect automatically
#运行方式 run/debugger
热更新文件 静态html等文件/JAVA类
方法二 手动 (推荐)
- 添加 devtools依赖 只支持Springboot项目
- 修改文件后手动builder修改的文件
#运行方式 run/debugger
热更新文件 静态html等文件/JAVA类
方法三 自动 失去焦点执行
- 点击 Edit Configurations 将 On ‘Update’ action 和On frame deactivation 的 Do nothing 选项均改为 Update classes and resource 选项
#运行方式 run/debugger
热更新文件 静态html等文件/JAVA类
IDEA WAR包运行
方法一
- Tomcat部署的时候 deployment 添加Artifacts 时选择 :war exploded
- Service 将 On ‘Update’ action 和On frame deactivation 的 Do nothing 选项均改为 Update classes and resource 选项
- 用debugger模式启动,失去焦点时自动更新
Eclipse Springboot WAR 热部署
使用eclipse工具,静态文件会自动编译,java类只需要添加依赖
- pom添加 devtools依赖 修改文件保存后eclipse会自动编译,然后自动更新