Spring Boot 揭秘與實戰(八) 發布與部署 - 遠程調試
阿新 • • 發佈:2017-07-27
hat artifact pom.xml href span 發布 作者 elf ava
如果覺得我的文章對你有幫助,請隨意打賞。
文章目錄
- 1. 依賴
- 2. 部署
- 3. 調試
- 4. 源代碼
設置遠程調試,可以在正式環境上隨時跟蹤與調試生產故障。
依賴
在 pom.xml 中增加遠程調試依賴。
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <configuration>
- <jvmArguments>
- -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
- </jvmArguments>
- </configuration>
- </plugin>
- </plugins>
部署
部署時,執行相關命令。
- java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -jar dev-0.1.jar
調試
在本地 Eclipse 管理界面,鼠標雙擊 Run 按鈕,選擇 Debug Configurations 進行配置。
運行後,即可進行遠程調試。
源代碼
相關示例完整代碼: springboot-action
(完)
如果覺得我的文章對你有幫助,請隨意打賞。
- 版權聲明:本文由 梁桂釗 發表於 梁桂釗的博客
- 轉載聲明:自由轉載-非商用-非衍生-保持署名(創意共享3.0許可證),非商業轉載請註明作者及出處,商業轉載請聯系作者本人。
- 文章標題:Spring Boot 揭秘與實戰(八) 發布與部署 - 遠程調試
- 文章鏈接:http://blog.720ui.com/2017/springboot_08_remote_debug/
Spring Boot 揭秘與實戰(八) 發布與部署 - 遠程調試