spring-boot: Devtools reload doesn't work with spring-boot-maven-plugin
After reading about the new dev tools features I decided to try it out.
I generally run my apps with mvn spring-boot:run
. So after the app started up (with mvn spring-boot:run
), changing some controller code and compiling the app, the app reload didn’t happen as I expected. Running the app standalone, however, does reload as expected.
The docs do not mention any constraints about how your run you app. Should the Maven plugin also support devtools or will this not be supported?
Tried with 1.3.0.M1 and 1.3.0-BUILD-SNAPSHOT.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 1
- Comments: 37 (13 by maintainers)
Commits related to this issue
- Use standard name for main thread DevTools look for a main thread named "main". The maven plugin is actually using a different value and there is no real reason to. This change fixes DevTools support... — committed to spring-projects/spring-boot by snicoll 9 years ago
- DevTools safe mode DevTools check the current thread to figure out whether it has to enable the reload feature. When the Maven plugin runs a Spring Boot application without forking, the classloader i... — committed to snicoll/spring-boot by snicoll 9 years ago
@snicoll I just added the enabled
fork
but modifications tomyapp.WebSecurityConfig
didn’t reload the server. My POM file now looks like this:Sorry if I’m dragging this issue on any longer, but it’s related, and I’m certain more newb like myself would be googling this without any help.
And i totally second adding it to start.spring.io
PS- Future Newbs react with a heart if this was helpful.
I’m using IntelliJ. Below are gifcasts of the two workflows:
mvn spring-boot:run
(not working)So basically, make changes to controller and then
Make project
. This compiles the changed classes to thetarget
directory asmvn compile
would do.Standalone (working)
You can reproduce this issue if you create Spring Boot application and name the application folder “spring-boot”
ok, strange, it was enough to change my folder name under git directory.
does it mean that my project folder shouldn’t be named ‘spring-boot-starter’ ? is it documented ‘feature’ ? 😃
Thanks. I’ve opened https://github.com/spring-projects/spring-boot/issues/23158.
I lost 2 hours of my life because the folder name was
spring-boot
of an example project I was debugging. For the sake of everything holy, fix this!!!