educative.io

Educative

Developer Tools - Automatic restart

I’m not sure what is supposed to happen with this. I add the dependency to pom.xml

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId></dependency>

According to the text, making a change in the code should trigger a restart of the application? But nothing happens. For example, I add an extra movie to the list in RecommendationsController.java, nothing happens. I refresh the browser, it doesn’t show the added movie, just refreshes the page with the same information as before. I even try a manual save, but the only way to update is to manually restart the application. Which according to the text, should not be necessary?


Course: The Complete Guide to Spring 5 and Spring Boot 2 - Learn Interactively
Lesson: https://www.educative.io/courses/guide-spring-5-spring-boot-2/7DOnKyE9V6A

Hi @Michael_Todd, Thanks for reaching out to us.
You are trying to add dependency but in the lesson, it is clearly mentioned that Spring knows that the Maven dependencies do not change, so only the application beans are loaded again. Secondly, when the code is changed, only the RestartClassLoader is loaded, which causes the restart to be much faster.

Hope this helps.
Happy Learning :slight_smile: