I\'m evaluating Spring MVC & Boot and AngularJs for building web applications. I\'ve run into the problem that when I make modifications to my static content (html, js,
@eigil metioned addResources
config for maven build. I'm using spring-boot-gradle-plugin
in a gradle build, and I found this Spring Boot github issue
, and the Spring Boot doc mentioned this option too. Just add this directive to build.gradle and run Gradle task bootRun
, then resource file refreshes immediately when saved. FYI.
What I ended up using was Browsersync with grunt. browsersync and grunt watches your static resources on disk and updates the browser when you edit the files. It acts as a kind of proxy. This way you can see changes in UI immediately without building or restarting anything.
Grunt, browsersync, spring boot and angularjs are configured for you if you use JHipster which I used to setup my project.
Granted this requires a lot more tools than just an IDE and is a lot more complicated so I wouldn't recommend this for every project.
spring-boot-devtools is not the solution to "hot deploy" of edited static htm/js
I configured a web facet inside intellij so that when I use it to edit html/js file inside resources/static, intellij then knows to copy the updated file to ./target and the spring boot application I have launched inside the automatically displays that content
see https://www.jetbrains.com/help/idea/2016.2/configuring-static-content-resources.html