尝试使用Jenkins运行Sonarqube MSBuild Runner时出现以下错误。我正在使用SonarQube 4.5和MSBuild SonarQube Runner 1.1。有关如何解决的任何建议?
Unhandled Exception: System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadString(Uri address)
at System.Net.WebClient.DownloadString(String address)
at SonarQube.TeamBuild.PreProcessor.WebClientDownloader.Download(String url)
at SonarQube.TeamBuild.PreProcessor.SonarWebService.GetProperties(String projectKey)
at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ProcessedArgs args, TeamBuildSettings settings, ILogger logger, IDictionary`2& serverSettings)
at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs args, ILogger logger)
at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.Execute(String[] args, ILogger logger)
at SonarQube.TeamBuild.PreProcessor.Program.Main(String[] args)
Pre-processing succeeded.
答案 0 :(得分:3)
您需要查看配置文件SonarQube.Analysis.xml。确认属性sonar.host.url是否正确,并且您已配置了有效的sonar.login和sonar.password。您指定的用户必须能够执行分析。以管理员身份打开SonarQube门户并激活管理 - 安全 - 全局权限。必须在Execute Analysis中指定用户,或者必须是Execute Analysis中指定的组的成员。如果这没有帮助,请提供更多详细信息