SonarQube将各种应用程序的分析报告合并在一个报告中 [英] SonarQube combines analysis report of various applications under a single report

查看:98
本文介绍了SonarQube将各种应用程序的分析报告合并在一个报告中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过Jenkins集成了SonarQube,可用于各种应用程序.我们为不同的应用提供单独的Visual Studio解决方案. SonarQube以某种方式将针对各种应用程序的分析报告合并到一个报告中.

I have integrated SonarQube via Jenkins for various applications. We have separate visual studio solutions for different applications. Somehow SonarQube combines analysis report for various applications under a single report.

如何为每个应用程序生成单独的报告?我具有以下属性,可以通过詹金斯进行声纳分析.

How can I generate separate report for each application? I have the following properties to run Sonar analysis via Jenkins.

sonar.projectKey=SONAR_TEST
sonar.projectName=SONAR_TEST
sonar.projectVersion=1.0
sonar.sources=C:/$Application_Name (Note: $Application_Name is root folder name of various applications)
sonar.host.url=https://server_name:8080/sonar/

推荐答案

之所以汇总报告是因为您要告诉他们.

The reason it is aggregating the reports is because you are telling it to.

SonarQube结果是基于projectKey由"Project"显示的.您似乎为每个作业都设置了相同的固定projectKey(和projectName).

SonarQube results are displayed by "Project", based on projectKey. You appear to be setting the same fixed projectKey(and projectName) for every job.

sonar.projectKey=SONAR_TEST
sonar.projectName=SONAR_TEST
sonar.sources=C:/$Application_Name 

更改projectKey(和projectName)以与"$Application_Name"对齐. (如果愿意,请为projectName提供一个用户友好的名称).省略projectName默认为projectKey.

Change the projectKey(and projectName) to align with the "$Application_Name" (and give the projectName a user friendly name if you like). Omitting the projectName defaults to the projectKey.

默认情况下,如果是Maven项目,则该项目为GroupId:ArtifactID.其他类型没有默认键,但是通常可以使用类似的逻辑来对齐.

By default, if a maven project, the project is the GroupId:ArtifactID. Other types do not have a default key, but you can generally use similar logic to align.

您可以在 sonar-project.properties 根文件夹中的文件(即$Application_Name/sonar-project.properties)

注意:密钥不能有空格,名称可以.

Note: Key cannot have spaces, Name can.

这篇关于SonarQube将各种应用程序的分析报告合并在一个报告中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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