idea下的spring boot remote debug 啟動辦法
阿新 • • 發佈:2019-01-05
最近做個spring boot的專案,因為涉及到dubbo,採用的是
spring-boot:run 啟動的工程
下面的圖那個樣子
需要在pom.xml使用這個plugins
<plugins> <!-- 1、使用parent,打包: mvn package--> <!-- 2、使用依賴,打包: mvn package spring-boot:repackage --> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <!--允許linux上註冊服務--> <configuration> <jvmArguments> -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 </jvmArguments>
<executable>true</executable> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins>
啟動後出現:
Listening for transport dt_socket at address: 5005
就一直不動了。
然後配置idea的debug
除了上面的名字改成debug外 什麼也不用改
然後再點選這個小蟲子。
好了就可以斷點了。