Sonar: Multiple branches of a project, how to differentiate the results of statistical code checks _jenkins

Source: Internet
Author: User

How do different code branches do code analysis on Sonar? For example, one project has three branches of master, MySQL, and Xiangxiang, and 3 code-checking jobs are built on Jenkins, which is expected to be shown separately from the three-branch code-checking results area. But sonar will count the results of 3 branches into a single project, and not be divided into 3 project statistics.

So how to solve this problem. Often found in the sonar management system has a "update identity" function, using this feature can achieve 3 branches 3 code inspection results. Here's a picture demo.

(1) The name of the project in the pom.xml of three branches is modified to the name of each branch, such as the Xiangxiang branch modified to Hbgms_xiangxiang.



(2) Create a new code check job in Jenkins, execute a job, find the result statistic in sonar, click in



(3) Click "Configure"-> "Update Logo"



(4) Change the identity from the package name to the project name, as shown below



(5) Other branches of the code check also follow this operation, you can complete. The effect of the following figure


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.