我有一个团队城市构建,我已经添加了构建开始和结束操作来进行声音分析,在这两个任务之间有一个使用msbuild的构建。当SonarQube插件执行end阶段时,它会失败,并显示以下错误。
[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一切运行得很好。
可能的错误是什么?
发布于 2016-08-29 16:31:54
我已经找到了解决方案,我需要在TeamCity中为MSBUILD run操作指定工作目录。在我设置了这个值之后,分析进行得很顺利。如果我把这个值留空,我会得到前面的错误。

吉安·玛丽亚。
https://stackoverflow.com/questions/39201642
复制相似问题