Code check | unit check |sonar code spec check | Java code self-test |sonarqube7.4

Code check | unit check |sonar code spec check | Java code self-test |sonarqube7.4

Posted by LY on November 7, 2018

The first step is to download the latest version of sonarqube7.4

1.Official download address,Download community edition, is open source free.

2.I do not know what reason I download particularly slow on the official website, probably because of the lack of resources.So I put an alternate link here,Of course, this link is a resource link of CSDN, which requires a certain amount of credits.

3.Click the link above to follow my CSDN and Jane book, and send me the screenshot of the private letter for free download.

The second step, of course, is to unzip and start the service

  1. After decompression, as shown in the
  2. Open the bin directory and select the appropriate folder for your current operating systemiTDOVP.png
  3. Start the corresponding service initiator

Step 3 visit the sonar server through a browser

1.Open your browser and go to :9000.

2.Click the login button on the right to log in. The default account password is admin。

3.This is the completion of service startup。

The fourth step is configuration

  1. Open the configuration file, which is located in conf under the sonar directory, open the sonar. Properties file and add the following code

  2. Configure maven, open maven’s setting.xml file, find the node and add the following code to the node.

                    <!-- your_sonar_host是你的服务器地址,如果你的服务在本机则使用localhost -->

Step 5 open the project and check the code

  1. If you are using idea, just follow the following picture


2.If not, go to the project root directory and use the shell tool to enter the MVN command shown above

Step 6 is to see the results

  1. After the command runs, you can view the progress in the server and open http://localhost:9000 to enter the server. Follow the steps in the figure below.


  2. Next, you can freely check your own code bugs, vulnerabilities, odors. Adjust your code!!!