Running Sonar from command line without a SonarQube server

Edmondo1984 picture Edmondo1984 · Jan 27, 2016 · Viewed 11.4k times · Source

I need to perform some static analysis of java classes from command line To extract basic metrics and I was thinking I could use sonar-cli, but that required a fully working SonarQube.

How can I perform those inspections?

Answer

Fabrice - SonarSource Team picture Fabrice - SonarSource Team · Jan 27, 2016

If you want to get the metrics on your code, then there's no other choice than installing a SonarQube server and indeed run an analysis using a SonarQube scanner.

By the way, installing a SQ server for such a simple use case is as simple as extracting the binaries from the ZIP archive and double-click on the sonar.sh or sonar.bat scripts. See "Get Started in Two Minutes" documentation page.