微服务 springboot热部署
微服务 springboot热部署
- 微服务 springboot热部署
- 一、概念
- 二、配置
- 1.Adding devtools to your project
- 2.Adding plugin to your pom.xml
- 3.Enabling automatic build
- 4.Update the value of
- 5.重启IDEA
- 6.验证
微服务 springboot热部署
一、概念
spring-boot-devtools就是为了每次修改代码而不需要手动重启而节约时间,提高开发效率。
spring的devtools实质不是一个真正的热部署工具,它是通过每次修改代码自动重新编译打包。
真正热部署工具官方推荐JRebel。
二、配置
1.Adding devtools to your project
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
2.Adding plugin to your pom.xml
下一段配置黏贴到父工程当中的pom里
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
3.Enabling automatic build
设置idea自动编译
4.Update the value of
自动编译设置快捷键:Ctrl+Shift+Alt+/
5.重启IDEA
6.验证
Run Dashboard中的项目后缀都带[devtools]
每次修改代码之后自动编译。
还没有评论,来说两句吧...