spring boot: 热部署spring-boot-devtools
spring boot: 热部署spring-boot-devtools
1引入spring-boot-devtools依赖包
<!-- spring boot devtools 热部署 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>
2.部署spring boot devtool plugin
<!-- 这是spring boot devtool plugin -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--fork : 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart -->
<fork>true</fork>
</configuration>
</plugin>
部署完成。
参考pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>com.muyang</groupId>
<artifactId>boot1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging> <name>boot1</name>
<url>http://maven.apache.org</url> <!-- Inherit defaults from Spring Boot -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<!--<version>2.0.1.RELEASE</version>-->
</parent> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties> <dependencies> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!--
自动依赖parent里面的版本
<version></version>
-->
</dependency> <!-- dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency--> <!-- FastJson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.15</version>
</dependency> <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency> <!-- spring boot devtools 热部署 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency> </dependencies> <build>
<finalName>boot1</finalName>
<plugins> <!-- spring boot devtools的plugin -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--fork : 如果没有该项配置,呢个devtools不会起作用,即应用不会restart -->
<fork>true</fork>
</configuration>
</plugin> <!-- 在这里添加springloader plugin 热部署-->
<!-- <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.4.RELEASE</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>exec</classifier>
</configuration>
</execution>
</executions> </plugin>
--> </plugins>
</build> </project>
可以访问:http://localhost:8080/h4/getBook
然后新增:http://localhost:8080/h4/getDemo
spring boot: 热部署spring-boot-devtools的更多相关文章
- IDEA/JRebel实现内部/外部/远程Tomcat热部署Spring Boot
1 概述 所谓热部署,对于Java应用程序来说,就是在运行时更新Java类文件.IDEA可以使用自带的Spring Boot热部署的方式进行本地/远程热部署,或者使用JRebel进行本地/远程热部署, ...
- Spring Boot 系列(六)web开发-Spring Boot 热部署
Spring Boot 热部署 实际开发中,修改某个页面数据或逻辑功能都需要重启应用.这无形中降低了开发效率,所以使用热部署是十分必要的. 什么是热部署? 应用启动后会把编译好的Class文件加载的虚 ...
- spring boot: 热部署(一) run as – java application (spring-loader-1.2.4.RELEASE.jar)
spring boot: 热部署(一) run as – java application (spring-loader-1.2.4.RELEASE.jar) 如果使用的run as – java a ...
- Spring Boot 热部署(转)
Spring Boot 热部署 实际开发中,修改某个页面数据或逻辑功能都需要重启应用.这无形中降低了开发效率,所以使用热部署是十分必要的. 什么是热部署? 应用启动后会把编译好的Class文件加载的虚 ...
- Spring Boot热部署插件
在实际开发中,我们修改某些代码逻辑功能或页面都需要重启应用,这无形中降低了开发效率,热部署是指当我们修改代码后,服务能自动重启加载新修改的内容,而不需要重启应用,这样大大提高了我们开发的效率. Spr ...
- spring boot 热部署devtools实现
1.devtools spring为开发者提供了一个名为spring-boot-devtools的模块来使Spring Boot应用支持热部署,提高开发者的开发效率,无需手动重启Spring Boot ...
- spring boot 热部署devtools实现(成功,主要是添加依赖后配置setting)
1.devtools spring为开发者提供了一个名为spring-boot-devtools的模块来使Spring Boot应用支持热部署,提高开发者的开发效率,无需手动重启Spring Boot ...
- spring boot热部署devtools
1 pom.xml文件 注:热部署功能spring-boot-1.3开始有的 <!--添加依赖--> <dependency> <groupId>org.sprin ...
- 3,Spring Boot热部署
问题的提出: 在编写代码的时候,你会发现我们只是简单把打印信息改变了,就需要重新部署,如果是这样的编码方式,那么我们估计一天下来就真的是打几个Hello World就下班了.那么如何解决热部署的问题呢 ...
随机推荐
- [MongoDB] 安装MongoDB配置Replica Set
MongoDB的环境主要包括StandAlone,Replication和Sharding. StandAlone:单机环境,一般开发测试的时候用. Replication:主从结构,一个Primar ...
- 徐州网络赛J-Maze Designer【最小生成树】【LCA】
After the long vacation, the maze designer master has to do his job. A tour company gives him a map ...
- centos7 iptables/firewalld docker open port
here are multiple "hackish" ways to do it: scan kernel logs, as mentioned by Jiri (but you ...
- JS原生ajax
原文链接:http://caibaojian.com/ajax-jsonp.html 一.JS原生ajax ajax:一种请求数据的方式,不需要刷新整个页面: ajax的技术核心是 XMLHttpRe ...
- android的一些类库的优缺点
经过本人的面试经验,以及接触的android项目,总结了一下android的一些类库的优缺点: 一,线程方面 1.AsyncTask 首先是线程优化以及缺陷方面,针对目前大多数类库来说,都有好的设计方 ...
- 转!!mysql 字段 is not null 和 字段 !=null
今天在查询数据时,查到包含一条某个时间startTime(该字段默认为null ) 为null的记录,想把它过滤,加了 startTime != null 的条件,结果记录都没了,应该用条件 is ...
- Caocao's Bridges---hdu4738(桥)
http://acm.hdu.edu.cn/showproblem.php?pid=4738 题就是求出所有的桥,然后输出桥的权值的最小值. 如果一开始是不连通的,输出0. 图有重边,需要处理, 不能 ...
- 少走冤枉路!带你走过SNMP的那些坑
SNMP(Simple Network Management Protocol)即简单网络管理协议,是在网络与系统监控领域中,最常使用的一种数据采集技术.尽管这个协议非常简单,但在大规模IT环境监测中 ...
- Python性能分析指南(未完成)
英文原文:http://www.huyng.com/posts/python-performance-analysis/ 译文:http://www.oschina.net/translate/pyt ...
- 模块讲解----反射 (基于web路由的反射)
一.反射的实际案例: def main(): menu = ''' 1.账户信息 2.还款 3.取款 4.转账 5.账单 ''' menu_dic = { ':account_info, ':repa ...