Search code examples
sonarqubecode-coveragesonarscanner

Difference between Sonarqube & SonarScanner


I'm using sonar & Jacoco for my Android application code coverage reporting. I could be successfully deploy it by setup jacoco task job & Sonar job & then following command.

./gradlew clean jacocoTestReport (name of jacoco task)
./gradlew sonarqube (<- mark this)

Report is successfully generated and showing to localhost:9000 sonar server setup.

I heard about sonar-scanner which is available to perform same task.

My confusion is what I should use sonar-scanner or sonarqube with gradlew command; How they mutually different from each other.


Solution

  • SonarQube is the central server holding the results of analysis.

    • SonarQube Scanner / sonar-scanner - performs analysis and sends the results to SonarQube. It is a generic, CLI scanner, and you must provide explicit configurations that list the locations of your source files, test files, class files, ...

    • SonarQube Scanner for Gradle / ./gradlew sonarqube - performs analysis and sends the results to SonarQube. You don't have to provide explicit configurations that list the locations of your various types of files because it gets that from your Gradle project.