用于Jenkins的SonarQube扫描仪,MSBuild.SonarQube.Runner错误

时间:2018-02-01 07:52:39

标签: jenkins msbuild sonarqube jenkins-plugins sonar-runner

SonarQube服务器运行正常,但是当我使用命令行
时 " SonarQube.Scanner.MSBuild.exe开始/k:"org.sonarqube:sonarqube-scanner-msbuild" / N:"测试" /v:"1.0" "我有这个错误,如何解决这个问题?感谢
使用: Windows Server 2012 R2

Jenkins的控制台输出日志: 建设中工作区C:\ Program Files(x86)\ Jenkins \ workspace \ CSS_SQ

  

C:\ Program Files \ Git \ bin \ git.exe rev-parse --is-inside-work-tree #timeout = 10
  从远程Git存储库中获取更改   C:\ Program Files \ Git \ bin \ git.exe config remote.origin.url http://196.196.30.71:3000/megasilver/CSS.git #timetime = 10   从http://196.196.30.71:3000/megasilver/CSS.git获取上游变更   C:\ Program Files \ Git \ bin \ git.exe --version #timetime = 10
  C:\ Program Files \ Git \ bin \ git.exe fetch --tags --progress http://196.196.30.71:3000/megasilver/CSS.git + refs / heads / :refs / remotes / origin /
  C:\ Program Files \ Git \ bin \ git.exe rev-parse" refs / remotes / origin / master ^ {commit}" #timeout = 10
  C:\ Program Files \ Git \ bin \ git.exe rev-parse" refs / remotes / origin / origin / master ^ {commit}" #timeout = 10   检查修订版7f08fd9d8f8d7f07ce0627fb98eb02f6f58a1256(refs / remotes / origin / master)   提交消息:"测试"
  C:\ Program Files \ Git \ bin \ git.exe config core.sparsecheckout #timeout = 10
  C:\ Program Files \ Git \ bin \ git.exe checkout -f
   7f08fd9d8f8d7f07ce0627fb98eb02f6f58a1256   C:\ Program Files \ Git \ bin \ git.exe rev-list 7f08fd9d8f8d7f07ce0627fb98eb02f6f58a1256 #timetime = 10   使用配置注入SonarQube环境变量:SonarQube   [CSS_SQ] $" C:\ Program Files(x86)\ Jenkins \ tools \ hudson.plugins.sonar.MsBuildSQRunnerInstallation \ SonarQube_Scanner_for_MSBuild \ MSBuild.SonarQube.Runner.exe"开始/k:org.sonarqube:sonarqube-scanner-msbuild / n:test /v:1.0 /d:sonar.host.url=http://196.196.30.71:9000/ ********
  未处理的例外状况:System.MissingMethodException:找不到方法:&#39; System.String System.String.Format(System.IFormatProvider,System.String,System.Object,System.Object)&#39;。<登记/>      于SonarQube.Common.ConsoleLogger.GetFormattedMessage(String message,Object [] args)
     于SonarQube.Common.ConsoleLogger.LogInfo(String message,Object [] args)
     于SonarQube.Common.Utilities.LogAssemblyVersion(ILogger记录器,装配装配,字符串描述)
     于SonarQube.Bootstrapper.Program.Main(String [] args)
     于SonarQube.Old.Bootstrapper.Program.Main(String [] args)
  错误:为MSBuild执行SonarQube扫描程序失败(退出代码255)
  完成:失败

1 个答案:

答案 0 :(得分:1)

用于MSBuild的SonarQube扫描程序需要.NET 4.6或更高版本。请确保它已安装在您的所有构建计算机上。