糖尿病康复,内容丰富有趣,生活中的好帮手!
糖尿病康复 > 【springboot】spring-boot-devtools 热部署 导致 mvn spring-boot:run 出现异常

【springboot】spring-boot-devtools 热部署 导致 mvn spring-boot:run 出现异常

时间:2024-05-06 21:50:25

相关推荐

【springboot】spring-boot-devtools 热部署 导致 mvn spring-boot:run 出现异常

前言

- spring boot 2.0.0.RELEASE

操作

<dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><optional>true</optional></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><fork>true</fork></configuration></plugin></plugins></build>

此处要特别提到fork参数。该参数的说明:

Flag to indicate if the run processes should be forked. Disabling forking will disable some features such as an agent, custom JVM arguments, devtools or specifying the working directory to use.

Default value is: true.

User property is: spring-boot.run.fork.

Since: 1.2.0

虽然不明觉厉,但是还真碰到了需要该参数的情况。

在一个项目中发现():mvn spring-boot:run启动项目屡次失败。最后发现,将pom.xml中的spring-boot-devtools去掉就可以启动了。来回添加、去掉spring-boot-devtools还是很麻烦的。将fork这个参数设置成false,就不用来回添加、去掉spring-boot-devtools了。

如果觉得《【springboot】spring-boot-devtools 热部署 导致 mvn spring-boot:run 出现异常》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。