I am using a dependency as:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>runtime</scope>
</dependency>
The devtools work fine when I make changes to my .java files but doesn't work when I make changes in my static files(.html files). Also, the change is not seen when I reload the page. I have to restart the application to see the changes. And it is quite a time consuming to restart the app every time I make a few small changes.
In spring-boot-maven-plugin in pom.xml add the following configuration:
<configuration>
<addResources>true</addResources>
</configuration>
The above will work if you starting the app from the command line. However, please see this post for more details on this: Refreshing static content with Spring MVC and Boot
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With