【发布时间】:2015-10-22 16:17:51
【问题描述】:
SonarQube - V 5.1.1
MSBuild SonarQube Runner - V 1.0
Resharper Plugin - V 2.0
Csharp Plugin - V 4.1
我正在运行命令:
- D:\SonarQube\sonarqube-5.1.1\MSBuild\MSBuild.SonarQube.Runner.exe begin /key:Test6MSBKey /name:Test6MSBProject /version:2.0
- msbuild Test6MSB.sln
- D:\SonarQube\sonarqube-5.1.1\MSBuild\MSBuild.SonarQube.Runner.exe end
我的所有 resharper 错误都被跳过,以下问题被记录到命令窗口:
10:20:11 PM 22:20:11.013 INFO - Sensor org.sonar.plugins.resharper.CSharpReSharperProvider$CSharpReSharperSensor@1659dbf
10:20:11 PM 22:20:11.013 INFO - Parsing ReSharper report: D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB.xml
10:20:11 PM 22:20:11.054 INFO - Skipping the ReSharper issue at line 15 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Form1.cs" is not
in SonarQube.
10:20:11 PM 22:20:11.054 INFO - Skipping the ReSharper issue at line 16 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Form1.cs" is not
in SonarQube.
10:20:11 PM 22:20:11.054 INFO - Skipping the ReSharper issue at line 17 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Form1.cs" is not
in SonarQube.
10:20:11 PM 22:20:11.054 INFO - Skipping the ReSharper issue at line 18 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Form1.cs" is not
in SonarQube.
10:20:11 PM 22:20:11.054 INFO - Skipping the ReSharper issue at line 19 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Form1.cs" is not
in SonarQube.
10:20:11 PM 22:20:11.054 INFO - Skipping the ReSharper issue at line 20 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Form1.cs" is not
in SonarQube.
10:20:11 PM 22:20:11.054 INFO - Skipping the ReSharper issue at line 21 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Program.cs" is no
t in SonarQube.
10:20:11 PM 22:20:11.054 INFO - Skipping the ReSharper issue at line 22 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Program.cs" is no
t in SonarQube.
10:20:11 PM 22:20:11.055 INFO - Skipping the ReSharper issue at line 23 whose
file "D:\Chris\Schneider\Projects\SampleCode\Test6MSB\Test6MSB\Properties\Assemb
lyInfo.cs" is not in SonarQube.
10:20:11 PM 22:20:11.055 INFO - Sensor org.sonar.plugins.resharper.CSharpReSha
rperProvider$CSharpReSharperSensor@1659dbf (done) | time=42ms
我不确定为什么没有使用 MSBuild Runner 将代码文件放入 SonarQube。 在尝试使用 MSBuild 运行程序之前,我能够在类似的解决方案上成功使用 sonar-runner.bat(v2.4),使用相同的 Resharper 插件和使用 resharper 命令行检查代码可执行文件创建的 xml,并且 resharper 问题是为解决方案/项目成功添加到 sonarqube。
但是,我注意到 C# 4.1 插件的文档说现在不推荐使用 sonar-runner,并且要使用 MSBuildSonarQube Runner 1.0 来分析 C# 项目,但是,当我尝试使用 MSBuildSonarQube Runner 时,我得到如上所述的跳过错误。
【问题讨论】:
-
如果您的项目在路径中没有“test”,是否会上传结果? (见stackoverflow.com/questions/31722389/…)
-
这就是问题所在。一旦我将“测试”从路径中取出,结果就会上传到 sonarqube 数据库中。感谢您的链接和您的回复。
-
请用
sonarqube和msbuild或c#标记您的问题,以便更容易找到。
标签: c# msbuild sonarqube sonarqube-msbuild-runner