I found the debugging behavior for both sonar-runner and sonar-scanner to be very erratic. (As in, successful sometimes but not always).
As mentioned above I was using Sonar-Runner/Sonar-Scanner version 2.8.
I use Windows 7 .
I do: set SONAR_RUNNER_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
and set SONAR_SCANNER_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
But then I dont always end up in debugging mode. I found this
post in SO talking about weird behavior with USER variables in Windows.
So the workaround for the issue is to set the System variables - whenever you want to debug.
Of course, one will have to delete the system variable after debugging is done.