美文网首页
开发环境sonarqube代码检查步骤

开发环境sonarqube代码检查步骤

作者: 枫棱 | 来源:发表于2019-01-09 14:41 被阅读0次
    1. 使用sonar账号登录172.17.213.2XX(切记不能用root)
    账号密码:sonar/sonar
    
    2. 下载代码
    cd /opt/bi_code/
    mkdir bi-wx-server
    svn checkout svn://svn.xxxx.cn:9999/bi-wx-server/Dev/trunk/bi-wx-server /opt/bi_code/bi-wx-server
    
    3. 编译代码
    cd /opt/bi_code/bi-wx-server
    mvn clean compile
    
    编译通过:
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] bi-wx-server 1.9.7-SNAPSHOT ........................ SUCCESS [ 0.199 s]
    [INFO] bi-wx-server-common ................................ SUCCESS [ 4.968 s]
    [INFO] bi-wx-server-dal ................................... SUCCESS [ 0.252 s]
    [INFO] bi-wx-server-service ............................... SUCCESS [ 1.229 s]
    [INFO] bi-wx-server-manager ............................... SUCCESS [ 0.478 s]
    [INFO] bi-wx-server-web 1.9.7-SNAPSHOT .................... SUCCESS [ 2.235 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 9.579 s
    [INFO] Finished at: 2019-01-09T14:25:12+08:00
    [INFO] ------------------------------------------------------------------------
    
    4. 使用sonarqube检查代码
    cd /opt/bi_code/bi-report-release
    mvn clean compile sonar:sonar
    编译通过:
    [INFO] Analysis report generated in 384ms, dir size=2 MB
    [INFO] Analysis reports compressed in 946ms, zip size=1 MB
    [INFO] Analysis report uploaded in 651ms
    [INFO] ANALYSIS SUCCESSFUL, you can browse http://172.17.213.205:9000/sonarqube/dashboard?id=com.wonhigh.wx%3Abi-wx-server
    [INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
    [INFO] More about the report processing at http://172.17.213.205:9000/sonarqube/api/ce/task?id=AWgxSvpx-bKeWuiMO1Pt
    [INFO] Task total time: 1:11.587 s
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] bi-wx-server 1.9.7-SNAPSHOT ........................ SUCCESS [01:14 min]
    [INFO] bi-wx-server-common ................................ SUCCESS [ 2.037 s]
    [INFO] bi-wx-server-dal ................................... SUCCESS [ 0.258 s]
    [INFO] bi-wx-server-service ............................... SUCCESS [  0.864 s]
    [INFO] bi-wx-server-manager ............................... SUCCESS [ 0.476 s]
    [INFO] bi-wx-server-web 1.9.7-SNAPSHOT .................... SUCCESS [ 0.972 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 01:19 min
    [INFO] Finished at: 2019-01-09T14:27:04+08:00
    [INFO] ------------------------------------------------------------------------
    
    5. 登录Sonarqube页面查看
    http://172.17.213.XXX:9000/sonarqube
    admin/admin
    

    相关文章

      网友评论

          本文标题:开发环境sonarqube代码检查步骤

          本文链接:https://www.haomeiwen.com/subject/uefgrqtx.html