Sonar-scanner-msbuild : credentials must be passed in both begin and end steps or not at all

Sonar-scanner-msbuild : credentials must be passed in both begin and end steps

再跑 SonarScanner 的時候跳出了錯誤(credentials must be passed in both begin and end steps),如果再 SonarScanner.MSBuild.exe中要使用 /d:sonar.login,必須在 begin 和 end 都要加入 /d:sonar.login,才會生效。

error

1
2
3
SonarScanner.MSBuild.exe begin /k:"project-key" /d:sonar.login="YourToken"
MSBuild.exe <path to solution.sln> /t:Rebuild
SonarScanner.MSBuild.exe end /d:sonar.login="YourToken"

Token 的部分可以去帳號設定產出來
Token

Token

參考