- Make sure you have homebrew installed in your machine, otherwise follow instrunctions at brew.sh.
- Open terminal, run
brew install sonar. Assuming brew installs SonarQube successfully, take a look at the last line of the terminal where the SonarQube location is printed. In my case it is
- Now run
brew install sonar-scanner(N.B. sonar-runner is no longer available, it’s replaced by sonar-scanner).
- After installation is complete, run the following commands consecutively:
export SONAR_HOME=/usr/local/Cellar/sonar-scanner/18.104.22.1687/libexec export SONAR=$SONAR_HOME/bin export PATH=$SONAR:$PATH[TODO: exporting path in this way will work for the current session of terminal, for permanent use, I need to transfer these path variables to .bashrc file.]
- Now we can run SonarQube from terminal by issuing this command
- Go to http://localhost:9000/ to view the main page of SonarQube. Use this credentials (username: admin, password: admin) to login.
References (deprecated a bit):