sonar:sonar performs the analysis and sends the results to the server - if you use it with an account token that has the appropriate privileges.
Developers do not have to run this type of analysis locally to verify their changes. Instead, they should use SonarLint and, possibly, analysis of the choice request (depending on your infrastructure).
Expand a little about why developers should not use sonar:sonar locally: it updates the central server using the last saved win method. Therefore, if you edited A.java and analyzed it locally before committing, and I renamed A.java to B.java and did a similar local pre-commit analysis ... what is visible on the SonarQube server? Depends on who saved / analyzed the latter.
Instead, sonar:sonar should only be run from your CI tool with a registration code that is already displayed to the entire team.
G. Ann - SonarSource Team
source share