Springboot项目热部署-Devtools

1.在pom.xml(如果是多模块,则此pom根据需要可设为具体模块)文件中添加

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

2.在pom.xml(如果是多模块,则此pom为父工程文件)加入插件

<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <configuration>
        <fork>true</fork>
        <addResources>true</addResources>
      </configuration>
    </plugin>
  </plugins>
</build>

3.IDEA设置自动编译

 

 4.在IDEA任意界面使用快捷键ctrl+shif+Alt+/打开如下菜单,点击第一个选项(1.Registry...)

选择后会出现如下子菜单,勾选compiler.automake.allow.when.app.running与actionSystem.assertFocusAccessFromEdt

5.重启IDEA。

猜你喜欢

转载自www.cnblogs.com/me-zzy/p/13174238.html