spring boot 配置remote 远程调试

当我们运行一个项目的时候,一般都是在本地进行debug。但是如果是一个分布式的微服务或者发布到远程服务器,这时候我们选择远程debug是我们开发的利器。

1、配置pom.xml

<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>
      <executable>true</executable>
   </configuration>
   <executions>
      <execution>
         <goals>
            <goal>repackage</goal>
         </goals>
      </execution>
   </executions>
</plugin>
 
 

2、远程服务器启动 spring boot  jar

 java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=5005,suspend=n -jar demo.jar


如上图表示启动成功

3、配置idea 连接远程调试 remote








启动成功就可以进行断点调试了

猜你喜欢

转载自blog.csdn.net/zhucegemingzizheng/article/details/79675919