Sonar.exclusions not working when added in sonar-project.properties for my spring boot project

We were using sonar-project.properties in which trying to add exclusions which were not getting excluded when we raised PR and when exclude them in pom.xml its working.

Could you please help us on this.

Hi,

Welcome to the community!

It sounds like you’re analyzing a Maven project(?) using the SonarScanner for Maven. That scanner doesn’t read sonar-project.properties. So, setting things in the pom is the right thing to do in this case.

 
HTH,
Ann

can’t we use sonar-project.properties?

Hi,

What analysis command are you using?

 
Ann

I really dont know what they configured. we do have a spring boot project of maven type. we were using sonar-project.properties. when we add exclusions in it and then raise pr on github, it is not excluding them. when we include them in pom.xml the coverage is increasing,

Hi,

Then no. You can’t use sonar-project.properties.

 
Ann