简体   繁体   English

Jenkins Sonar插件如何与SonarQube集成?

[英]How does the Jenkins Sonar plugin integrate with SonarQube?

I'm trying to understand the overall architecture and flow of the Jenkins Sonar plugin and SonarQube. 我试图了解Jenkins Sonar插件和SonarQube的总体架构和流程。

When I run the Jenkins Sonar plugin, is the plugin doing the analysis and then sending the reports to SonarQube? 当我运行Jenkins Sonar插件时,该插件会进行分析,然后将报告发送到SonarQube吗? Or does the plugin forward the code to SonarQube for the analysis to be done on the SonarQube server? 还是插件将代码转发给SonarQube以便在SonarQube服务器上进行分析?

And how does FindBugs integrate in this process? FindBugs如何在此过程中集成?

In recent weeks, our bugs and code smells reporting have been broken (showing 0) and I'm trying to get a better understanding of the general system flow so I know where I should be focusing my efforts. 最近几周,我们的错误和代码气味报告已损坏(显示0),我试图更好地理解常规系统流程,因此我知道我应该集中精力进行工作。

I haven't implemented SonarQube, but have played with it on my local workstation off and on for the past year or so and it is my understanding that the Scanner/Plugin does the analysis and sends the report to the SonarQube server. 我还没有实现SonarQube,但是在过去的一年左右的时间里,我一直在本地工作站上运行它,据我了解,Scanner / Plugin会进行分析并将报告发送到SonarQube服务器。 From SonarQube site: SonarQube网站:

3. The Continuous Integration Server triggers an automatic build, and the execution of the SonarQube Scanner required to run the SonarQube analysis.
4. The analysis report is sent to the SonarQube Server for processing.
5. SonarQube Server processes and stores the analysis report results in the SonarQube Database, and displays the results in the UI.

As far as Findbugs, it is also my understanding that you would no longer really need to use Findbugs. 就Findbugs而言,据我了解,您将不再真正需要使用Findbugs。 But you could if you want to. 但是,如果您愿意,您可以。 I am guessing SQ isn't implementing 100% of what FindBugs does, but should have the most common rules in place. 我猜SQ并没有实现FindBugs的100%,但是应该有最常见的规则。 If/When I implement SonarQube, I would no longer use checkstlye/findbugs. 如果/当我实现SonarQube时,我将不再使用checkstlye / findbugs。 If all developers install SonarLint, and you configure the IDEs to read from the SonarQube project settings, everyone would be playing by the same sets of rules, versus relying on developers to configure using the same checkstyle/findbugs settings. 如果所有开发人员都安装了SonarLint,并且将IDE配置为从SonarQube项目设置读取,则每个人都将遵循相同的规则集,而不是依靠开发人员使用相同的checkstyle / findbugs设置进行配置。

Hope this helps! 希望这可以帮助!

In Sonar, generally sonar-scanner is used to scan the code and it sent the result/reports for displaying on the sonarqube server. 在Sonar中,通常使用声纳扫描仪扫描代码,并发送结果/报告以显示在声纳服务器上。

When you use sonar plugin in Jenkins you have to set the path of sonar scanner or you have to install it automatically. 在Jenkins中使用声纳插件时,必须设置声纳扫描仪的路径,或者必须自动安装。 ( Please refer below ) 请参考下面

在此处输入图片说明

For FindBugs you can install the plugin on sonarqube server and set it as default for the analysis. 对于FindBugs,您可以将插件安装在声纳服务器上,并将其设置为分析的默认值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM