• SpringBoot通过devtools实现热部署


    1. 在项目的pom.xml文件添加如下两段

    2. <dependency>  

                  <groupId>org.springframework.boot</groupId>  

                  <artifactId>spring-boot-devtools</artifactId>

                  <version>1.5.7.RELEASE</version>

                  <optional>true</optional>  

      </dependency> 

      SpringBoot通过配置devtools实现热部署

    3. <plugin>  

                      <groupId>org.springframework.boot</groupId>  

                      <artifactId>spring-boot-maven-plugin</artifactId>  

                      <configuration>  

                          <fork>true</fork>

                          <addResources>true</addResources>  

                      </configuration>  

      </plugin> 

      SpringBoot通过配置devtools实现热部署

    4. 如果使用的是Intellij IEDA开发工具,还需要到设置里将project automatically勾选上;File->Setting->Build,…->Compiler  将右侧project automatically勾上

      SpringBoot通过配置devtools实现热部署

    5. Intellij IEDA 使用ctrl+shift+a 快捷键搜索Registry,选择搜索出来的第一个

      SpringBoot通过配置devtools实现热部署

    6. 找到compiler.automake.allow.when.app.running,勾上开启此功能即可

      SpringBoot通过配置devtools实现热部署

    7. 7

      此时重新启动项目即可实现热部署,改动任意代码会立即生效,不用再每次重新启动项目

  • 相关阅读:
    迷宫寻宝(自编简单版)
    推荐一个免费翻译接口
    nyoj 82
    poj 3984
    Suffix Tree(后缀树)
    python turtle模块绘图
    python continue语句
    python break语句
    pycharm永久破解激活码
    python while死循环
  • 原文地址:https://www.cnblogs.com/BoKe-LY/p/11847129.html
Copyright © 2020-2023  润新知