Where does Sonarqube collects data from?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-07 03:07:20

问题


Last day I was configuring a jenkins job to run sonar on my java project. I had sonar and jacoco plugins configured in my job. Sonar was throwing some error for which my sysadmin asked me to remove the jacoco plugin configuration from job. I removed and now sonar is saying it cannot find cobertura.xml. So I am curious to know if sonar does analysis on already run jacoco or cobertura task or does it runs its own coverage analysis?


回答1:


Short answer : In general, coverage is imported to SonarQube by reading a coverage report generated prior to any work of sonarQube.

Longer answer : Historically (read, about two years ago), SonarQube used to try to run coverage tool for java. This was a nightmare to maintain for every use cases and as such it is now up to the developers to provide a coverage report to SonarQube which will only act on those data (linking them to source, compute metrics, display them nicely).

In your case, that means you most probably have the cobertura plugin installed on your SQ instance and it is looking for a report to import.



来源:https://stackoverflow.com/questions/35238325/where-does-sonarqube-collects-data-from

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!