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)” 。

  • 相关阅读:
    bzoj1202 狡猾的商人
    bzoj1059 矩阵游戏
    bzoj1003 物流运输
    bzoj1601 灌水
    2017-10-25模拟赛
    洛谷—— P1051 谁拿了最多奖学金
    BZOJ——1611: [Usaco2008 Feb]Meteor Shower流星雨
    2017-10-23学大伟业Day1
    BZOJ——1610: [Usaco2008 Feb]Line连线游戏
    Vijos 包裹快递(二分)
  • 原文地址:https://www.cnblogs.com/gmq-sh/p/7727367.html
Copyright © 2011-2022 走看看