I have excluded the directory in my project properties but sonar doesn't exclude it. Can anyone help me to find problem?
sonar.sources=./
sonar.exclusions=./utility/Excel/**
I have excluded the directory in my project properties but sonar doesn't exclude it. Can anyone help me to find problem?
sonar.sources=./
sonar.exclusions=./utility/Excel/**
I realized that first I should have written directory name Like below to exclude all folders and file on that directory:
sonar.exclusions=utility/Excel/**/*
Second I should have used comma separated directory names to exclude more than one directory:
sonar.exclusions=utility/Excel/**/* , utility/mailer/**/*
sonar.sources
uses path relative to sonar-project.properties, and apparently sonar.exclusions
doesn't? ugh took me forever. thanks, never would have tried that –
Alchemize Look at the Inclusions/Exclusions Patterns documentation , and try this: sonar.exclusions=utility/Excel/**
.
Note: pointing sonar.sources to the current directory is usually a mistake, you should point it to the actual directories which contain the sources (more details in Analysis Parameters).
If your exclusions still not work, double check the location of the file that you are trying to exclude. SonarQube automatically defines 2 scopes for analysis: sonar.sources and sonar.tests.
If the file that you want to exclude is inside sonar.tests scope, then you should use sonar.test.exclusions
instead of sonar.exclusions
You can read more: here
Added for those who might need it
© 2022 - 2025 — McMap. All rights reserved.