IDEA Springboot Thymeleaf 热部署的三种方式

    xiaoxiao2022-07-14  147

    IDEA Springboot 热部署

    IDEA JAR包运行方法一 自动 定时执行方法二 手动 (推荐)方法三 自动 失去焦点执行 IDEA WAR包运行方法一 Eclipse Springboot WAR 热部署使用eclipse工具,静态文件会自动编译,java类只需要添加依赖

    第一步

    首先 在application.properties里关闭thymeleaf缓存 Spring.thymelf.cache=false, 默认是打开缓存的

    IDEA JAR包运行

    方法一 自动 定时执行

    Alt+Shift+M 勾选compiler.automalk.allow.when.app.runningCtrl+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 explodedService 将 On ‘Update’ action 和On frame deactivation 的 Do nothing 选项均改为 Update classes and resource 选项用debugger模式启动,失去焦点时自动更新

    Eclipse Springboot WAR 热部署

    使用eclipse工具,静态文件会自动编译,java类只需要添加依赖

    pom添加 devtools依赖 修改文件保存后eclipse会自动编译,然后自动更新
    最新回复(0)