Sonarqube Code Quality Management platform installation and use

Source: Internet
Author: User

1.sonar Installation 1.1 Environmental requirements

a). Jdk

Settings for Environment variables:

Java_home=d:\program files\java\jdk1.7.0_67\

Path=%java_home%\bin;%java_home%\jre\bin

Classpath=%java_home%\lib\dt.jar;%java_home%\lib\tools.jar

1.2 Sonar Installation

As a code analysis platform, sonar mainly consists of 3 parts:

A. A database: Storing configuration information and analysis results information; (MySQL)

B. A Web server: publishing applications, online browsing, configuration analysis (sonarqube-4.5.4)

C. One client: Performing source code analysis (sonar-runner-2.4)

1.2.1 Database Installation

Sonar supports database types such as Apache Derby,h2,sql Server,mysql.orcale.postgresql and many other databases, if only testing can be done using Sonar's own H2, or Derby. They don't need any installation.

If you use a different database, you just need to create a database or table space, and provide sonar to delete the database permissions to the account. The tables and indexes will be created the first time sonar runs.

Here we are using the MySQL database. Create the following statement:

CREATE DATABASE sonar CHARACTER SET UTF8 COLLATE utf8_general_ci;

CREATE USER ' sonar ' identified by ' sonar ';

GRANT all on sonar.* to ' sonar ' @ '% ' of ' identified by ' sonar ';

GRANT all on sonar.* to ' sonar ' @ ' localhost ' identified by ' sonar ';

FLUSH privileges;

1.2.2 Installing and configuring sonar

Download the relevant application under http://www.sonarsource.org/downloads/to unzip.

1.2.2.1 Sonar Install server-side sonarqube-4.5.4

1. Configure sonarqube-4.5.4

Edit the Conf/sonar.properties file under the Sonarqube decompression package, all of the annotated database connection templates in the file are supported, just remove the comment and change it to your own database connection. Also remove the default self-attached database connection annotations.

It is generally necessary to configure the properties:

Sonar.jdbc.url: Database connection Address

Sonar.jdbc,driver: Driver class

Sonar.jdbc.user: Database user name

Sonar.jdbc.password: Password

Figure 1.1:sonarqube Database Configuration

If you use the Orcale database, place the Orcale driver package under the Sonarqube-4.5.4\extensions\jdbc-driver \oracle folder, and the driver packages for the other databases are already placed under the default path.

2. start Sonarqube

Run the Startsonar.bat file under the E:\sonar\sonarqube-4.5.4\sonarqube-4.5.4\bin\windows-x86-64 file.

Sonarqube Code Quality Management platform installation and use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.