If the breakpoint cannot be set when spring-boot:run is executed using maven, set the following parameters.
1. Add JVM parameter configuration
Add jvmArguments configuration to Spring-Boot’s Maven plugin.
<project> ... <build> ... <plugins> ... <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> The < 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>Copy the code
Or specify on the command line:
mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
Copy the code
2. Add remote debugging
Add a remote configuration to the development tool, such as debug
Host: localhost
Port: 5005
You u need to start the project first, and then start debug.
Please refer to the official instructions for details.
Docs. Spring. IO/spring – the boot…
Recommended reading
Dry goods: 2TB architect four-stage video tutorial
Interview: the most complete Java multithreaded interview questions and answers
Interview: the most comprehensive ali advanced Java interview questions in history
Interview: The most complete Spring interview questions in history
Tutorial: The most complete Spring Boot complete video tutorial
Books: 15 must-read books for advanced Java architects
Tools: Recommended an online creation flow chart, mind mapping software
Share Java dry goods, high concurrency programming, hot technology tutorials, microservices and distributed technology, architecture design, blockchain technology, artificial intelligence, big data, Java interview questions, and cutting-edge hot news.