官术网_书友最值得收藏!

Remote debugging

For a developer, remote debugging is a must-have feature for any build system. Why do we need remote debugging for a build system? This is extremely useful when you run your tests through the build itself. If any of the tests fail during the build, you should be able to debug and pinpoint the problem. The following command will run Maven in the debugging mode:

$ mvn clean install -Dmaven.surefire.debug

When the build starts to execute tests, it will be paused to connect with an IDE. You can connect Eclipse, NetBeans, or your favorite IDE to port 5005 in order to start remote debugging. By default, Maven opens up port 5005 for remote debugging.

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Listening for transport dt_socket at address: 5005

The default listening port number can be changed by setting the value of address appropriately. When you set the value of the suspend variable to y, the Maven build will stop until an IDE gets connected to it. If you want the build to continue and connect the IDE later, then set the value to n. To get full control over the debugging options, you can use the following command:

$ mvn clean install -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE"

Note

Refer to the corresponding IDE documentation to see how it can be remotely connected to an externally running process for remote debugging.

主站蜘蛛池模板: 平南县| 天柱县| 张家界市| 大英县| 景泰县| 黄陵县| 佛山市| 马边| 荆州市| 黎城县| 昌都县| 惠州市| 普兰店市| 读书| 新建县| 柘城县| 咸阳市| 合肥市| 蓬溪县| 元谋县| 海兴县| 青浦区| 寿宁县| 竹溪县| 叙永县| 阜康市| 巩留县| 武功县| 五指山市| 东乡族自治县| 武山县| 高陵县| 大荔县| 广昌县| 柳林县| 虎林市| 顺义区| 塔城市| 田东县| 唐河县| 宁武县|