Hot deployment of springboot project in idea

During development, we need to see the effect in real time. At this time, we need to implement the hot deployment of the project. After we modify the class, we can compile and deploy in real time. Let's summarize the steps to implement hot deployment in the idea.

  1. Add dependencies and plugins in pom.xml
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional>
        <scope>true</scope>
    </dependency>
    
    <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
            <fork>true</fork>
        </configuration>
    </plugin>
    
  2. Open hot deployment in application.properties
    spring.devtools.remote.restart.enabled=true
    
  3. Even if the compilation settings of IDEA are turned on, windows and mac are slightly different, as you probably know, then find out
    by yourself to open IDEA's Preferences, click Compiler, and then on the right side we can see the option Build project automatically, we check it Remember to click Apply, and then click OK.
    Insert picture description here
    After this setting, there is another place, windows click ctrl+shift+alt+/, mac click cmd+shift+a, open and find Registry, click to open one again, find compiler.automake.allow.when.app.running, tick Select it, click close, and then restart IDEA.
    Insert picture description here

Insert picture description here
The above is all the steps.

Guess you like

Origin blog.csdn.net/weixin_45345374/article/details/112942674