[英]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.