【发布时间】:2017-05-31 04:08:40
【问题描述】:
我们正在使用适用于 MSBuild (1.1.0.0) 的 SonarQube 扫描仪,并且有一个包含多个项目的解决方案。
在我们提供给扫描仪 cli 的解决方案根文件夹中有一个 SonarQube.Analysis.xml。
<SonarQubeAnalysisProperties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sonarsource.com/msbuild/integration/2015/1">
<Property Name="sonar.cs.opencover.reportsPaths">output/nunit-coverage.xml</Property>
<Property Name="sonar.cs.nunit.reportsPaths">output/nunit-result.xml</Property>
<Property Name="sonar.exclusions">Project1/Migrations/*</Property>
<Property Name="sonar.coverage.exclusions">Project1/Migrations/*</Property>
</SonarQubeAnalysisProperties>
现在的问题是:Project1/Migrations/* 似乎没有被排除,因为在扫描期间 Base dir 设置为 .../Project1。解决方案中的所有其他项目也是如此。结果是.../Project1/Project1/Migrations/* 是未知路径。
那么在使用 MSBuild Scanner 时,从覆盖范围和源代码分析中排除整个目录的推荐方法是什么?
【问题讨论】: