美文网首页
Spring Boot 热启动/热部署(二)

Spring Boot 热启动/热部署(二)

作者: GitCode8 | 来源:发表于2019-11-28 22:34 被阅读0次

一、配置Maven

  1. 在Mavent添加依赖:
<dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-devtools</artifactId>
      <optional>true</optional>
</dependency>
  1. 添加插件
<plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <configuration>
            <fork>true</fork>
      </configuration>
</plugin>

二、配置idea环境

  1. 打开idea的Setting->Compiler,勾选 Build project automatically
  2. 打开Maintenance界面(MAC快捷键:shift+option+command+/;Window快捷键:Alt+Ctrl+shift+a+/ Alt+shift+a或),选择第一个。


  3. 打开Registry界面,并勾选compiler.automake.allow.when.app.running
  4. 到此即开始生效,每次修改代码,不需要再停止和运行项目,会自动生效(可能会延迟,代码save一下)。如果没有生效,重启idea看看。

相关文章

网友评论

      本文标题:Spring Boot 热启动/热部署(二)

      本文链接:https://www.haomeiwen.com/subject/fvviwctx.html