简体   繁体   English

Jenkins Sonarqube扫描仪结果不显示

[英]Jenkins Sonarqube scanner results not display

I have installed the sonarqube scanner plugin in jenkins and added the below properties in execute sonarqube scanner in the build section of jenkins instance. 我已经在jenkins中安装了sonarqube扫描器插件,并在jenkins实例的build部分中的execute sonarqube扫描器中添加了以下属性。

# Project identification
sonar.projectKey=BUS.App
sonar.projectVersion=Test
sonar.projectName=BUS App

# Info required for Sonar 
sonar.sources=.
sonar.language=cs 

#Core C# Settings
sonar.dotnet.visualstudio.solution.file=BUS.Platform2.sln
sonar.dotnet.excludeGeneratedCode=true

#----- Default source code encoding
sonar.sourceEncoding=UTF-8

After the build completion of the instance in sonar server it shows the correct analysis time but doesn't shows the analytics results. 在声纳服务器中完成实例的构建后,它会显示正确的分析时间,但不会显示分析结果。

I did the analysis in my project using SonarMSBuild (not in jenkins locally in the project folder), it shows the results correctly. 我使用SonarMSBuild在项目中进行了分析(不是在项目文件夹中的本地jenkins中进行分析),它可以正确显示结果。

This is how the sonar server after jekins build. 这就是jekins之后构建声纳服务器的方式。 声纳结果

Does my sonar scanner properties are wrong? 我的声纳扫描仪属性是否错误? or did I missed something? 还是我错过了什么?

This is how my build section looks in jenkins configure. 这就是我的构建部分在jenkins configure中的外观。 在此处输入图片说明

That's not how you analyze C#. 那不是您分析C#的方式。 As described in the docs You need 文档中所述,您需要

  • SonarQube Scanner for MSBuild - Begin Analysis 用于MSBuild的SonarQube扫描仪-开始分析
  • Build 建立
  • SonarQube Scanner for MSBuild - End Analysis 用于MSBuild的SonarQube扫描仪-最终分析

You'll pass a couple properties in to the Begin Analysis step, but by and large you don't need those properties. 您将在“开始分析”步骤中传递几个属性,但是总的来说,您不需要那些属性。

And you particularly don't need sonar.language which was deprecated years ago. 而且您尤其不需要几年前不推荐使用的sonar.language

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

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