【发布时间】:2017-01-08 12:48:48
【问题描述】:
我正在尝试将 sonarqube 与 TFS 集成,我根据本教程创建了一个只有一步的构建定义,即 sonar qube 集成:
我知道我的 sonarqube 已经设置好了,因为我可以通过浏览器访问它并且数据库设置正确。
但是我收到了这个错误:
14:45:53.684 Default properties file was not found at C:\BuildAgents\DefaultBuildAgent\5\.sonarqube\bin\SonarQube.Analysis.xml
14:45:53.762 Updating build integration targets...
14:45:53.84 Fetching analysis configuration settings...
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, String projectBranch)
at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.FetchArgumentsAndRulesets(ISonarQubeServer server, ProcessedArgs args, TeamBuildSettings settings, IDictionary`2& serverSettings, AnalyzerSettings& analyzerSettings)
at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs args)
at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.Execute(String[] args)
at SonarQube.TeamBuild.PreProcessor.Program.Main(String[] args)
Pre-processing succeeded.
Unexpected exit code received from batch file: 255
******************************************************************************
Finishing task: SonarQubePreBuild
******************************************************************************
Task SonarQubePreBuild failed. This caused the job to fail. Look at the logs for the task for more details.
******************************************************************************
Finishing Build
******************************************************************************
Worker Worker-28c6fdb7-9350-4b65-bbba-0e9aab5e0e83 finished running job 28c6fdb7-9350-4b65-bbba-0e9aab5e0e83
【问题讨论】:
-
你的项目有什么权限? “任何人”是否有权浏览和执行分析?您正在使用其凭据的用户吗?
-
我是声纳的新手,但我是 TFS 的实验用户,请你详细解释一下,根据这个网址:blogs.msdn.microsoft.com/visualstudioalm/2015/08/24/…,它说在用户和密码中我可以填写任何示例:匿名/匿名,这正是我所做的,目前 sonarqube 中没有用户,只有管理员
-
这应该会有所帮助:docs.sonarqube.org/display/SONAR/…
-
我不确定到底该怎么做,我创建了项目,我添加了全局权限等,但仍然得到同样的错误。
-
您的 SonarQube 服务器在本地吗?
标签: tfs sonarqube azure-devops