本篇所谓的 SpringBoot热部署,是为了代码修改,命令行的mvn spring-boot:run能够自动发布、重启。
操作要点:修改配置文件pom.xml,仅下面2步即可
1、在依赖包中增加devtools引用
[html] view plain copy <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency> 2、在build的plugins增加springloaded插件
[html] view plain copy <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>