springboot + idea code modification hot deployment/loading

As a JAVA programmer, waiting for code to compile is a pain. Moreover, the pursuit of high efficiency is a natural quality of programmers.

In the process of contacting the powerful springboot framework, every time the code is modified, it must be restarted. I just thought that there must be a way to achieve hot loading/deployment after code modification. Sure enough, springboot has already prepared a solution for us, which is convenient and fast. After collecting some information, verify it yourself, the following methods are feasible, please refer to the following methods to set. (This article uses idea as an example)


Step 1:  Add the following dependencies to pom.xml

[html] view plain copy
  1. <dependency>  
  2.      <groupId>org.springframework.boot</groupId>  
  3.      <artifactId>spring-boot-devtools</artifactId>  
  4. </dependency>  


Step 2: Open the idea, File->Settings-> Build-Execution-Deployment -> Compiler

Check Build  Project Automatically




Step 3:  Press Shift+Ctrl+A (windows, mac is command+shift+A) 

You will see a pop-up window  Enter Action or option name, enter " registry", double-click the first item "Registry...", another window will pop up, look for

compiler.automake.allow.when.app.running
This item, and tick to enable. Then close the window.





Step 4:  Restart the IDE

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324950383&siteId=291194637