Eclipse does not reload compiled css while running

风格不统一 提交于 2019-12-13 07:35:05

问题


TLDR;

Eclipse does not seem to detect changes in compiled css file and does not reload them on a running server.

Problem

I can successfully generate css files from less files using wro4j everytime i update a less file.

I have followed this tutorial from the official spring boot website itself.

Text from the tutorial

The wro4j-maven-plugin has some Eclipse integration features and you can install it from the Eclipse Marketplace (try it later if this is your first time - it’s not needed to complete the application). If you do that then Eclipse will watch the source files and re-generate the outputs if they change. If you run in debug mode then changes are immediately re-loadable in a browser.

I have used the wro4j eclipse integration which re generates the output if the source less file changes, but these changes are not re loadable in the browser.

However, If I manually modify the compiled css after generation, the change is successfully reloaded by eclipse/spring-boot. So currently after i make changes to the less files, css files are generated but is not picked up by the running server. I have to open the compiled file, type a space and do a backspace and save it, only then it's reloaded.

Any ideas on how to solve this problem?

EDIT: Eclipse is reloading all the changes except if the file has been auto generated. For eg. If i modify one of my html files it reloads them right away. But if i modify a less file, which in turn modified the css file.. this stays the same..even after restart.

I thought it could have also been because of caching now but i tried these settings and it still doesn't work

spring.thymeleaf.cache=false
spring.resources.cache-period= 5
spring.resources.chain.cache=false

回答1:


Try to set Refresh using native hooks or polling to true.

window-> preferences-> general -> workspace -> Check Refresh using native hooks or polling

Hope that helps



来源:https://stackoverflow.com/questions/45293373/eclipse-does-not-reload-compiled-css-while-running

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!