Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spring-boot-devtools: how to exclude java classes from restarting the application?

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)?

like image 435
7824238 Avatar asked Apr 16 '17 10:04

7824238


1 Answers

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.

like image 140
davidxxx Avatar answered Oct 23 '22 03:10

davidxxx