I want to enable automatic restarting/reloading using spring-boot-devtools in Intellij community edition
I have it listed in the Maven dependencies:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
I have console messages to indicate that the devtools have been initialised correctly, such as the live reload server being started.
However when I make changes to a Java class or a static file in the resources directory, it never causes a restart/reload.
I can manually invoke a restart/reload by using Build > Build Project
, but I really need this to be an automatic thing as I am mainly working on a separate window in VSCode (working on JavaScript files, which the community version of IntelliJ doesn't support)
I have tried the following two settings which seemed to be the solution to this or similar issues:
Settings > Build, Execution, Deployment > Compiler > Build project automatically
Settings > Advanced Settings > Allow auto-make to start even if developed application is currently running
Ensuring that restarting is enabled with "devtools: restart: enabled: true
" in the application.yml
Reloading maven dependencies
Reinstalling IntelliJ
But I am still unable to get the restarts to happen automatically.
IntelliJ IDEA 2023.3.2 (Community Edition)
Build #IC-233.13135.103, built on December 20, 2023
Runtime version: 17.0.9+7-b1087.9 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 11448M
Cores: 24
Non-Bundled Plugins:
Statistic (4.2.14)
Lombook Plugin (233.13135.65)
izhangzhihao.rainbow.brackets (2024.1.0-233)
org.sonarlint.idea (10.2.1.77304)
Kotlin: 233.13135.103-IJ
Update: I've found that automatic restart/reload works, but I have to focus the IntelliJ window after making changes in VSCode. Any way to allow IntelliJ to check for changes while window is not focussed?
I was able to get automatic restart/reload working by enabling the following two options:
Settings > Build, Execution, Deployment > Compiler > Build project automatically
Settings > Advanced Settings > Allow auto-make to start even if developed application is currently running
I was not able to get IntelliJ to detect changes while not focussed on the window, however I did find that enabling the following option can work almost as well:
Settings > Appearance & Behavior > System Settings > Sync external changes: Periodically when the IDE is inactive (experimental)
I presume this is reloading the files from disk at an interval, similar to File > Reload All From Disk
however it seems the interval is quite short, so most of the time is not noticeable.