栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Intellij IDEA实现springboot热部署过程解析

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Intellij IDEA实现springboot热部署过程解析

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

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

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

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

接着开始配置pom.xml文件



  org.springframework.boot
  spring-boot-devtools
  true




  
  
   org.springframework.boot
   spring-boot-maven-plugin
   
     
     true
   
  


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/**

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

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/132165.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号