mvnDebug sonar:sonar and attach your IDE to the remote process. Example in Intellij Idea: Run > Edit configurations > Add new configuration > Remote.
Debug a plugin
- Unzip a sonar distribution
- Edit the conf/wrapper.conf file and uncomment the line : wrapper.java.additional.3=-agentlib:jdwp=transport=dt_socket,server=y,address=8000
- Copy your plugin's jar file to extensions/plugins
- Launch SonarQube with the standard command. The following line will appear in the log : Listening for transport dt_socket at address: 8000
- Attach the IDE to the debug process on port 8000
- Set breakpoints in the source code
How to Use External Libraries?