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

Spring Boot 配置 IDEA和DevTools 热部署的方法

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

Spring Boot 配置 IDEA和DevTools 热部署的方法

MAVEN 配置



  4.0.0
  cn.globalrave
  bar-web
  0.0.1-SNAPSHOT
  jar
  bar-web
  Bar project for Spring Boot
  
    org.springframework.boot
    spring-boot-starter-parent
    1.5.6.RELEASE
     
  
  
    UTF-8
    UTF-8
    1.8
  
  
    
    
      com.github.sd4324530
      fastweixin
      1.3.15
    
    
    
      mysql
      mysql-connector-java
    
    
    
      org.mybatis.spring.boot
      mybatis-spring-boot-starter
      1.3.0
    
    
      org.springframework.boot
      spring-boot-starter-aop
    
    
      org.springframework.boot
      spring-boot-starter-cache
    
    
      org.springframework.boot
      spring-boot-starter-freemarker
    
    
      org.springframework.boot
      spring-boot-starter-web
    
    
      org.springframework.boot
      spring-boot-starter-websocket
    
    
    
      org.springframework.boot
      spring-boot-devtools
      runtime
    
    
      org.springframework.boot
      spring-boot-starter-test
      test
    
  
  
    
      
 org.springframework.boot
 spring-boot-maven-plugin
 
 
   true
 
      
    
  

 IDEA 配置

•CTRL + SHIFT + A 查找 勾选 make project automatically 选项

•ctrl+shift+alt+/ 查找Registry 勾选 compiler.automake.allow.when.app.running 选项

DevTools 配置

默认改变 /meta-INF/maven, /meta-INF/resources, /resources, /static, /public or /templates 等目录文件,会重新重启项目,当然我们编辑静态文件不想重启项目可以配置

spring.devtools.restart.exclude=static*Test.class,**/*Tests.class,git.properties # Patterns that should be excluded from triggering a full restart.
spring.devtools.restart.poll-interval=1000 # Amount of time (in milliseconds) to wait between polling for classpath changes.
spring.devtools.restart.quiet-period=400 # Amount of quiet time (in milliseconds) required without any classpath changes before a restart is triggered.
spring.devtools.restart.trigger-file= # Name of a specific file that when changed will trigger the restart check. If not specified any classpath file change will trigger the restart.
# REMOTE DEVTOOLS (RemoteDevToolsProperties)
spring.devtools.remote.context-path=/.~~spring-boot!~ # Context path used to handle the remote connection.
spring.devtools.remote.debug.enabled=true # Enable remote debug support.
spring.devtools.remote.debug.local-port=8000 # Local remote debug server port.
spring.devtools.remote.proxy.host= # The host of the proxy to use to connect to the remote application.
spring.devtools.remote.proxy.port= # The port of the proxy to use to connect to the remote application.
spring.devtools.remote.restart.enabled=true # Enable remote restart.
spring.devtools.remote.secret= # A shared secret required to establish a connection (required to enable remote support).
spring.devtools.remote.secret-header-name=X-AUTH-TOKEN # HTTP header used to transfer the shared secret.

总结

以上所述是小编给大家介绍的Spring Boot 配置 IDEA和DevTools 热部署的方法,希望对大家有所帮助,如果大家 有任何疑问欢迎给我留言,小编会及时回复大家的!

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

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

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