Spring boot 实现热部署(maven , Jrebel, idea, 本地服务器)
网上流传实现 Spring-boot热部署的方法大概有这么几种:
1.springgload
2.dev-tools
3.Jrebel
废话少说,配置开始(所有**文件均来源于网络)
------------------------------------------------------以下为安装-----------------------------------------------------------
一,Jrebel 的下载,由于这是一款收费软件(不想付费的可以进行**,下面为**教程,此处用的6.4.3版本,其他可以自行百度)
JRebel插件官网下载地址 : (下载6.4.3版本)
**插件 : (适用于6.4.3版本)
二,Jrebel 的安装(已安装其他版本的请卸载,不能卸载的升级以后再卸载)
二,Jrebel 的**
关闭idea,打开压缩包中的**文件夹,替换一个licence文件与两个jar包 :
1)、将本机 C:\Users\你的用户名\.JRebel\JRebel.lic替换为下载的补丁包里的 JRebel.lic;
2)、C:\Users\你的用户名\.IntelliJIdea2017.1\config\plugins\jr-ide-idea\lib\JRebel6\JRebel.jar
3)、C:\Users\你的用户名\.IntelliJIdea2017.1\config\plugins\jr-ide-idea\lib\JRebel\JRebel.jar
然后启动idea,在file->settings->plugins->JRebel中查看是否已显示**,**后显示valid,图标为绿色)
修改配置(到此完成)
------------------------------------------------------以下为配置-----------------------------------------------------------
一,
确保为war包
<packaging>war</packaging>
二.导入
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <version>1.5.1.RELEASE</version> <scope>provided</scope> </dependency>
三,修改启动类
@SpringBootApplication @ComponentScan public class ClaimApplication extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { return builder.sources(ClaimApplication.class); } public static void main(String[] args) { SpringApplication.run(ClaimApplication.class, args); } }
四,重新编译
五,配置tomcat
六,启动项目(配置完成)