【问题标题】:Error integration SonarQube Msbuild runner with TeamCity错误将 SonarQube Msbuild 运行器与 TeamCity 集成
【发布时间】:2017-01-05 05:06:22
【问题描述】:

我有一个 teamcity 构建,我已添加到构建开始和结束操作以进行声纳分析,并且在这两个任务之间有一个带有 msbuild 的构建。当 SonarQube 插件执行结束阶段时,它会失败并出现此错误。

[10:16:52][Step 5/9] Starting: C:\sonarqube\Runner\MSBuild.SonarQube.Runner.exe end
[10:16:52][Step 5/9] in directory: C:\agents\build2\work\a6252c8eea7552b3\src
[10:16:52][Step 5/9] SonarQube Scanner for MSBuild 2.0
[10:16:52][Step 5/9] Default properties file was found at C:\sonarqube\Runner\SonarQube.Analysis.xml
[10:16:52][Step 5/9] Loading analysis properties from C:\sonarqube\Runner\SonarQube.Analysis.xml
[10:16:53][Step 5/9] Post-processing started.
[10:16:53][Step 5/9] SonarQube Scanner for MSBuild End Step 2.1
[10:16:53][Step 5/9] The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
[10:16:53][Step 5/9] Possible causes:
[10:16:53][Step 5/9]   1. The project has not been built - the project must be built in between the begin and end steps
[10:16:53][Step 5/9]   2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 12.0 upwards are supported
[10:16:53][Step 5/9]   3. The begin, build or end steps have not all been launched from the same folder
[10:16:53][Step 5/9] Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
[10:16:53][Step 5/9] 10:16:53.266  Creating a summary markdown file...
[10:16:53][Step 5/9] Post-processing failed. Exit code: 1
[10:16:53][Step 5/9] Process exited with code 1
[10:16:53][Step 5/9] Step Finish SonarQube analysis (Command Line) failed

如果我登录到服务器,打开代理的同一个目录并手动执行构建执行的三个步骤。

C:\sonarqube\Runner\MSBuild.SonarQube.Runner.exe begin /k:"Metrics.Net.Es" /n:"Metrics.Net.Es" /v:"1.0"
msbuild mysolution.sln
C:\sonarqube\Runner\MSBuild.SonarQube.Runner.exe end

一切运行良好。

可能是什么错误?

【问题讨论】:

    标签: msbuild sonarqube teamcity


    【解决方案1】:

    我找到了解决方案,我需要为 TeamCity 中的 MSBUILD 运行操作指定工作目录。在我设置了这个值之后,分析就正常了。如果我将此值留空,则会出现上一个错误。

    吉安玛丽亚。

    【讨论】:

    • 其实我已经放弃用teamcity配置sonarqube了,用Visual Studio Team services创建了一个build,它可以构建github项目,并且有专门的sonar qube分析任务
    猜你喜欢
    • 2016-09-09
    • 2011-12-29
    • 1970-01-01
    • 2018-11-12
    • 2015-08-11
    • 2011-02-20
    • 2019-10-24
    • 2017-08-24
    • 2021-10-08
    相关资源
    最近更新 更多