我正在使用 IntelliJ Ultimate、Spring Boot 和 Thymeleaf。
我想在不重启服务器和不使用 CTRL-F9 的情况下启用 HTML 的自动重新加载。
我已经阅读了以下内容,我认为它应该有效,但它不是:
我已经完成了以下步骤:
build.gradle 片段
compile group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: '1.5.2.RELEASE'
compile("org.springframework.boot:spring-boot-devtools")
runtime('mysql:mysql-connector-java')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
bootRun {
addResources = true
}
编译器的 IntelliJ 设置:
和 Intellij 注册表设置:
我的 HTML 在 main\resources\templates
而我的 application.properties
在 \resources\
然后我尝试运行和调试该项目,但无论哪种方式,我仍然必须在 HTML 更改之间重建 (CTRL-F9)。
阅读 here来自 snicoll 和 dsayer,这应该可以在没有 CTRL-F9 的情况下实现:
最佳答案
添加注册表设置后出现:
compilier.automake.allow.when.app.running
不仅需要重启Springboot服务器,还需要重启Intellij。
现在开始了。
关于intellij-idea - Intellij+Springboot+Thymeleaf+gradle - 自动重载html资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43402551/