首页 > 解决方案 > Spring boot maven 项目每次都必须更新才能看到变化 ECLIPSE IDE

问题描述

我在 Spring Boot 中使用 thymeleaf,index.html每次src/main/resources/template我想看到更改时,我都必须停止服务器,更新项目,然后重新运行应用程序,这是非常低效的,我只想运行和刷新,我添加了devtools到我的依赖项并设置spring.thymeleaf.cache= false它仍然无法正常工作

标签: javaspring-bootthymeleaf

解决方案


根据https://dzone.com/articles/spring-boot-application-live-reload-hot-swap-with如果您使用 Intellij,您应该编辑注册表。

  1. 打开设置 --> 构建-执行-部署 --> 编译器

    并启用自动生成项目。

  2. 然后按 ctrl+shift+A 并搜索注册表。在注册表中,启用以下配置。

compiler.automake.allow.when.app.running

  1. 重新启动 IDE。

推荐阅读