zoukankan      html  css  js  c++  java
  • spring boot+ Intellj idea devtools 设置热部署

    POM文件

    [html] view plain copy
     
    1. <!--添加依赖-->  
    2. <dependency>  
    3.     <groupId>org.springframework.boot</groupId>  
    4.     <artifactId>spring-boot-devtools</artifactId>  
    5.     <!-- optional=true,依赖不会传递,该项目依赖devtools;  
    6.     之后依赖该项目的项目如果想要使用devtools,需要重新引入 -->  
    7.     <optional>true</optional>  
    8. </dependency>  
    project增加
    
    
    [html] view plain copy
     
    1. <build>    
    2.     <plugins>    
    3.         <plugin>    
    4.             <groupId>org.springframework.boot</groupId>    
    5.             <artifactId>spring-boot-maven-plugin</artifactId>    
    6.             <configuration>    
    7.             <!--fork :  如果没有该项配置,可能devtools不会起作用,即应用不会restart -->    
    8.             <fork>true</fork>    
    9.             </configuration>    
    10.         </plugin>    
    11.     </plugins>    
    12. </build>    
    idea设置
    
    
    1.“File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Make project automatically” 
    
    
    2.组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running” 
    
    
    

    
    
    ctrl+shift+alt+/
    
    

    缓存配置



    1. application.properties

    [html] view plain copy
     
    1. spring.thymeleaf.cache=false  


    2. Chrome禁用缓存
    F12或者“Ctrl+Shift+I”,打开开发者工具,“Network” 选项卡下 选中打勾 “Disable Cache(while DevTools is open)” 。

  • 相关阅读:
    MySQL Show Processlist 整理
    由linkedin数据库泄漏引发的思考[转发]
    MySQL 严重 Bug 用户登陆漏洞[转发]
    关于博客的开始
    Linux共享库位置配置
    getopt详解
    git使用
    ArrayList读源码心得
    HashMap内部实现机制及优化第一篇
    如何才能做一个好网站系列 第三篇 最初的思路
  • 原文地址:https://www.cnblogs.com/gmq-sh/p/7727367.html
Copyright © 2011-2022 走看看