Hudson looks at the system property "hudson.maven.debugPort" and if this is set, every managed Maven process is launched with this port as the debugger port. Therefore, if you run
mvn -Dhudson.maven.debugPort=5001 hpi:run, then you can start a build normally from Hudson, then attach a debugger to port 5001 to see what's going on inside the managed Maven process.
If the plugin doesn't show up in the UI, run
mvn clean hpi:run to force the regeneration of the Jelly bindings.
Eclipse users might separate Eclipse generated classes by running
mvn -DdownloadJavadocs=true -DoutputDirectory=target/eclipse-classes eclipse:eclipse when generating configuration.
Debug jobs selectively
The previous approach causes every job to launch with the debugger port, but you can also selectively enable the debugger support. This can be even used on the production system, and therefore very handy if you need to trouble-shoot a problem in a live system.