SpringBoot热部署

本篇所谓的 SpringBoot热部署,是为了代码修改,命令行的mvn spring-boot:run能够自动发布、重启。


操作要点:修改配置文件pom.xml,仅下面2步即可

1、在依赖包中增加devtools引用

[html]  view plain  copy
  1. <dependency>  
  2.     <groupId>org.springframework.bootgroupId>  
  3.     <artifactId>spring-boot-devtoolsartifactId>  
  4.     <optional>trueoptional>  
  5. dependency>  
2、在build的plugins增加springloaded插件

[html]  view plain  copy
  1. <build>  
  2.     <plugins>  
  3.         <plugin>  
  4.             <groupId>org.springframework.bootgroupId>  
  5.             <artifactId>spring-boot-maven-pluginartifactId>  
  6.             <dependencies>  
  7.                   
  8.                 <dependency>  
  9.                     <groupId>org.springframeworkgroupId>  
  10.                     <artifactId>springloadedartifactId>  
  11.                     <version>1.2.6.RELEASEversion>  
  12.                 dependency>  
  13.             dependencies>  
  14.         plugin>  
  15.     plugins>  
  16. build>  

你可能感兴趣的:(spring-boot)