用于.NET Core的Jenkins SonarQube失败,但PowerShell脚本工作正常

问题描述 投票:1回答:1

我正在尝试为SonarQube分析运行Jenkins管道。我写了一个PowerShell脚本,运行分析就好了;但是当它在管道中运行时,它在end步骤失败了。

以下是PowerShell的正确结果:https://pastebin.com/eCaDXgmi

这是詹金斯失败的结果:https://pastebin.com/mXgTiq5g

以下是PowerShell脚本的来源:

& 'C:\Program Files (x86)\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SQScannerMSB\SonarQube.Scanner.MSBuild.exe' begin /k:HC /n:HC /v:1.0 /d:sonar.host.url=http://localhost:9000 /d:sonar.login=REDACTED
& 'C:\Program Files\dotnet\dotnet.exe' msbuild /t:Rebuild
& 'C:\Program Files (x86)\Jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\SQScannerMSB\SonarQube.Scanner.MSBuild.exe' end /d:sonar.login=REDACTED

以下是相关的Jenkins管道代码:

stage('SonarQube') {
    powershell(returnStdout: true, script: '.\\sonar.ps1')
}
powershell jenkins asp.net-core msbuild sonarqube
1个回答
1
投票

从日志看起来它可能与Sonarqube with dotnet core works fine on command line but not from Jenkins中的问题相同,即作为非本地帐户运行。

从v4.1开始,扫描仪MSBuild将在这种情况下给出一个特定的警告 - 请参阅SonarMSBRU-374

© www.soinside.com 2019 - 2024. All rights reserved.