Fourth, Springboot Debug debugging

describe:

  When using the maven plugin to execute spring-boot:run to start, if the set breakpoint cannot be entered, the following settings must be made.

1. Add jvm parameter configuration

 

 

 

When using the maven plugin to execute spring-boot:run to start, if the set breakpoint cannot be entered, the following settings must be made.

1. Add jvm parameter configuration

Add jvmArguments configuration to the maven plugin of spring-boot.

<project>
 ...
 <build>
   ...
   <plugins>
     ...
     <plugin>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-maven-plugin</artifactId>
       <version>1.5.6.RELEASE</version>
       <configuration>
         <jvmArguments>
           -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
         </jvmArguments>
       </configuration>
       ...
     </plugin>
     ...
   </plugins>
   ...
 </build>
 ...
</project>

Or specify on the command line:

  1. mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"

2. Add remote debugging

Add a remote configuration in the development tool, such asdebug

Host: localhost

Port: 5005

To start the project first, and then start the debug, it is a little troublesome to start it twice. .

For details, please refer to the official description.

https://docs.spring.io/spring-boot/docs/current/maven-plugin/examples/run-debug.html

Recommended reading


 

Spring Boot internationalization support

Spring Boot automatic configuration principle, actual combat

Spring Boot features in action

Ali advanced Java interview questions (first issue, 70 questions, with detailed answers)

Interview questions and answers brought back by undercover agents sent to Ali, JD.com, Meituan, and Didi in 2017

Spring interview questions (70 questions, the most complete in history)

 

 

  Java technology stack  
WeChat public account: " Javastack "
Share Java dry goods, high concurrency programming, popular technical tutorials, microservices and distributed technology, architecture design, blockchain technology, artificial intelligence, big data, Java interview questions, and cutting-edge hot information.
 
 ▼Long press the QR code to follow us ↓↓↓

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325042412&siteId=291194637