MSBuild (1.1.0.0) 용 SonarQube 스캐너를 사용하고 있으며 여러 프로젝트가 포함 된 솔루션이 있습니다.MSBuild 스캐너를 사용할 때 단일 파일을 제외하는 방법
우리는 스캐너 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 스캐너를 사용할 때 커버리지 및 소스 코드 분석에서 전체 디렉토리를 제외시키는 권장 방법은 무엇입니까?
<ItemGroup>
<SonarQubeSetting Include="sonar.exclusions">
<Value>**/Migrations/*</Value>
</SonarQubeSetting>
</ItemGroup>
이 Appendix 2: Configuring the SonarQube Scanner for MSBuild를 참조하십시오 (.csproj) 자체 무언가 같이
감사합니다. 이 방법이 효과가있을 수 있지만 SonarQube 관련 설정을 내 프로젝트 파일에 넣지는 않습니다. – philipooo