zoukankan      html  css  js  c++  java
  • springboot与热部署

    在开发中我们修改一个Java文件后想看到效果不得不重启应用,这导致大量时间花费,我们希望不重启应用的情况下,程序可以自动部署(热部署)。有以下四种情况,如何能实现热部署。

    1.模板引擎:

    • 在Spring Boot中开发情况下禁用模板引擎的cache
    • 页面模板改变ctrl+F9可以重新编译当前页面并生效

    2.Spring Loaded:

    Spring官方提供的热部署程序,实现修改类文件的热部署

    • 下载Spring Loaded(项目地址https://github.com/spring-projects/spring-loaded)
    • 添加运行时参数; -javaagent:C:/springloaded-1.2.5.RELEASE.jar –noverify

    3.JRebel:

    • 收费的一个热部署软件
    • 安装插件使用即可

    4.Spring Boot Devtools(推荐):

        引入依赖:

    <dependency>  
           <groupId>org.springframework.boot</groupId>  
           <artifactId>spring-boot-devtools</artifactId>   
    </dependency> 

      idea环境下:使用ctrl+F9 即可达到效果

    Intellij IEDA和Eclipse不同,Eclipse设置了自动编译之后,修改类它会自动编译,而IDEA在非RUN或DEBUG情况下才会自动编译(前提是你已经设置了Auto-Compile)。

    • 设置自动编译(settings-compiler-make project automatically)
    • ctrl+shift+alt+/(maintenance)
    • 勾选compiler.automake.allow.when.app.running
  • 相关阅读:
    jmeter录制rabbitmq消息-性能测试
    plsqll连接Oracle的两种方式
    Badboy录制脚本时,提示脚本错误的解决方法
    Decorator
    PyObject and PyTypeObject
    Python LEGB (Local, Enclosing, Global, Build in) 规则
    Python Namespace
    Method Resolve Order (MRO)
    Source Code Structure
    Bound Method and Unbound Method
  • 原文地址:https://www.cnblogs.com/MagicAsa/p/10918946.html
Copyright © 2011-2022 走看看