我正在使用 IntelliJ Ultimate、Spring Boot 和 Thymeleaf。
我想启用 HTML 自动重新加载,而无需重新启动服务器,也无需使用 CTRL-F9。
我已经阅读了以下内容,我认为它应该有效,但事实并非如此:
https://github.com/spring-projects/spring-boot/issues/34 https://github.com/spring-projects/spring-boot/issues/34
IntelliJ 15,SpringBoot devtools livereload 不起作用 https://stackoverflow.com/questions/33869606/intellij-15-springboot-devtools-livereload-not-working
使用 Spring boot 对 Intellij 中的资源进行 Livereload https://stackoverflow.com/questions/34104664/livereload-for-assets-in-intellij-using-spring-boot/37769756#comment73860827_37769756
我已完成以下步骤:
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
and my application.properties
is in \resources\
然后我尝试了运行和调试项目,但无论哪种方式,我仍然必须在 HTML 更改之间重建 (CTRL-F9)。
Reading here https://github.com/spring-projects/spring-boot/issues/34来自 snicoll 和 dsayer ,这应该可以在没有 CTRL-F9 的情况下实现:
添加注册表设置后出现:
compilier.automake.allow.when.app.running
您不仅需要重新启动 Spring Boot 服务器,还需要重新启动 Intellij。
现在正在进行中。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)