In Intellij IDEA with activating spring-boot-devtools
in the maven configuration, I can update easily static web components and the javascript or html code updates are easily reflected in the running application.
The disadvantage is that also my java classes get reloaded. This is something I want to avoid as I have some heavy classes with a loading time of up to two minutes.
How is it possible to configure spring-boot-devtools
that e.g. static web components get reloaded, but the server is not completely restarted (so that my Java class member variables stay untouched)?
If you want to benefit from automatic static resources refreshing only, you can disable the devtools restarting feature by setting the Spring Boot property spring.devtools.restart.enabled
to false
.
20.2.3 Disabling restart
If you don’t want to use the restart feature you can disable it using the spring.devtools.restart.enabled property. In most cases you can set this in your application.properties (this will still initialize the restart classloader but it won’t watch for file changes).
Here is the documentation reference.
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