sonarqube

Getting started with sonarqube

Remarks#

This section provides an overview of what sonarqube is, and why a developer might want to use it.

It should also mention any large subjects within sonarqube, and link out to the related topics. Since the Documentation for sonarqube is new, you may need to create initial versions of those related topics.

Versions#

VersionRelease Date
6.42017-06-02
6.32017-03-14
6.22016-12-14
6.12016-10-13
6.02016-08-04
5.62016-06-08
5.52016-05-19
5.42016-04-01
5.32016-01-28
5.22015-11-26
5.12015-04-23
5.02015-01-28

Installation or Setup

Sonarqube uses database for storing its results and analysis. You can install MySQL for example and run it using mysql -u root -p and then run the following queries to set up the database tables.

CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'sonar' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar';
FLUSH PRIVILEGES;

then you need to download the sonarqube from their website, for example you can use wget to do it as shown below. Choose the appropriate sonarqube version required.

wget https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-5.6.zip

unzip sonarqube-5.6.zip
mv sonarqube-5.6 /opt/sonar

Open /opt/sonar/conf/sonar.properties with vim editor, and modify it as shown below.

sonar.jdbc.username=sonar
sonar.jdbc.password=sonar

sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance

these setup the database and the user name, password for that. To setup server on port 9000 add the below configurations

sonar.web.host=127.0.0.1
sonar.web.context=/sonar
sonar.web.port=9000

this sets up all the required configurations. now you can start the service using this command sudo /opt/sonar/bin/linux-x86-64/sonar.sh start. replace the start keyword with stop to shutdown the server.

for more information and configurations you can visit - https://docs.sonarqube.org/display/SONAR/Installing+the+Server


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow