在IDEA中让freemarker编辑时自动刷新
2023-09-27 14:21:39 时间
使用IDEA进行开发,使用freemarker做前端展现,但发现前端页面修改后总是重新启动才能刷新。
主要原因是IDEA的热部署没有成功启动。热部署主要有以下几个地方,缺一不可:
1、在pom.xml中引用相应的依赖包。
1
2
3
4
5 |
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency> |
1
2
3
4
5
6
7 |
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin> |
2、打开IDEA的自动编译(IDEA缺省是关闭的):
Settings-> Build-Execution-Deployment –> Compiler,将 Build project automatically勾上。
3、打开运行时自动编译:
通过Help->Find
Action,来打开Registry……。将其中compiler.automake.allow.when.app.running勾上。
4、在项目配置中,指定禁用freemarker缓存,及0秒刷新延迟。
1
2 |
spring.freemarker.cache=false
spring.freemarker.settings.template_update_delay=0 |
相关文章
- IntelliJ IDEA设置自动导入包
- IDEA 2021 最新版 常用插件配置汇总
- 手把手教你IDEA创建SSM项目结构
- idea创建vue项目
- Intellij IDEA这样 配置注释模板
- 【IDEA】自定义/自动生成/注释/新增文件自动生成注释/自动生成方法注释
- inteli idea创建maven项目
- IntelliJ IDEA新版本中compiler.automake.allow.when.app.running不存在的问题
- IDEA使用笔记(四)——工具栏的显示隐藏切换
- IDEA插件之代码质量检查利器 - Alibaba Java Coding Guidelines、CheckStyle、PMD、FindBugs、SonarLint
- Intellij IDEA System.out.println输出中文乱码问题
- IDEA&Maven中Pom.xml自动生效