I would like to have spring boot auto restart the server when my classes are updated. I already have seen the following answer:
How does Spring Boot load changes in code without restarting the server
My pom file has the following dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
I have the following settings enabled in Intelij:
And also:
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] osbdaOptionalLiveReloadServer: 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.
Any ideas how to fix this?
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:
mvn process-classes
(or something, that "touches the classpath").
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.