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:
-
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)
Spring interview questions (70 questions, the most complete in history)