• spring boot 热部署


    有两种方式:Devtools 和 SpringLoader

    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional> <!-- 这个需要为 true 热部署才有效(不加也好使)-->
    </dependency>

    回到idea正常界面,Mac使用快捷键shift+option+command+/,window上的快捷键是Shift+Ctrl+Alt+/,打开Registry,勾选

    compiler.automake.allow.when.app.runningcompiler.automake.allow.when.app.running

    <build>
    <plugins>
    <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <!--<configuration>-->(不加也好使)
    <!--<fork>true</fork> &lt;!&ndash;fork : 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart &ndash;&gt;-->
    <!--</configuration>-->
    </plugin>
    </plugins>
    </build>

    -----------------------------------------------------------------------------------------------------------------------------------
    SpringLoader->maven插件方式
    SpringLoader->lib方式
    springloader只能热部署后台代码
    devtools是自动重新部署。
  • 相关阅读:
    IDEA常用快捷键
    IDEA的使用
    IDEA的常用设置
    IDEA的下载安装
    004-解决多线程安全问题
    002-多线程的创建
    Java中字符串与日期之间的转换
    select标签的字体居中问题
    IntelliJ IDEA常用快捷键
    div小技巧之子元素垂直居中
  • 原文地址:https://www.cnblogs.com/hongchengshise/p/10508368.html
Copyright © 2020-2023  润新知