Install SonarQube Scanner

After installing SonarQube server, you need to install SonarQube Scanner. This is a tool used to analyze our code and report the result to the SonarQube server, then SonarQube server will use this report to display to the user. In this tutorial, I will guide you to install this tool.

First, you need to download the installation file of SonarQube Scanner.

Its installation file can be downloaded here. SonarQube Scanner has many different versions support for Window, Linux, MacOS environment. Currently, I am using macOS so I will download the installation file of SonarQube Scanner support for this environment.

After downloading, please unzip this file:

Install SonarQube Scanner

Next, you need to configure the SonarQube server, which will report the results to you.

Open the sonar-scanner.properties file located in the /conf directory of the unpack directory and edit the “sonar.host.url” property. By default, this value will be “http: // localhost: 9000”.

If your SonarQube server information is different from this one, then uncomment the property and revise it accordingly.

Finally, to be able to use the SonarQube Scanner anywhere in your machine, you need to set the environment variable pointing to the bin directory of the SonarQube Scanner directory.

I am currently using macOS so I will configure the following in the .bash_profile file in the user directory as follows:

To check the result, you can run the following statement:

Install SonarQube Scanner

Đánh giá bài viết
Chia sẽ bài viết này ...Share on Facebook
Facebook
0Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin

Add Comment