代码质量检查工具 sonar

1. 下载,版本sonar 4.5.1

运行bin下的bat文件,浏览器中访问: http://localhost:9000 , 成功。

2. 修改数据库为mysql数据库

先在mysql中新建数据库sonar,用户sonar,远程访问ok后,编辑sonarqube-4.5.1\conf\sonar.properties, 如下:

sonar.jdbc.username=sonar
sonar.jdbc.password=sonar

sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance

3.汉化:

访问 http://docs.sonarqube.org/display/SONAR/Plugin+Library  ,找到Localization ,也就是http://docs.codehaus.org/display/SONAR/Localization

,下载到sonarqube-4.5.1\extensions\plugins目录下,重启sonar。

4. 修改maven安装目录下conf/setting.xml文件,添加

<profile>
         <id>sonar</id>
         <activation>
             <activeByDefault>true</activeByDefault>
         </activation>
         <properties>
             <sonar.jdbc.url>jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8</sonar.jdbc.url>
             <sonar.jdbc.driverClassName>com.mysql.jdbc.Driver</sonar.jdbc.driverClassName>
             <sonar.jdbc.username>sonar</sonar.jdbc.username>
             <sonar.jdbc.password>sonar</sonar.jdbc.password>
             <sonar.host.url>http://localhost:9000</sonar.host.url>
         </properties>
  </profile>

注: 我没有修改maven项目的pom.xml 。。。

5. 命令行运行

mvn clean install

mvn sonar:sonar

(注:装了插件,直接ctrl+M呼出命令行到文件目录),

然后等待Build success .

此时在http://localhost:9000就可以看到结果报告了,感觉还不错

sonar使用的更多相关文章

  1. 使用Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境(二)

    前言     上一篇随笔Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境(一)介绍maven和nexus的环境搭建,以及如何使用maven和nexus统一管理库 ...

  2. 使用Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境(一)

    前言     但凡一个略有规模的项目都需要一个持续集成环境的支撑,为什么需要持续集成环境,我们来看一个例子.假如一个项目,由A.B两位程序员来协作开发,A负责前端模块,B负责后端模块,前端依赖后端.A ...

  3. Sonar安装配置

    https://www.sonarqube.org/downloads/ 下载sonar.当前版本为6.2 解压压缩包,进行配置: 修改sonarqube-6.2\conf\sonar.propert ...

  4. 代码质量管理工具 sonar 配置

    代码检查工具有很多findBugs等等 sonar配置: 1.下载sonar 5.5, 解压,运行 sonarqube-5.5\bin\windows-x86-64\StartSonar.bat , ...

  5. 搭建sonar,推动代码质量管理

    最近比较关注devops相关的文章,尝试搭建sonarqube服务,进行代码质量的分析和管理,先记录下本地环境的搭建和分析过程. 一.sonarqube服务搭建 官网地址:http://www.son ...

  6. [转]配置sonar、jenkins进行持续审查

    本文以CentOS操作系统为例介绍Sonar的安装配置,以及如何与Jenkins进行集成,通过pmd-cpd.checkstyle.findbugs等工具对代码进行持续审查. 一.安装配置sonar ...

  7. iOS Sonar 集成流程

    https://gold.xitu.io/entry/5781e6872e958a0054c93368 作者:advancer_chen,原文链接:http://my.oschina.net/Chen ...

  8. SonarLint(Sonar) 代码质量管理

    一.Sonar是什么? Sonar是一个用于代码质量管理的开源平台,用于管理源代码的质量 通过插件形式,可以支持包括java,C#,C/C++,PL/SQL,Cobol,JavaScrip,Groov ...

  9. 【译】安装Sonar要求

    本文仅为本人看sonar官方文档时,因其为英文,故简单整理翻译[英语不好,见谅!] http://docs.sonarqube.org/display/SONAR/Requirements   目录 ...

  10. 利用Sonar规则结合WebStorm进行Code Inspect

    1.目的 在编写代码时会受到公司Sonar规则的限制,不想在编写完成后再对代码进行Inspect,回头再来一个个修正,费时费力. 那么,下面将通过优秀的WebStorm开发工具自身的CodeInspe ...

随机推荐

  1. 牛客算法进阶——树形dp

    1. 小G有一个大树(求树的重心) 删除该点后最大连通块的节点数最小 设f[x]表示以x为根的子树大小,那么删除x之后的各子树大小为f[to]和n-f[x] 求max(max(f[to]),n-f[x ...

  2. vue-pc项目放到电视tv上适配

    当部署屏幕小于开发屏幕大小的时候,我们通过transform:scale(0.8)对页面进行整体缩放,部署后不生效时,可以找到项目的index.html文件,将viewpoint这一行代码注释掉,或者 ...

  3. 【git】2.4 撤销操作

    资料来源 (1) https://git-scm.com/book/zh/v2/Git-%E5%9F%BA%E7%A1%80-%E6%92%A4%E6%B6%88%E6%93%8D%E4%BD%9C ...

  4. windos下激活python虚拟环境

    1.从终端中找到解释器的目录 2.cd到Scripts,输入激活命令activate  这样就表示激活成功了

  5. vue调接口导出表格

     props:{       form:{         type:Object,         default:()=>{}       },       indexNum:{       ...

  6. mi

    小米耳机页面 <style> * { margin: 0; padding: 0; } body { width: 1226px; background-color: #f5f5f5; m ...

  7. linux安装EMQ

    1.拉取Emqx包 wget https://www.emqx.com/zh/downloads/broker/4.2.14/emqx-centos7-4.2.14-x86_64.rpm 2.安装服务 ...

  8. mybatis-关联查询2-多对一关联查询

    或者多表单独查询方式

  9. 写于vue3.0发布前夕的helloworld之三

    接上,watcher构造函数: var Watcher = function Watcher (     vm,     expOrFn,     cb,     options,     isRen ...

  10. cmake 设置属性INTERFACE_INCLUDE_DIRECTORIES,则其它库可以直接 target_link_libraries?

    rs项目改为cpm下载 项目  leveldb 和 basiccache, basiccache依赖 leveldb,下载都是在主项目中, 设置 INTERFACE_INCLUDE_DIRECTORI ...