Sonar introduction and use of sonar for code quality management

Source: Internet
Author: User
Tags documentation git clone apache tomcat continuous integration tools

Sonar Overview

Sonar is an open platform for code quality management. Through the plug-in mechanism, Sonar can integrate different test tools, code analysis tools, and continuous integration tools.

Unlike continuous integration tools such as Hudson/jenkins, Sonar does not simply display different code-checking tool results (such as FINDBUGS,PMD, etc.) directly on a Web page, but instead process the results through different plug-ins. By quantifying the changes in the quality of the code, it is easy to do code quality management for different sizes and types of projects.

In support of other tools, Sonar not only provides support for the IDE, can view the results online in Eclipse and IntelliJ idea tools, but Sonar also provides interface support for a large number of continuous integration tools that can be easily used in continuous integration Sonar 。

In addition, Sonar Plug-ins can provide support for programming languages other than Java, as well as internationalization and reporting documentation.

Installation of Sonar

Sonar is an open source project above Codehaus, using LGPL V3 software license. We can download its source code and installation package on its official website.

Its source code needs to be checked out using a distributed version control software Git (check out), as follows:

git clone git://github.com/sonarsource/sonar.git

This article mainly introduces the use of Sonar, only to the Sonar Web site to download the latest release package, this article writing the latest version of 2.11.

After downloading the zip package, extract directly to any directory, because Sonar with the Jetty 6 application Server environment, so no additional installation can be used, it is worth mentioning that Sonar also support deployment in the Apache Tomcat application server.

In a Windows environment, start the Soanr bin directory directly under Windows-x86-64\startsonar.bat.

Then access in the browser: http://localhost:9000/

Figure 1. Sonar Access Interface

The Sonar is successfully installed and started, but there are no plug-ins installed, and users are required to download and install the plug-ins they need. This section takes Quality Index Plugin as an example of how to download and install the Sonar plug-in.

First visit Sonar home Dashboard > Sonar > Documentation > Sonar Plugin Library path

Figure 2. Download of the Sonar plugin

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.