Thymeleaf allows using files from src folder during development. However live reload does not have a file system watcher for "additional paths" to auto reload based on those templates
Just as there is there is spring.devtools.restart.additional-paths,
request new property spring.devtools.livereload.additional-paths
this should work in support of thymeleaf.prefix
logging:
config: classpath:log4j2-local.xml
spring:
devtools:
livereload:
enabled: 'true'
additional-paths:
- file:src/main/resources/static/
- file:src/main/resources/templates/
thymeleaf:
cache: 'false'
prefix: file:src/main/resources/templates/
check-template-location: 'true'
web:
resources:
static-locations:
- file:src/main/resources/static/
- classpath:/static/
cache:
period: 0
Comment From: mhalbritter
I think this is already possible, but it's somewhat non-intuitive:
Add the additional paths to spring.devtools.restart.additional-paths but then exclude them from restarting the application through spring.devtools.restart.additional-exclude.
This should set the filewatcher to watch for changes, triggering the livereload, but don't restart the app as the location has been excluded from restart.
But I agree that there should be a property for that.
Comment From: itsAkshayDubey
Hi @mhalbritter ,
I would like to work on this enhancement, could you please assign me this issue so that I can submit my PR in favour of this issue.
Thanks, Akshay
Comment From: philwebb
All yours @itsAkshayDubey
Comment From: 30atm
I used a work-around and achieved this behavior
see LiveReloadConfig.java in this repo https://github.com/ibhatech/world-facts/tree/dev
Comment From: itsAkshayDubey
Unable to access this repo. @metaforte
Comment From: 30atm
made it public now
Comment From: itsAkshayDubey
Hi @philwebb ,
Kindly have a look at PR #41566
Thanks, Akshay