Kaspar Kaspar - 1 year ago 272
Java Question

Livereload for assets in Intellij using Spring boot

When using Spring without the Spring boot technology, I can start the application with the Tomcat Maven plugin and update my html, css and js without having to restart the server for the changes to take effect in the browser.

Now, when doing this with Spring boot, I will have to do a

task in IntelliJ everytime I change something in my static assets, otherwise I just wont see the changes in browser. My Spring Boot application is also using the devtools dependency, and I have the browser connected to the live reload socket when looking.

This configuration still does not show the changes I make in my static files. What do I need to do to get this working?

Answer Source

It seems that the problem was in the placement of my static assets. I had to put them into a webapp folder under the main package. I was following a guide from Spring.io before that advised to put the static assets into resources package instead.

Now that I stopped using the resources package, everything works as i want it to.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download