SonarQube并行构建:System.IO.IOException:文件SonarQube.Integration.ImportBefore.targets已存在

时间:2017-10-17 20:24:51

标签: jenkins sonarqube sonarqube-scan sonarqube-msbuild-runner msbuild-15

在Jenkins中运行涉及SonBuube扫描程序for MSBuild的多个不同并行作业时,此异常会立即终止构建作业:

10:46:22 [workspace] $ C:\Tools\SonarQube\sonar-scanner-msbuild-3.0.2.656
\MSBuild.SonarQube.Runner.exe begin /k:auth-services /n:auth-services /v:develop-b82 /d:sonar.host.url=http://redacted:9000 /d:sonar.cs.vscoveragexml.reportsPaths=C:\Jenkins\auth-services\auth-services-develop\workspace\VisualStudio.coveragexml /d:sonar.exclusions=node_modules/**,**/*.js
10:46:23 SonarQube Scanner for MSBuild 3.0.2
10:46:23 Default properties file was found at C:\Tools\SonarQube\sonar-scanner-msbuild-3.0.2.656\SonarQube.Analysis.xml
10:46:23 Loading analysis properties from C:\Tools\SonarQube\sonar-scanner-msbuild-3.0.2.656\SonarQube.Analysis.xml
10:46:23 Pre-processing started.
10:46:23 Preparing working directories...
10:46:23 10:46:23.814  Updating build integration targets...
10:46:23 
10:46:23 Unhandled Exception: System.IO.IOException: The file 'C:\Users\serviceaccount\AppData\Local\Microsoft\MSBuild\15.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets' already exists.
10:46:23    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
10:46:23    at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
10:46:23    at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
10:46:23    at SonarQube.TeamBuild.PreProcessor.TargetsInstaller.CopyIfDifferent(String sourcePath, IEnumerable`1 destinationDirs, ILogger logger)
10:46:23    at SonarQube.TeamBuild.PreProcessor.TargetsInstaller.InternalCopyTargetsFile(ILogger logger)
10:46:23    at SonarQube.TeamBuild.PreProcessor.TargetsInstaller.InstallLoaderTargets(ILogger logger, String workDirectory)
10:46:23    at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.InstallLoaderTargets(ProcessedArgs args)
10:46:23    at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.DoExecute(ProcessedArgs localSettings)
10:46:23    at SonarQube.TeamBuild.PreProcessor.TeamBuildPreProcessor.Execute(String[] args)
10:46:23    at SonarQube.Bootstrapper.BootstrapperClass.PreProcess()
10:46:23    at SonarQube.Bootstrapper.BootstrapperClass.Execute()
10:46:23    at SonarQube.Bootstrapper.Program.Execute(String[] args, ILogger logger)
10:46:23    at SonarQube.Bootstrapper.Program.Main(String[] args)
10:46:23    at SonarQube.Old.Bootstrapper.Program.Main(String[] args)
10:46:26 ERROR: Execution of SonarQube Scanner for MSBuild failed (exit code 255)

重启构建作业而没有其他涉及扫描程序的作业正在运行似乎已成功完成构建。

0 个答案:

没有答案