Intellij + Springboot + Thymeleaf + gradle - 自动重新加载html资源 [英] Intellij+Springboot+Thymeleaf+gradle - autoreload html resources

查看:1006
本文介绍了Intellij + Springboot + Thymeleaf + gradle - 自动重新加载html资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用IntelliJ Ultimate,Spring Boot和Thymeleaf。

我想在不重新启动服务器的情况下启用HTML自动重新加载功能,并且不使用CTRL-F9。 / p>

我已经阅读了以下内容,我认为它应该可行,但它不是:




  • 和Intellij注册表设置:



    我的HTML是在 main \resources \templates 和我的 application.properties \resources \



    然后,我尝试了运行和调试项目,但无论如何,我仍然需要重建(CTRL-F9)阅读 here from snicoll and dsayer这应该是可能的,没有CTRL- F9:

    解决方案

    在添加注册表设置后出现:

      compilier.automake.allow.when.app.running 

    您不仅需要重启Springboot服务器,还要重启Intellij。



    现在就开始。


    I am using IntelliJ Ultimate, Spring Boot, and Thymeleaf.

    I want to enable auto-reload of HTML without restarting the server and without CTRL-F9.

    I have read the following already and I think it should be working, but it's not:

    I have done the following steps:

    build.gradle snippet

    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 Settings for Compilier:

    And Intellij Registry Setting:

    My HTML is in main\resources\templates and my application.properties is in \resources\

    I then have tried both running and debugging the project but either way, I still have to rebuild (CTRL-F9) between changes to the HTML.

    Reading here from snicoll and dsayer this should be possible without the CTRL-F9:

    解决方案

    It appears after adding the registry setting :

    compilier.automake.allow.when.app.running 
    

    You need to restart not only the Springboot server but Intellij too.

    It is going now.

    这篇关于Intellij + Springboot + Thymeleaf + gradle - 自动重新加载html资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆