Search code examples
sonarqubesonar-runner

How sonarqube works


I have a question that, how analysis happen in sonarqube. when I do mvn sonar:sonar -Dsonar.host.url=http://sonar.com what will happen in background. what I felt is like

  1. Maven will use some plugins and communicate with sonarqube server
  2. Load all the rules that it have in sonarqube server in location we run mvn sonar:sonar
  3. Analyze source code using set of rules we loaded from sonarqube server
  4. push it back to SonarQube database and results will be displayed on SonarQube server

Is this is the proper way that it works? or source code will go into sonarqube server and analysis will happen in sonarqube server itself?

Thanks for the help


Solution

  • You've got it mostly right:

    1. Maven will use some plugins and communicate with SonarQube server
    2. Load all the rules that it have in SonarQube server in location we run mvn sonar:sonar
    3. Analyze source code using set of rules we loaded from SonarQube server
    4. Calculate file-level metrics
    5. Read coverage reports if any
    6. Compile data into an analysis report and push it back to the SonarQube server
    7. The server pops the uploaded report from the queue, and integrates it, storing issues and calculating high-level metrics
    8. User sees updated project status on Project homepage