IDEA springboot项目配置热部署

1.导入需要的依赖,以及在打包插件中添加配置(不确定是否需要这个配置,没有好像也行)

org.springframework.boot spring-boot-devtools true
      <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>-->
            &lt;!&ndash; 如果没有该项配置,devtools不会起作用,即应用不会restart &ndash;&gt;
          <fork>true</fork>
        </configuration>
     </plugin>

2.在aplication.properties中配置(后来发现不配置也行)

热部署生效

spring.devtools.restart.enabled=true

设置重启目录

spring.devtools.restart.additional-paths=src/main/java/

classpath目录下的WEB-INF文件内容修改不重启

spring.devtools.restart.exclude=static/**

3.勾选设置中的选项

版本不同的可能没这个选项,需要ctrl+shift+alt+/ 弹窗选择Registry项
找到


勾选build project automatically

posted @ 2022-04-02 11:14  别停  阅读(82)  评论(0)    收藏  举报