Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

A tutorial on using Sonar

Shulou Source: shulou.com Published: 2022-06-02 09:47:58 11月16日 Update

This article mainly explains "the use of Sonar tutorial", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the tutorial on the use of Sonar.

Sonarqube server

The installation process cannot be started with a root account. You must use an ordinary account such as esuser. After startup, an Elasticsearch instance will be launched automatically (the Elasticsearch instance is included in the Sonarqube installation package). If you misuse the root account to start sonar, you need to delete the temp folder under Sonarqube, otherwise you will not be able to start it all the time. Enter the address http://localhost:9000 to see the console interface.

Sonar Maven Settin

Add the address of Sonarqube under the profiles tag in Maven's setting.xml configuration file:

Sonar true http://192.168.17.137:9000 project dependencies

In the pom file of the R & D project / module, add the Sonar Maven plug-in under the build/plugins tag

Org.springframework.boot spring-boot-maven-plugin true org.sonarsource.scanner.maven sonar-maven-plugin 3.4.0.905 IDE start command

In the IDEA R & D environment, add Maven startup commands

Org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar

Such as screenshot: double-click to start code scanning

Code repair

On the Sonarqube console, you can view the classified suspected problems in the corresponding project, and fix them according to the above requirements and prompts. After the repair is completed, perform a new scan to see if the repair is complete. The above repair guidelines are relatively complete, so I won't repeat them here.

At this point, I believe you have a deeper understanding of the "tutorial on the use of Sonar". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Tutorials files accounts projects code content commands addresses examples tags faceted learning control practical general deeper interested practical practical screenshot Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Shulou Information MariaDB Huawei macOS