Tuesday, July 10, 2018

Enable Auto start - Springboot Dev Tool - Intelij

To Enable Auto Restart for Springboot App anytime something is changed on the class path

Add below dependency to pom:

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



Set your Intelij build settings to build project automatically




Applications that use spring-boot-devtools automatically restart whenever files on the classpath change. This can be a useful feature when working in an IDE, as it gives a very fast feedback loop for code changes. By default, any entry on the classpath that points to a folder is monitored for changes. Note that certain resources, such as static assets and view templates, do not need to restart the application.


Enable automatic compilation
Get an improved JRebel development experience by enabling automatic compilation:
  1. Access Settings (Preferences on macOS).
  2. Select Build, Execution, Deployment > Compiler. Enable Build project automatically.
  3. Select Appearance & Behavior > System Settings. Enable Save files automatically if application is idle for. We recommend setting it to 10 seconds. (This is already enabled by default on IntelliJ 2018.1 and earlier.)
  4. Press OK.
  5. Press Ctrl+Shift+A (Cmd+Shift+A on macOS) and search for Registry. Open it to find and enable compiler.automake.allow.when.app.running (IntelliJ IDEA 15 and newer).