This version is outdated by a newer approved version.DiffThis version (2014/11/08 14:16) was approved by alex.

This is an old revision of the document!


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.