如何为SonarQube.Scanner.MSBuild.exe提供参数? [英] How do i give parameters to SonarQube.Scanner.MSBuild.exe?

查看:96
本文介绍了如何为SonarQube.Scanner.MSBuild.exe提供参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过在线搜索并查看sonarqube文档,我唯一能找到的是:

From searching online and looking at sonarqube docs the only thing that I can find is:

SonarQube.Scanner.MSBuild.exe /k:KeyOfProject /n:NameOfProject
msbuild.exe C:\projectpath\soultion.sln
SonarQube.Scanner.MSBuild.exe end

问题是我发现没有设置类似这样的东西的开关

The problem is there's no switches that i've found to set things like:

  • 分析模式(如果sqube将项目报告给服务器,则进行预览,发布,递增/问题设置)
  • 如何在Gitlab中对问题和代码发表声纳尔评论

我唯一能想到的就是通过在SonarQube.Analysis.xml中传递属性,但是声纳的语法尚不清楚.属性.

The ONLY thing i can think of is by passing properties in the SonarQube.Analysis.xml but the syntax isn't clear for the sonar. properties.

 <Property Name="sonar.host.url">http://urlToYourServer.com</Property> 

是给定的,但是所有内容都是高度投机的.有人真的知道自己在做什么吗?在线文档简直糟透了.

is a given, but everything is highly speculative. Does anyone actually know what they're doing? The documentation online just plain sucks.

我已检出的来源:

  • https://github.com/SonarSource/sonar-scanning-examples/tree/master/sonarqube-scanner-msbuild/CSharpProject
  • https://docs.sonarqube.org/display/SONAR/Analysis+Parameters
  • https://docs.gitlab.com/ee/ci/variables/

推荐答案

您必须使用/d:property=foo语法.例如,/d:sonar.host.url=http://urlToYourServer.com/d:"sonar.host.url=http://urlToYourServer.com"

You have to use the /d:property=foo syntax. For example, /d:sonar.host.url=http://urlToYourServer.com or /d:"sonar.host.url=http://urlToYourServer.com"

我已经更新了MSBuild扫描程序的文档,因此下次使用起来会更容易人.

I have updated the documentation of the Scanner for MSBuild so it will be easier for the next person.

感谢提出这一点!

这篇关于如何为SonarQube.Scanner.MSBuild.exe提供参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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