千家信息网

springboot+freemarker热部署

发表于:2025-02-01 作者:千家信息网编辑
千家信息网最后更新 2025年02月01日,springboot+freemarker热部署1.在pom文件中添加org.springframework.bootspring-boot-devtoolstrueorg.springframewo
千家信息网最后更新 2025年02月01日springboot+freemarker热部署

springboot+freemarker热部署

1.在pom文件中添加


org.springframework.boot
spring-boot-devtools
true


org.springframework.boot
spring-boot-maven-plugin

true


2、设置 freeemarker.cache=false

SPRING PROFILES

spring:
freemarker:
allow-request-override: false
allow-session-override: false
cache: false
charset: UTF-8
check-template-location: true
content-type: text/html
enabled: true
expose-request-attributes: false
expose-session-attributes: false
expose-spring-macro-helpers: true
prefer-file-system-access: true
suffix: .ftl
template-loader-path: classpath:/templates/
settings:
template_update_delay: 0
default_encoding: UTF-8
classic_compatible: true

3、修改IDEA的设置

打开 Settings -> Build-Execution-Deployment -> Compiler,将 Build project automatically.勾上。

4、点击 Help -> Find Action…,或使用快捷键 Ctrl+Shift+A来打开 Registry…,将其中的compiler.automake.allow.when.app.running勾上。

5、重启idea
完成上面的步骤就可以方便使用了。

见: http://www.qchcloud.cn/tn/article/24

0