Trigger devtools-based Restart of Spring Boot Application button does not restart project
Describe the bug I created a Spring project with Spring Devtools in Eclipse EE 2025-03. I have installed Spring Tool Suite 4.30 Eclipse plugin. I have written entities, a repository, a service and a controller and I ran the project as a Spring Boot App. Clicking "Trigger devtools-based Restart of Spring Boot Application" does nothing at all.
To Reproduce
- Have Eclipse with Spring Tool Suite installed.
- Create a Spring Boot maven project with Spring Boot Devtools
- Write some code
- Run project as Spring Boot Application
- Click the "Trigger devtools-based Restart of Spring Boot Application" (yellow refresh button) above the Console
- It does nothing
Sample https://github.com/IgorArnaut/Spring-Boot-Devtools-Issue
Reports that include a sample will take priority over reports that do not. At times, we may require a sample, so it is good to try and include a sample up front.
Thanks for the detailed report and for attaching the sample project, much appreciated. Unfortunately, I am not able to reproduce the issue. When hitting the "trigger devtools-based restart" button on the console, the boot app restarts itself. This also happens automatically when editing and saving a file, so that a class file gets updated on disc. The Spring Boot devtools pick that up automatically and restart the app. Is there nothing like that appearing on the console output on the app?
The line in the log that indicates that looks like:
Restarting due to 1 class path change (0 additions, 0 deletions, 1 modification)
Please note that the app gets restarted from within the same JVM, so the process itself isn't shutdown. The devtools restart the app within the same JVM process.
Side note: I had to remove all the database parts of your app, since it doesn't start without a database around. What happens if you create a fresh project from start.spring.io (for example using web and devtools as the starters) and run that from your IDE? Does the automatic restart and the button on the console work in that case?
You could also try to see if running Eclipse with Spring Tools installed vs. using a Spring Tools for Eclipse distribution from https://spring.io/tools makes a difference. I would be surprised if that would make a difference, but if there is nothing else that indicates why this isn't working on your side, I would at least try that to verify that this doesn't make a difference.
Thanks for the detailed report and for attaching the sample project, much appreciated. Unfortunately, I am not able to reproduce the issue. When hitting the "trigger devtools-based restart" button on the console, the boot app restarts itself. This also happens automatically when editing and saving a file, so that a class file gets updated on disc. The Spring Boot devtools pick that up automatically and restart the app. Is there nothing like that appearing on the console output on the app?
Spring App does not restart when I press the yellow refresh button at all. Spring App only restarts when I change Java code or application.properties.
Side note: I had to remove all the database parts of your app, since it doesn't start without a database around. What happens if you create a fresh project from start.spring.io (for example using web and devtools as the starters) and run that from your IDE? Does the automatic restart and the button on the console work in that case?
I have create the project in this Eclipse dialog.
You could also try to see if running Eclipse with Spring Tools installed vs. using a Spring Tools for Eclipse distribution from https://spring.io/tools makes a difference. I would be surprised if that would make a difference, but if there is nothing else that indicates why this isn't working on your side, I would at least try that to verify that this doesn't make a difference.
I have installed Spring Tools from Eclipse Marketplace.
Okay, so it sounds like the automatic restart from the perspective of the app works in general (e.g. when you change a Java source file and the corresponding class file gets updated). That is good.
When you hit the action in the console, it tries to trigger the same mechanism by writing (or updating) a file called .reloadtrigger that it stores in the output folder (the classpath that is used to run the app). In my sample case, it is target/classes. Do you see that file being written or updated when you press the button?
I don't see the file being generated.
I suspect something is off with this on Windows platform. Unfortunately, I don't have access to a windows machine anymore. Therefore there are 2 options:
- I can add various log statement in the code for you to try the scenario with the snapshot build and report back
- You clone sts4, import
org.springframework.ide.eclipse.boot.restartplugin from theeclipse-extensionsfolder. Put breakpoint around this code https://github.com/spring-projects/spring-tools/blob/0cbb4ba60f78156788cd2f60ff0561c3ac300934/eclipse-extensions/org.springframework.ide.eclipse.boot.restart/src/org/springframework/ide/eclipse/boot/restart/RestartAction.java#L114 launch eclipse runtime workbench and try your use case in the runtime workbench. I think you should be able to fix it yourself if everything goes well :-)
Let me know what would work best for you and I'll help as much as I can.
Hello
Just to all, is important have enabled
Project->Build Automatically
Therefore when any either .java or .properties file is edited and saved
Then inmediately the app is restarted as expected
@manueljordan Thanks for jumping in here, but I think the issue is with the Trigger devtools-based reloadbutton in the console view. Updated class files seem to trigger the reload for @IgorArnaut just nicely.
If you want to look deeper into this, you could have a look on your windows machine:
- See if the button in the console causes the mentioned
.reloadtriggerfile to be written to the output folder - If that doesn't happen, follow the steps that @BoykoAlex described in https://github.com/spring-projects/spring-tools/issues/1563#issuecomment-2908501072 to debug this
There must be a reason why @IgorArnaut doesn't see the .reloadtrigger file appear
@IgorArnaut Where you able to get to the ground of this with the comment from @BoykoAlex above?