SpringBoot 配置热部署
做个记录,以免忘记:
1. 在 pom.xml 文件中的 dependencies 标签以内添加组件 devtools,具体内容如下:
1 <!-- SpringBoot 热部署组件 devtools --> 2 <dependency> 3 <groupId>org.springframework.boot</groupId> 4 <artifactId>spring-boot-devtools</artifactId> 5 <scope>provided</scope> 6 <optional>true</optional> 7 </dependency>
2. plugins 标签以内添加组件 maven-plugin,具体内容如下:
1 <plugin> 2 <groupId>org.springframework.boot</groupId> 3 <artifactId>spring-boot-maven-plugin</artifactId> 4 <configuration> 5 <fork>true</fork> 6 </configuration> 7 </plugin>
然后就可以不用手动重新启动服务了,修改代码之后它会自动重启。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步