Fixing sonar-runner error - Can not add twice the same measure

Sometimes, when running sonar-runner to compile the results of a Jenkins build into measurable data for a SonarQube dashboard for a project, I get the following errors, and execution stops before the data is sent to the central sonar server:

ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Can not add twice the same measure on org.sonar.api.resources.File...

I was looking into what causes this issue, and couldn't find much via Google. However, just running sonar-runner again, without changing anything or modifying anything, seems to let sonar succeed.

I'll update this post if I ever figure out what might be causing the 'twice the same measure' error, but for now, just run sonar-runner again if you ever bump into this error message :)

I'll be posting more about how to use Sonar + Jenkins + Phing to do some pretty awesome Drupal and PHP code analysis and deployments in future blog posts—stay tuned!


Sheesh. Just like on Stack Overflow, I seem to find my own blog posts when I have issues and do Google searches. #firstworldproblems