zoukankan      html  css  js  c++  java
  • CentOS6.8配置SonarQube Scanner配合SonarQube使用

    下载最新的SonarQube Scanner压缩包 
     
    1 解压缩到CentOs目录下 我的是 /usr/local/software/sonar-scanner-3.0.3.778-linux
    2 <install_directory>/conf/sonar-scanner.properties:  修改对应配置文件
       根据具体的你的URL 如果配置了sonar的context端口后还需要加上Context路径     
            #----- Default SonarQube server
            #sonar.host.url=http://localhost:9000
    3 Add the <install_directory>/bin directory to your path.  加入到环境变量 
        执行sonar-scanner命令出现下面表示安装成功
                usage: sonar-scanner [options]
                Options:
                     -D,--define <arg>     Define property
                     -h,--help             Display help information
                     -v,--version          Display version information
                     -X,--debug            Produce execution debug output
     
     
    4 使用sonar scanner   在项目根目录下创建sonar-project.properties文件
            Create a configuration file in the root directory of the project: sonar-project.properties
             sonar-project.properties
                关键配置  projectName 项目名 sources源代码目录
    # must be unique in a given SonarQube instance
    sonar.projectKey=my:project
    # this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
    sonar.projectName=My project
    sonar.projectVersion=1.0
    # Path is relative to the sonar-project.properties file. Replace "" by "/" on Windows.
    # This property is optional if sonar.modules is set.
    sonar.sources=.
    # Encoding of the source code. Default is default system encoding
    #sonar.sourceEncoding=UTF-8
     
     

    5 在sonar-project.properties所在目录 也就是 项目根目录 执行sonar-scanner就可以扫描了
    6 如果没有问题 就可以再sonar的web界面看到扫描结果了

    SonarQube的配置详见 http://www.cnblogs.com/QuestionsZhang/p/7115116.html

  • 相关阅读:
    hdu 5646 DZY Loves Partition
    bzoj 1001 狼抓兔子 平面图最小割
    poj 1815 Friendship 最小割 拆点 输出字典序
    spoj 1693 Coconuts 最小割 二者取其一式
    hdu 5643 King's Game 约瑟夫环变形
    约瑟夫环问题
    hdu 5642 King's Order
    CodeForces 631C Report
    1039: C语言程序设计教程(第三版)课后习题9.4
    1043: C语言程序设计教程(第三版)课后习题10.1
  • 原文地址:https://www.cnblogs.com/QuestionsZhang/p/7115224.html
Copyright © 2011-2022 走看看