Intellij idea Intellij+;Springboot&x2B;百里香叶+;gradle-自动加载html资源
我正在使用IntelliJ Ultimate、Spring Boot和Thymeleaf 我想在不重新启动服务器和不使用CTRL-F9的情况下启用HTML的自动重新加载 我已经阅读了以下内容,我认为它应该是有效的,但它不是:Intellij idea Intellij+;Springboot&x2B;百里香叶+;gradle-自动加载html资源,intellij-idea,gradle,spring-boot,thymeleaf,Intellij Idea,Gradle,Spring Boot,Thymeleaf,我正在使用IntelliJ Ultimate、Spring Boot和Thymeleaf 我想在不重新启动服务器和不使用CTRL-F9的情况下启用HTML的自动重新加载 我已经阅读了以下内容,我认为它应该是有效的,但它不是: 我已完成以下步骤: build.gradle代码段 compile group: 'org.springframework.boot', name: 'spring-boot-autoconfigure', version: '1.5.2.RELEASE' com
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
中,我的应用程序的属性在\resources\
中
然后,我尝试了运行和调试项目,但无论采用哪种方式,我都必须在HTML更改之间重建(CTRL-F9)
从snicoll和dsayer读取时,如果不使用CTRL-F9:则在添加注册表设置后会显示:
compilier.automake.allow.when.app.running
您不仅需要重新启动Springboot服务器,还需要重新启动Intellij
现在就要开始了。如果您仍在使用spring boot devtools
,我建议您使用Gulp自动加载模板和资源。下面是一个对我来说很神奇的小任务:
var gulp=require('gulp'),
watch=require('gulp-watch');
吞咽任务('watch',函数(){
返回监视('src/main/resources/****',()=>{
gulp.src('src/main/resources/**'))
//替换为netBeans的build/resources/main/for
.pipe(吞食目的地('out/production/resources/');
});
});
吞咽任务('default',['watch']);
我还写了一篇关于这个主题的短文,其中还包括其他方法。great job@Douggreaneyfollow了这里的一切,但仍然不起作用。重新启动一个all。*Spring Boot 2.1.2.RELEASE*IntelliJ 2018.3.4还有其他想法吗?