My goal is:
Disable autosave in IntelliJ IDEA for a spring boot project
Hot reload the project always when files are manually saved
Seems to me that it is impossible to achieve these two goals simultaneously.
I can disable autosave in IntelliJ IDEA by modifying these settings:
Build, Execution, Deployment -> Compiler Uncheck Build project automatically
Also I think what is too needed is modify these options:
Appearance & Behaviour -> System Settings Uncheck both save files under Synchronization (frame deactivation and save files automatically)
I can enable hot reload by the help of Mkyong: Mkyong-help As you can see from the link, it requires setting 'Build project automatically' on. If I do both of these steps, then the application will always save on edit, and it will always hot reload the app.
This is so frustrating, I thought IntelliJ IDEA was a good modern IDE, with these kind of industrial core features like hot reloading handled easy?
The problem is, that I really don't want to hot reload my application on every change I make to the files! Because then it will be continuously hot reloading, which will break the application most of the time. Just so unnecessary and wasting resources. I want to hot reload always when I manually save a file, which is a standard for so many other editors. There has to be a solution for this problem, because people want reasonable hot reload for their development.
5 Answers. Show activity on this post. Add spring-boot-devtools module to your project, which includes LiveReload server which can be used to trigger a browser refresh whenever a resource has been changed. You can download browser extensions from livereload.com.
Reload all files Recompilation happens automatically if the Build project before reloading classes option is enabled in Settings/Preferences | Build, Execution, Deployment | Debugger | HotSwap. If this option is disabled, you need to recompile the files before reloading (Build | Recompile Ctrl+Shift+F9 ).
There are several options for hot reloading. The recommended approach is to use spring-boot-devtools as it provides additional development-time features such as support for fast application restarts and LiveReload as well as sensible development-time configuration (e.g. template caching).
As far as I understand, your issue is that you want the spring server to reload automatically whenever you make changes and then manually save them. Right? if the that is the case, follow my steps and hopefully you will get what desire.
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
dependencies {
compile("org.springframework.boot:spring-boot-devtools")
}
compiler.automake.allow.when.app.running
registry setting in IntelliJ. You can access the registry in IntelliJ using the shortcut Shift+Command+A
, then searching for registry.The 3rd step will make building your project (make project) automatic when you save you changes manually.
======================================================================== These steps will enforce spring server to reboot once changes has been saved manually via your IDE. However, you need to refresh your browser every time you make a change even though the server is rebooted. To enforce your browser to refresh automatically as well, you need an extension installed in your browser called Live Reload. Check this link http://livereload.com/extensions/. the link will show you how to install this extension depends on your browser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With