SonarSource/sonar-scanning-examples

Exclude androidTest and test folder

mukkumukesh opened this issue · 3 comments

How can exclude androidTest and Test folder from sonar analysis. I tried this but not working the report error.
sonarqube { properties { property 'sonar.sources', "src/main/java" property 'sonar.exclusions', "/androidTest/**/*.java" } androidVariant 'devDebug' }

I am not write any test code that's why they return error when I am try to run ./gradlew sonarqube.

Can you please suggest me how can I ignore these folder from sonar.

ep4sh commented

I had a similar issue, did you know about

sonar-project.properties

file?
I founded it with option:

sonar.exclusions=src/**

Works great

In my case, I used "sonar.exclusions=/src/androidTest/". It might not support pattern "/androidTest/**/*.java"

This repo is only to show the basics of how to scan.
Opening an issue on that repo is not the right way to get tech support. Please go to https://community.sonarsource.com