Code Analysis with SonarQube

  1. Login the sonarqube, create a token. Also need to select the primary language (Java) and the build technology of the project (Maven).

  2. Add sonarqube maven plugin in project pom file

    1
    2
    3
    4
    5
    <dependency>
    <groupId>org.sonarsource.scanner.maven</groupId>
    <artifactId>sonar-maven-plugin</artifactId>
    <version>3.5.0.1254</version>
    </dependency>
  3. Execute below command from the root of our project directory to scan

    1
    mvn sonar:sonar -Dsonar.host.url=http://192.168.220.132:9000 -Dsonar.login=ac75fe70e38aa0a956cd8c2ccdfa282783cf9a0a
  4. Verify

唐胡璐 wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!
分享创造价值,您的支持将鼓励我继续前行!