2017-10-19 189 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