当前位置: 首页 > 知识库问答 >
问题:

MSBuild的SonarQube扫描器:排除

暨宸
2023-03-14

在SonarQube runner中,可以通过sonar project属性中的sonar.exclusions属性来管理排除的项目。通过这种方式,我们可以独立于代码库来管理构建配置

当项目文件夹被称为***.tests时,在将其添加到排除设置后,仍会对其进行扫描。

[14:14:14][Step 12/23] INFO: -------------  Scan MyProject.Tests
[14:14:14][Step 12/23] INFO: Excluded sources for coverage: 
[14:14:14][Step 12/23] INFO:   **/*.Tests/**/*
[14:14:14][Step 12/23] INFO:   **/*.Test/**/*
[14:14:14][Step 12/23] INFO: Base dir: C:\SomeFolder\MyProject\Modules\MyProject.Tests
[14:14:14][Step 12/23] INFO: Working dir: C:\SomeFolder\MyProject\.sonarqube\out\.sonar\{Sonar_Project}_{some guid}
[14:14:14][Step 12/23] INFO: Test paths: [I removed some classes], Utils/SomeTests.cs, Enum/dummy.resx, app.config, Compression/TestData/data1.FRM, Compression/TestData/data1.zip, Compression/TestData/data1.Off.zip, packages.config
[14:14:14][Step 12/23] INFO: Source encoding: UTF-8, default locale: en_US
[14:14:14][Step 12/23] INFO: Index files
[14:14:15][Step 12/23] INFO: 45 files indexed
[14:14:15][Step 12/23] INFO: Quality profile for cs: [some profile]
[14:14:15][Step 12/23] INFO: Quality profile for vb: [some profile]

共有1个答案

齐典
2023-03-14

没有关于在分析参数中管理这些属性组的文档,因为很难正确地处理这些属性组。相反,您应该使用UI来管理排除:管理>常规设置>分析范围。

更多信息,请参见文档。

 类似资料:
  • 我正在使用Jenkins为我的.NET项目(C#)运行SonarQube。 使用MsBuild:MsBuild版本:MsBuild 4.6 MsBuild文件:ci.sln命令行参数:/p:configuration=release/target:Build构建Visual Studio项目或解决方案 用于MSBuild-End分析的SonarQube扫描器 我可以为Visual Studio20

  • 有人知道MSBuild的SonarQube扫描器是作为构建的一部分进行扫描并只将结果发回给SonarQube,还是EXE正在检测,我们可以将工件发送到Linux机器上的SonarQube进行分析,类似于使用sonar-scanner-cli扫描java工件的方式?

  • 我们将Visual Studio 2015(原始版本,没有更新)与SonarQube和Jenkins一起使用,并不断得到以下消息: 警告-*不推荐使用MSBuild12或sonar-runner来分析C#项目*

  • 我试图使用Jenkins、FxCop和Sonarqube分析一个C#项目。目前,我使用的构建步骤是“用于MSBuild-Begin Analysis的Sonarqube Scanner”、“FxCop Exec.”、“使用MSBuild构建Visual Studio项目或解决方案”和“用于MSBuild-End Analysis的Sonarqube Scanner”。当FxCop和SonarQub

  • 我试图通过Jenkins管道构建我的TypeScript应用程序。为了管理构建、测试和代码质量扫描,我让Jenkins使用一个基于Node:7-Alpine的Docker代理。 容器的Dockerfile是: 我的Jenkins文件看起来像: null [03:00:14]开始SonarQube分析... [03:00:14]检查可执行文件是否存在:/home/node/.sonar/native

  • 安装信息是... sonarqube-6.7.1 sonar-scanner-3.0.3.778 sonar-scanner-msbuild-4.0.2.892 msbuild 14 Java SE开发工具包8.NET Framework 4.6.2 并且我制作了windows批处理文件来构建和扫描(声纳)。但有些项目还可以。但有些项目失败了。批处理文件是... 第一步。用于MSBuild-Beg