1. 添加依赖

      1. <dependency>
      2. <groupId>org.springframework.boot</groupId>
      3. <artifactId>spring-boot-devtools</artifactId>
      4. <scope>runtime</scope>
      5. <optional>true</optional>
      6. </dependency>
    2. 添加spring-boot-maven-plugin插件

      1. <build>
      2. <plugins>
      3. <plugin>
      4. <groupId>org.springframework.boot</groupId>
      5. <artifactId>spring-boot-maven-plugin</artifactId>
      6. </plugin>
      7. </plugins>
      8. </build>
    3. 开启自动编译选项

    image.png

    1. 注册
      1. 快捷键Ctrl+Shift+Alt+/ 打开:

    image.png

    1. 选择以下选项

    image.png

    1. 重启IDEA