【springboot】spring-boot-devtools 热部署 导致 mvn spring-boot:run 出现异常
生活随笔
收集整理的這篇文章主要介紹了
【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 出现异常的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 扁桃体发炎能吃什么水果
- 下一篇: GSON反序列化时,字符串被转换成科学记