The DotNet scanner does not appear to be honouring exclusions.
Scanner version:
SonarScanner for MSBuild 10.1.2
....
INFO: SonarScanner 5.0.1.3006
INFO: Java 17.0.11 Eclipse Adoptium (64-bit)
INFO: Windows 11 10.0 amd64
I have set up my XML configuration as follows:
<?xml version="1.0" encoding="utf-8" ?>
<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.exclusions">
XXXXX.Database/Data Generators/**/*;
XXXXX.Database/Scripts/**/*;
XXXXX.Database/Intergration/**/*;
</Property>
</SonarQubeAnalysisProperties>
(I have also tried putting them all on one line.)
The log file reports the following exclusions:
INFO: Excluded sources: **/build-wrapper-dump.json, XXXXX.Database/Data Generators/**/*;
XXXXX.Database/Scripts/**/*;
XXXXX.Database/Intergration/**/*;, coverage.net472.xml
However later in the log file I can see the following messages relating to files that should be excluded.
WARN: Unable to fully parse: C:/Users/AA/projects/XXXXX/[source-control-root-folder]/XXXXX.Database/Data Generators/Unseed Base Data.sql
WARN: Parse error starting from line 3
WARN:
WARN:
WARN: Unable to fully parse: C:/Users/AA/projects/XXXXX/[source-control-root-folder]/XXXXX.Database/Data Generators/Unseed Base Data.sql
WARN: Parse error starting from line 6
Note: [source-control-root-folder]
isn’t really formatted like this, I’m showing where the project is cloned to in the folder structure.
If I check in the Sonar UI, all of the Analysis options are empty. The exclusions fields are not populated.
If it makes any difference I am working on a branch, could that be why the server settings are not getting set in the UI as well ?
Other than that, I’m not sure what else to try.