2017-10-19 93 views
1

我已將SonarQube - 開始分析和結束分析任務添加到我的TFS構建定義中。我的SonarQube服務器正常運行。我添加了一個SonarQube服務端點,並在配置SonarQube Begin分析任務時添加了它。SonarQube 6.5 - 無法觸發TFS構建定義

然而,當我觸發構建,它沒有拋出下面的錯誤 - 「未處理的異常:System.IO.InvalidDataException:中央目錄記錄的到底能不能找到。」

任何想法可能是什麼問題? 我正在使用SonarQube 6.5版本。

Starting: Get sources 

Running tasks 

Starting task: Fetch the Quality Profile from SonarQube 

Executing the powershell script: c:\Program 
Files\TFS2015Agent\tasks\SonarQubePreBuild\1.0.34\SonarQubePreBuild.ps1 
SonarQube Scanner for MSBuild 1.1 Default properties file was not 
found at C:\Program 
Files\TFS2015Agent\tasks\SonarQubePreBuild\1.0.34\MSBuild.SonarQube.Runner-1.1\SonarQube.Analysis.xml 

Pre-processing started. Preparing working directories... Checking for 
updates... Unhandled Exception: System.IO.InvalidDataException: End of 
Central Directory record could not be found. 


at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory() 
at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen) 
at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding) 
at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode mode, Encoding entryNameEncoding) 
at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName, Encoding entryNameEncoding) 
at SonarQube.Bootstrapper.BuildAgentUpdater.TryUpdate(String hostUrl, String targetDir, ILogger logger) 
at SonarQube.Bootstrapper.Program.PreProcess(IBuildAgentUpdater updater, IBootstrapperSettings settings, ILogger logger) 
at SonarQube.Bootstrapper.Program.Execute(String[] args, IBuildAgentUpdater updater, ILogger logger) 
at SonarQube.Bootstrapper.Program.Main(String[] args) 
+0

也許這是[Nuget](https://stackoverflow.com/questions/32493537/end-of-central-directory-record-could-not-be-found-nuget-in-vs-community-201 )的問題。當SonarQube任務被禁用時,構建是否成功? –

+0

是的,構建成功與刪除S​​onarQube任務。 – Sammy

+0

部分錯誤似乎已丟失。你能仔細檢查一下你沒有忽略錯誤日誌的一部分嗎? –

回答

1

要解決此問題,我必須在TFS中下載latest version of the SonarQube build tasks。最簡單的選擇是導航到服務器上的Admin TFS擴展頁面,並使用它來下載和安裝更新的SonarQube擴展。

enter image description here

這項工作完成,我引發了TFS構建並能得到過去的這個錯誤。

+0

很高興知道你已經解決了這個問題,你可以[接受它作爲答案](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work),這可以有益於其他社區成員閱讀此主題。 –

+0

已經完成了。謝謝。 – Sammy