no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


Previous revision
Next revision
vertx:debug [2022/01/09 11:07] – old revision restored (2022/01/08 05:52) 85.25.185.238
Line 1: Line 1:
 +=== Debugging vert.x applications with Eclipse ===
 +
 +(Please note that this description applies to vert.x 2.1.x)
 +
 +When debugging vert.x applications inside Eclipse, I could get breakpoints to work when starting a unit test in Eclipse with Debug as Junit, but for some reason I couldn't put any breakpoints when running the complete application with a maven task (even though this supports Debug as as well).
 +
 +The group suggested using mvnDebug (actually that was Tim I think), which supports running a maven build with the debug listener option in the JVM so that it is possible to attach from Eclipse or another IDE to the process.
 +
 +In the case of vert.x, the command to run the program is (in a command window or terminal)
 +
 +    mvnDebug vertx:runMod
 +
 +this will not do anything except starting maven with the debug listener on port 8000 until a debug process attaches.
 +
 +In Eclipse inside your maven project, add a Debug configuration for Remote Java Application using host localhost and port 8000, you should probably call it yourprojectname (debug) or something similar, the default names just add a counter, which is not very useful.
 +
 +Now you can start debugging by selecting Debug configurations and then your project name (for some reason this is not showing up in the list under Debug As, I have not found out why) and the maven build will start in the command window.
 +
 +If you have set a breakpoint in the Verticle code, it will stop there when the build process is reaching the execution of the vertx-maven-plugin and you can continue from there.
 +