Install SonarQube on MacOSX
Steps:
- 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/usr/local/Cellar/sonarqube/7.1
. - 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/3.2.0.1227/libexec
export SONAR=$SONAR_HOME/bin
export PATH=$SONAR:$PATH
[Note: 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
/usr/local/opt/sonarqube/bin/sonar console
. - Go to http://localhost:9000/ (or appropriate port based on your system) to view the main page of SonarQube. Use this credentials (username: admin, password: admin) to login.
References (a bit deprecated):