• 在SpringBoot中使用热部署(DevTools)


    一、简介

      有时候我们开发完SpringBoot项目后,启动运行。但是经常发现代码需要反复修改,然后修改部分内容后需要再启动....这样太费时了,热部署就是用来解决这一问题。让你修改完代码后,能自动执行编译并运行。

    二、工具

      IntelliJ IDEA、SpringBoot 2.0.4

    三、步骤

      1、创建正常SpringBoot的Maven项目

      2、在需要热部署的项目中(或者在全局父Maven模块中)加入DevTools

      

        <dependencies>
            <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-devtools</artifactId>
                <version>2.0.4.RELEASE</version>
            </dependency>
    
        </dependencies>

      

      3、依次点开菜单 【File】-【Settings】-【Build,Execution,Deployment】-【Compiler】-勾选右侧的【Build project automatically】

      

      4、按下Ctrl+Shift+A,打开搜索,输入registry,并打开搜索到的该项设置。

      

      5、找到compiler.automake.allow.when.app.running项,并打勾。

      

      6、最重要的一步:重启IEDA。

      

  • 相关阅读:
    ubuntu 14.04 (desktop amd 64) 下载
    ubuntu16.04 server(amd 64) 下载
    vim/vi中移动光标键会变成A,B,C,D的解决办法
    ubuntu 14.04(desktop amd 64) nginx 安装启动停止
    ubuntu-server14.04 网络配置
    selenium-chrome-headless
    selenium-firefox-headless
    哈希表-java
    冒泡排序-java
    wc的使用
  • 原文地址:https://www.cnblogs.com/songxingzhu/p/9635264.html
Copyright © 2020-2023  润新知