从零开始学SpringBoot笔记002(热部署)
来源:互联网 发布:win10系统自带优化 编辑:程序博客网 时间:2024/05/17 23:39
源码地址:http://download.csdn.net/download/u010503822/10020714
注明:该内容来自Andy讲师视频整理
springboot热部署
json转换时,忽略某字段
@JSONField(deserialize = false)
private String getRemark() {
- myeclipse下热部署配置
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <dependencies> <!-- spring热部署--> <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>
- 本包
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <dependencies> <!-- spring热部署--> <dependency> <groupId>org.springframework</groupId> <artifactId>springloaded</artifactId> <version>1.2.6.RELEASE</version> </dependency> </dependencies> </plugin> </plugins> </build>
3.支持外包
如果Application.java不在根目录下,或有多个入口,可以修改pom.xml如下配置指定入口文件:
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <dependencies> <!-- spring热部署--> <dependency> <groupId>org.springframework</groupId> <artifactId>springloaded</artifactId> <version>1.2.6.RELEASE</version> </dependency> </dependencies> <configuration> <mainClass>org.zemo.controller.Application</mainClass> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
4.配置devtools
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> <!-- 表示依赖不会传递 --> </dependency> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 --> </configuration> </plugin>
注意:
1. springboot对应版本和jdk、tomcat
2.eclipse project是否开启了build automatically
3.如果设置SpringApplication.setRegisterShutdownHook(false);将不起作用
阅读全文
0 0
- 从零开始学SpringBoot笔记002(热部署)
- 40. springboot + devtools(热部署)【从零开始学Spring Boot】
- 40. springboot + devtools(热部署)【从零开始学Spring Boot】
- 从零开始学SpringBoot笔记001(认识)
- 3. Spring Boot热部署【从零开始学Spring Boot】
- (3)Spring Boot热部署【从零开始学Spring Boot】
- 3. Spring Boot热部署【从零开始学Spring Boot】
- (3)Spring Boot热部署【从零开始学Spring Boot】
- java鬼混笔记:springboot 4、springboot热部署
- springboot-热部署
- SpringBoot热部署
- springboot实现热部署
- springboot热部署
- SpringBoot热部署配置
- SpringBoot+devtools 热部署
- Springboot(热部署)
- SpringBoot热部署
- SpringBoot+SpringLoaded热部署
- 两个数比较
- Codeforces Round #401 (Div. 2) D. Cloud of Hashtags
- ffmpeg下载安装的步骤
- Android——线程中的通信(一)
- PAT 乙级练习题1024. 科学计数法 (20)
- 从零开始学SpringBoot笔记002(热部署)
- HTTP Live Streaming(HLS)详解
- springmvc 异常001---在SpringMVC中使用@RequestBody注解处理json时,报出HTTP Status 415的解决方案
- MFC中使用任务栏显示图标表示程序最小化
- 简单的前端渲染模板实现
- 如何看懂照片的直方图
- ios下button input checkbox radio 默认样式去除
- 274. H-Index
- 通过ViewDragHelper实现下拉Drawer