繁体   English   中英

SonarQube Scanner for MSBuild是否可以在Powershell脚本中运行?

[英]Can SonarQube Scanner for MSBuild be run from within a powershell script?

我无法在Powershell脚本中使MSBuild Sonar Runner运行。 下面的示例脚本按照已记录的从同一目录执行所有步骤的过程显示。

$sonarRunnerPath = "C:\Users\glenn\MSBuild.SonarQube.Runner-2.0\MSBuild.SonarQube.Runner.exe"
$msbuildPath = "$env:WINDIR\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"

Push-Location $slnDir
& $sonarRunnerPath begin /k:proj:alpha "/n:Project Alpha" /v:1.0.0.%BUILD_NUMBER% /d:sonar.host.url=http://sonar.local
& $msbuildPath /nologo /t:Build /nologo /v:n /clp:ErrorsOnly /m /p:Configuration=Release
& $sonarRunnerPath end

但是,在构建(第二步)之后,我注意到$ slnDir / .sonarqube / out目录为空,然后在运行end命令后,我收到标准错误消息:

No ProjectInfo.xml files were found. Possible causes:

关于为什么在Powershell中运行msbuild会阻止msbuild生成ProjectInfo.xml输出文件的任何想法?

用于MSBuild的SonarQube扫描仪最适合与MSBuild版本14配合使用。不支持MSBuild 4,这就是为什么看到此未No ProjectInfo.xml files were found. Possible causes: No ProjectInfo.xml files were found. Possible causes:错误。 请注意,在Possible causes下的几行中提到了这一点;-)

有关更多详细信息,请参阅官方文档: http : //docs.sonarqube.org/x/ahFq

暂无
暂无

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

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