Intellij Idea中如何debug本地maven项目

方法一:使用maven中的jetty插件调试本地maven项目

1.打断点

2.右击“jetty:run”,选择Debug运行

3.浏览器发送http请求,开始调试

方法二:利用远程调试功能调试本地maven项目

使用远程调试功能调试本地程序,Server端和Client端都在本地运行

Server端

1.进入项目目录,运行server端,于指定端口监听

$ mvnDebug clean jetty:run -Poffline

Preparing to execute Maven in debug mode

Listening for transport dt_socket at address: 8000

Client端

配置

1.idea--->Run--→Edit Configurations,进入Run/Debug Configurations配置页

2.点击"+",添加Remote

2.运行Client端

点击Debug按钮

3.浏览器发送http请求,开始调试

参考资料

1.Idea远程调试

http://blog.sina.com.cn/s/blog_6af189790102wh6c.html

2.IntelliJ IDEA's Java Remote Debug(远程调试)

http://hane00.blog.163.com/blog/static/1600615220127952423971/

猜你喜欢

转载自blog.csdn.net/qq_36838191/article/details/85551925