一:热部署的实现

  • 1.使用Spring-boot-devtools
  • 2.使用Spring Loaded

二:devtools(推荐)

一般情况下直接在pom.xml文件添加下面的依赖即可,但eclipse和IDEA有时也会造成影响。

        <!-- 热部署 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>

如下配置,可有可无:

#热部署生效
spring.devtools.restart.enabled=true
#设置重启的目录,添加那个目录的文件需要restart
spring.devtools.restart.additional-paths=src/main/java
# 为mybatis设置,生产环境可删除
restart.include.mapper=/mapper-[%%w-%%.]+jar
restart.include.pagehelper=/pagehelper-[%%w-%%.]+jar
#排除那个目录的文件不需要restart
#spring.devtools.restart.exclude=static/**,public/**
#classpath目录下的WEB-INF文件夹内容修改不重启
#spring.devtools.restart.exclude=WEB-INF/**

三:Spring Loaded

1.Maven启动方式,添加依赖

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>springloaded</artifactId>
            <veision>1.2.6.RELEASE</version>
        </dependency>

需要以maven方式启动

执行mvn spring-boot:run命令

2.run as - Java application

需要下载该Jar包,右击运行配置

SpringBoot热部署的实现方式的更多相关文章

  1. SpringBoot"热"部署解决方案

    作者:故事我忘了¢个人微信公众号:程序猿的月光宝盒 SpringBoot热部署两种方式 1.SpringLoader 插件 ​ 缺点: Java 代码做部署处理.但是对页面无能为力. 2.DevToo ...

  2. SpringBoot热部署的两种方式

    SpringBoot热部署方式一共有两种,分别使用两种不同的依赖 SpringBoot 1.3后才拥有SpringBoot devtools热部署 ①:spring-boot-devtools   ② ...

  3. SpringBoot(六):springboot热部署

    在j2ee项目开发中,热部署插件是JRebel.JRebel的使用为开发人员带来了极大的帮助,且挺高了开发便捷.而在SpringBoot开发生态环境中,SpringBoot热部署常用插件是:sprin ...

  4. 【SpringBoot】SpringBoot热部署和配置文件自动注入实战

    ========================3.SpringBoot热部署devtool和配置文件自动注入实战 ============================ 1.SpringBoot2 ...

  5. SpringBoot热部署配置(基于Maven)

    热部署的意思是只要类中的代码被修改了,就能实时生效,而不用重启项目.spring-boot-devtools 是一个为开发者服务的一个模块,其中最重要的功能就是自动应用代码更改到最新的App上面去.原 ...

  6. idea配置SpringBoot热部署之自动Build

    一.pom.xml文件导入所需依赖文件 SpringBoot热部署插件 <dependency> <groupId>org.springframework.boot</g ...

  7. idea中设置springboot热部署

    在idea中设置springboot热部署,项目修改的时候不用手动重启应用 1,pom中添加依赖 <dependency> <groupId>org.springframewo ...

  8. Springboot 热部署中存在冲突的问题

    SpringBoot热部署有2中: 1.使用 Spring Loaded 2.使用 spring-boot-devtools 具体怎么用.自己百度! 在使用第一种时候,整合SpringBoot和通用M ...

  9. SpringBoot热部署报错(BeanCreationException: Error creating bean with name 'classPathFileSystemWatcher' d)

    springboot热部署配置方法 http://blog.csdn.net/pyfysf/article/details/78791292 异常信息如下 org.springframework.be ...

随机推荐

  1. JHipster技术栈理解 - UAA原理分析

    本文简要分析了UAA的认证机制和部分源码功能. UAA全称User Account and Authentication. 相关源码都是通过Jhipster生成,包括UAA,Gateway,Ident ...

  2. MyBatis笔记----报错:Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)解决方法

    报错 Exception in thread "main" org.apache.ibatis.binding.BindingException: Invalid bound st ...

  3. myBase7.0破解

    永久性破解 Mybase7Pro破解版下载:链接:https://pan.baidu.com/s/1ezb8bSqI0OPZnVgx-snA_Q  提取码:n72t 1.下载后安装 myBase-De ...

  4. c/c++赋值函数(重载=号运算符)

    c/c++赋值函数(重载=号运算符) 首先c++里的各种运算符都是用函数实现的,比如=,就等号函数. 所以当用=给一个对象赋值的时候,实际调用的是=号所对应的=号函数. 分析下面的代码 #includ ...

  5. 搭建windows测试环境的步骤

     步骤:1.JDK安装 2.配置好JDK环境变量3.Tomcat安装4.将war包放在Tomcat的发布目录中webapps中,5.conf>server.xml里面设置默认解压,unpackW ...

  6. {windows故障}关于WIN7故障模块StackHash_0a9e解决方法

    问题背景:我给同事重装好系统后,想用驱动精灵(网卡版)给新系统安装驱动,但是在安装驱动精灵的过程中老是出现标题的问题,windows停止工作,导致无法安装,最后看到这两个方法后,把网络适配器禁用,然后 ...

  7. Linux for python教程02

    目录 1. Linux用户及权限管理 1.1. who 1.2. 查看当前用户: whoami 1.3. 添加用户账号: useradd 1.4 切换用户 su 2.用户组 3. 修改文件权限: ch ...

  8. Django admin注册model究竟要怎么写才优雅

    比如在Django admin 注册models时,会用到. 对于APP里自带的models,可以使用这种方式注册. from django.contrib import admin # Regist ...

  9. Nginx使用教程(八):使用Nginx缓存之Memcached缓存

    使用Memcache <br\>Memcache是一个通用的内存缓存系统. 它通常用于加速缓慢的数据访问. NGINXmemcached模块提供各种指令,可以配置为直接访问Memcache ...

  10. 解决Go依赖包安装问题

    最近在学习Go编写后端服务,先放出谢大的书镇楼: https://github.com/astaxie/build-web-application-with-golang/blob/master/zh ...