MSBuild 的 SonarQube 扫描仪可以从 powershell 脚本中 运行 吗?
Can SonarQube Scanner for MSBuild be run from within a powershell script?
我无法让 MSBuild Sonar Runner 在 powershell 脚本中工作。示例脚本如下所示,遵循从同一目录执行所有步骤的记录过程。
$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 目录是空的,然后在 运行 结束命令之后我收到标准错误消息:
No ProjectInfo.xml files were found. Possible causes:
关于为什么 运行 msbuild 在 powershell 中阻止 msbuild 生成 ProjectInfo.xml 输出文件的任何想法?
适用于 MSBuild 的 SonarQube 扫描器与 MSBuild 版本 14 配合使用效果最佳。不支持 MSBuild 4,这就是您看到此 No ProjectInfo.xml files were found. Possible causes:
错误的原因。请注意,Possible causes
下的几行中提到了这一点;-)
更多细节请参考官方文档:http://docs.sonarqube.org/x/ahFq
我无法让 MSBuild Sonar Runner 在 powershell 脚本中工作。示例脚本如下所示,遵循从同一目录执行所有步骤的记录过程。
$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 目录是空的,然后在 运行 结束命令之后我收到标准错误消息:
No ProjectInfo.xml files were found. Possible causes:
关于为什么 运行 msbuild 在 powershell 中阻止 msbuild 生成 ProjectInfo.xml 输出文件的任何想法?
适用于 MSBuild 的 SonarQube 扫描器与 MSBuild 版本 14 配合使用效果最佳。不支持 MSBuild 4,这就是您看到此 No ProjectInfo.xml files were found. Possible causes:
错误的原因。请注意,Possible causes
下的几行中提到了这一点;-)
更多细节请参考官方文档:http://docs.sonarqube.org/x/ahFq