Sonarqube从哪里收集数据? [英] Where does Sonarqube collects data from?

查看:258
本文介绍了Sonarqube从哪里收集数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天,我正在配置一个詹金斯作业以在我的Java项目上运行声纳。我在工作中配置了声纳和jacoco插件。 Sonar抛出一些错误,我的系统管理员要求我从工作中删除jacoco插件配置。我删除了,现在声纳说它找不到cobertura.xml。
因此,我很想知道声纳是否对已经运行的jacoco或cobertura任务进行分析,或者是否运行自己的覆盖率分析?

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?

推荐答案

简短的回答:通常,通过阅读在sonarQube进行任何工作之前生成的覆盖率报告,将覆盖率导入SonarQube。

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

更长的答案:从历史上看(大约两年前),SonarQube曾经尝试运行Java的coverage工具。对于每个用例而言,这都是一场噩梦,因此现在由开发人员负责向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).

在您的情况下,这意味着您很可能在您的SQ实例上安装了cobertura插件,并且它正在寻找要导入的报告。

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.

这篇关于Sonarqube从哪里收集数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆