Msbuild SonarQube在TeamCity for.NET C#项目中的集成

Msbuild SonarQube在TeamCity for.NET C#项目中的集成,msbuild,sonarqube,teamcity,Msbuild,Sonarqube,Teamcity,我在TeamCity与MSBuild的SonarQube集成中遇到了一些问题 基本上,我们使用SonarQube的夜间构建分为5个步骤: 1-SonarQube初始化 MSBuild.SonarQube.Runner.exe begin /k:"tsmm-%sonar.project%" /n:"%sonar.project%" /v:"%sonar.project.version%" /d:sonar.host.url="%sonar.host.url%" /d:sonar.cs.d

我在TeamCity与MSBuild的SonarQube集成中遇到了一些问题

基本上,我们使用SonarQube的夜间构建分为5个步骤:

1-SonarQube初始化

MSBuild.SonarQube.Runner.exe begin 
/k:"tsmm-%sonar.project%" 
/n:"%sonar.project%" 
/v:"%sonar.project.version%" 
/d:sonar.host.url="%sonar.host.url%" 
/d:sonar.cs.dotcover.reportsPaths="coverage-report.html" 
/d:sonar.cs.nunit.reportsPaths="nunit-results.xml" 
/d:sonar.verbose=true 
/d:sonar.jdbc.username="%sonar.jdbc.username%" 
/d:sonar.jdbc.password="%sonar.jdbc.password%" 
/d:sonar.jdbc.url="%sonar.jdbc.url%"
2-恢复营业

3-MSBuild

4-通过NUnit进行测试

5-将结果发布至SonarQube

MSBuild.SonarQube.Runner.exe end 
/d:sonar.scm.disabled=true
/d:sonar.jdbc.username="%sonar.jdbc.username%" 
/d:sonar.jdbc.password="%sonar.jdbc.password%"
当TeamCity运行上述构建定义时,一切正常,直到达到构建日志中所述的第5步:

Step 5/5: Publish to SonarQube (Command Line)
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
...
Caused by: org.sonar.api.utils.SonarException: SCM URL should be provided. Please review "sonar.scm.url" parameter (or the <scm> section of pom.xml if you are using Maven).
步骤5/5:发布到SonarQube(命令行)
错误:执行Sonar runner时出错
org.sonar.runner.impl.RunnerException:无法执行sonar
位于org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
...
原因:org.sonar.api.utils.sonar异常:应提供SCM URL。请查看“sonar.scm.url”参数(如果您使用的是Maven,请查看pom.xml部分)。
我浏览了不同的资源,包括那里的官方资源:

但无法找到任何正确的解释,我还尝试禁用该页面上提到的scm支持:
通过将
/d:sonar.scm.disabled=true
添加到步骤1,但不会改变任何内容。

sonar.jdbc.*属性仅适用于旧版本的SonarQube,如果您使用的是高于5.4的版本,则不应设置它们

要对SonarQube进行身份验证,您需要使用sonar.login和sonar.password属性,如下文所述:

在所有情况下,如果您有较旧的SonarQube,我强烈建议升级到LTS(长期支持)版本:

sonar.jdbc.*属性仅适用于SonarQube的旧版本,如果您使用的是高于5.4的版本,则不应设置它们

要对SonarQube进行身份验证,您需要使用sonar.login和sonar.password属性,如下文所述:

在所有情况下,如果您有较旧的SonarQube,我强烈建议升级到LTS(长期支持)版本:

您使用哪种SonarQube插件?您使用哪种SonarQube插件?