下载最新的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

最新文章

  1. Strus2学习记录整理【持续更新】
  2. python实验二:字符串排序
  3. HDU 2689Sort it 树状数组 逆序对
  4. 【Coding地址汇总】2016年沈航软工学生项目主页
  5. MEF 编程指南(六):导出和元数据
  6. Cassandra1.2文档学习(16)—— 模式的变化
  7. ruby gems安装镜像
  8. C#实现文件批量重命名源码下载
  9. 基于python的tagcloud
  10. js打印保存用户输入的内容
  11. SQL注入攻击[详解]
  12. 二分查找的变种(Java实现)
  13. 关于React Native项目在android上UI性能调试实践
  14. QT5版本添加icon图标步骤
  15. C# signtool error:no certificates were found that met all the given criteria 错误解决方案
  16. python: 序列化/反序列化及对象的深拷贝/浅拷贝
  17. html5 canvas画布上合成
  18. SSH-运行main函数,一直报空指针,调依赖注入配置的dao
  19. 计数排序与桶排序(bucket sort)
  20. C#异步编程的一些认识

热门文章

  1. python之文件系统操作(os模块)
  2. /include/caffe/common.cuh(9): error: function &quot;atomicAdd(double *, double)&quot; has already been defined
  3. AtCoder WTF 2019 C2. Triangular Lamps Hard
  4. map内置函数分析所得到的思路
  5. BZOJ3750[POI2015]Pieczęć——链表
  6. C# == 和 Equals
  7. 【 HDU1081 】 To The Max (最大子矩阵和)
  8. Azure Powershell script检测登陆并部署ARM Template
  9. Codeforces Round #510 (Div. 2)(B)
  10. PHP自动加载(__autoload和spl_autoload_register)