2016-08-31 15 views
5

Tôi cố gắng để tích hợp sonarqube với TFS, tôi tạo ra một định nghĩa xây dựng với chỉ một bước, sự tích hợp sonar qube, dựa trên hướng dẫn này:Lỗi khi xếp hàng được tạo bằng sonarqube. Trái phép

  1. https://blogs.msdn.microsoft.com/visualstudioalm/2015/08/24/build-tasks-for-sonarqube-analysis/

Tôi biết sonarqube của tôi là đã được thiết lập, bởi vì tôi có thể truy cập nó thông qua trình duyệt và cơ sở dữ liệu được thiết lập chính xác.

Tuy nhiên tôi nhận được lỗi này:

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 
+1

Các quyền trên dự án của bạn là gì? 'Bất cứ ai' có quyền Duyệt và Thực thi Phân tích không? Người dùng có thông tin đăng nhập bạn đang sử dụng phải không? –

+0

Tôi là một newbie trong sonar nhưng tôi đã thử nghiệm người dùng trong TFS, bạn có thể vui lòng giải thích cho tôi chi tiết hơn không, theo url này: https://blogs.msdn.microsoft.com/visualstudioalm/2015/08/24/build -tasks-for-sonarqube-analysis /, nó nói rằng trong người dùng và mật khẩu tôi có thể điền vào bất kỳ ví dụ: anonymous/anonymous và thats chính xác những gì tôi đã làm, tại thời điểm này không có người dùng trong sonarqube, chỉ cần admin –

+0

Điều này nên trợ giúp: http://docs.sonarqube.org/display/SONAR/Authorization#Authorization-ProjectPermissions –

Trả lời

2

Bạn cần phải xác định xác thực token trong thiết bị đầu cuối dịch vụ SonarQube trong TFS: click!

Để nhận mã người dùng trong SonarQube theo these steps

Hãy chắc chắn rằng các thuộc tính sonar.login và sonar.password trong SonarQube.Analysis.xml được nhận xét, nếu không mã thông báo sẽ không được sử dụng.

Các vấn đề liên quan