debug springboot application

There are 2 ways if you run your application through command prompt.
1.    By default, the run goal runs your application in a process. If you need to debug your springboot application then you should add the necessary JVM arguments to enable remote debugging. 
<project>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>2.2.6.RELEASE</version>
        <configuration>
          <jvmArguments>
            -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
          </jvmArguments>
        </configuration>
        ...
      </plugin>
      ...
    </plugins>
    ...
  </build>
  ...
</project>
now run your mvn spring-boot:run command

2.  you can directly use below arguments on the command line as well, make sure to wrap that properly, that is:
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
SHARE

esant technology

0 comments :

Post a Comment