Issues With Exclusions

exclusions

(Sergio Vargas) #1

I have the following in a sonar-project.properties file for exclusions in an android project.

sonar.exclusions=**/*.png,**/*.xml,src/**/*Constants.java,src/**/*Module.java,src/**/*Component.java,src/**/*Contract.java,models/**

however, files ending in Module.java and Component.java aren’t being ignored from coverage scans. Anybody have any insight? thanks in advance!


(G Ann Campbell) #2

Hi,

I suspect the problem is your initial “src/”. Try dropping it; it should be covered by **/ anyway.

 
Ann


(Sergio Vargas) #3

Thanks for the response. I actually use to have it without the src/, but that didn’t work either. The src add was in an attempt to give it a more relative/ grounded path.


(G Ann Campbell) #4

Hi,

Where/how have you specified these exclusions?

 
Ann


(Sergio Vargas) #5

I have them in sonar-project.properties which is added as follows in a step in a circle 2.0 config

sonar-scanner -Dproject.settings=sonar-project.properties;

also have the following other properties

sonar.projectBaseDir=app/
sonar.sources=src/main/

sonar.pullrequest.base=develop
sonar.pullrequest.provider=GitHub

sonar.binaries=build/intermediates
sonar.java.binaries=build/intermediates
sonar.tests=src/test/java
sonar.java.test.binaries=build/intermediates

sonar.junit.reportsPath=build/test-results/testDebugUnitTest/
sonar.android.lint.report=build/reports/lint-results.xml

(G Ann Campbell) #6

Hi,

Is your xml exclusion working? Also, could you try removing your exclusions from your analysis properties and specifying them in the UI instead (Project Administration > General Settings > Analysis Scope)?

 
Ann