zoukankan      html  css  js  c++  java
  • SpringBoot实战(三)代码热部署

     每次代码改动后都需要重新手动Run项目,心累,在网上找了下,发现SpringBoot提供了热部署的方案,改动代码后自动编译打包,现在将热部署的配置方法记下来:

    第一步:在pom.xml中添加依赖,导入spring-boot-devtools

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

    第二步:在Intellij编辑器中选择File->Setting->Build,Execution,Deployment->Compiler,勾选【Build project automatically】

    第三步:通过快捷键Ctrl+Alt+Shift+/  ,进入Intellij的Registry配置中,将【compiler.automake.allow.when.app.running】勾选

    到这里就大功告成,测试了一下,修改了代码以后,等待两秒钟,SpringBoot会重新编译加载代码,免去手动编译的烦恼。

  • 相关阅读:
    Loj #6560 小奇取石子
    某谷 P5153 简单的函数
    某谷 P5159 WD与矩阵
    前端ajax访问 django 报错 POST http://127.0.0.1:8001/xxx 403 (Forbidden)
    python
    Java
    Java
    Java
    Java
    java web 向数据库插入中文数据乱码问题
  • 原文地址:https://www.cnblogs.com/anywherego/p/9603710.html
Copyright © 2011-2022 走看看