Home > Enterprise >  Spring boot hot reloading does not work in InteliJ Community edition
Spring boot hot reloading does not work in InteliJ Community edition

Time:12-22

I would like to have spring boot auto restart the server when my classes are updated. I already have seen the following answer:

enter image description here

And also:

enter image description here

When I now spin up the server I get the following:

Notice in the logs:

2021-12-18 15:18:42.624 INFO 4204 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729

But now when I make changes to any of the files in the package where my main method is and subpackages (for example: Test controller) my server does not get reloaded.

enter image description here

Any ideas how to fix this?

CodePudding user response:

As the IntelliJ Edition Comparison shows, Community Edition doesn't "support":

Spring, Jakarta EE, Java EE, Micronaut, Quarkus, Helidon and more...

We can (little ugly, because an exception "flies", the restart happens (at least)2 times ..depending how long the build/compilation takes) "hack".

Running a maven spring-boot:run configuration, we can:

  • (better) Deactivate the shown settings: Save on Compile, "Allow auto make on running..." (we can also leave, but the result/number of restarts will be less predictable:)
  • Trigger an (additional) "(Re-)build module/project" build, or a mvn process-classes (or something, that "touches the classpath").
  • Related