zoukankan      html  css  js  c++  java
  • Intellij IDEA 实现springboot热部署

    对于springboot热部署貌似是这样的,首先要设置idea相关配置

    导航栏 File -> Settings -> Build,Execution,Deployment -> Compiler 选择Build project automatically 打勾 如下图所示

    接着 Ctrl+Shift+Alt+/ 快捷键选择Registry会弹出如下图

    在红色选择的一行打勾,就完成了这步骤。

    接着开始配置pom.xml文件

    .....
    <
    dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional>
    </dependency>
    </
    dependencies>
    <build>
    <plugins>
    <!-- springboot maven plugin -->
    <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
    <!--fork : 如果没有该项配置,肯定devtools不会起作用,即应用不会restart -->
    <fork>true</fork>
    </configuration>
    </plugin>
    </plugins>

    </build>
    
    

    pom文件也配置好了,就开始配置application.yml (或者 application.properties)

       #THYMELEAF
     spring:
        thymeleaf:
          cache: false #这里一定要设置false 
          prefix: classpath:/thymeleaf/
          suffix: .html
          mode: HTML5
          encoding: UTF-8
    devtools:
        restart:
          #热部署生效true
          enabled: true
       #设置重启的目录
       additional-paths: resources/**,static/**,templates/**
          #该目录下的内容修改不重启
      exclude: data/**

    配置完之后,基本上就可以运行了,还有最后要记得浏览器要设置 禁止缓存

     

    以上就是springboot热部署的流程,希望对大家有所帮助!

  • 相关阅读:
    从12306.cn谈大网站架构与性能优化
    新浪微博的存储思路整理架构分享--微博架构的回顾
    多吃以上食物可以调理内分泌
    脸部护理
    美容实用小知识
    如何把网页或html内容生成图片
    互联网阅读与知识积累流程化实践分享
    怎样与人沟通?
    如何控制情绪
    如何去掉Google搜索的跳转 让你的Google搜索不被reset掉
  • 原文地址:https://www.cnblogs.com/zrl66/p/11423599.html
Copyright © 2011-2022 走看看