代码检查工具有很多findBugs等等

sonar配置:

1、下载sonar 5.5, 解压,运行 sonarqube-5.5\bin\windows-x86-64\StartSonar.bat , 正常可以启动

2、配置 mysql 数据库, 打开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

创建sonar用户密码以及 sonar数据库,数据库必须InnoDb。

3、配置maven

打开maven的settings.xml文件,profiles节点下添加

    <profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- Optional URL to server. Default value is http://localhost:9000 -->
<sonar.host.url>
http://localhost:9000
</sonar.host.url>
</properties>
</profile>

在maven项目下运行

mvn clean verify sonar:sonar

# In some situation you may want to run sonar:sonar goal as a dedicated step. Be sure to use install as first step for multi-module projects
mvn clean install
mvn sonar:sonar # Specify the version of sonar-maven-plugin instead of using the latest. See also 'How to Fix Version of Maven Plugin' below.
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar

4、打开 http://localhost:9000/

另外现在人都用git、Jenkins自动化部署了,中间加入Gerrit自动化代码审查就构成了完整的CI系统

参考:

  1、使用 Sonar 进行代码质量管理 https://www.ibm.com/developerworks/cn/java/j-lo-sonar/

  2、http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Maven

  3、CI 系统搭建:五. GitLab、Gerrit、Jenkins 三者整合 http://blog.csdn.net/tantexian/article/details/42239025

最新文章

  1. 两个本地(localhost)html文件之间的传值
  2. win7共享文件夹给局域网
  3. linux下安装pymssql
  4. BZOJ3742 : Painting
  5. Mac 加密软件
  6. 夺命雷公狗-----tp中遇到数据乘积的问题的遇见
  7. 理解C# Attribute
  8. 不支持的关键字:“provider connection string”报错信息及解决方案
  9. ASP.NET Core中使用Razor视图引擎渲染视图为字符串
  10. AutoCompleteTextView ArrayAdapter
  11. 2010多校第一题 hdu3440House Man 差分约束系统
  12. Codeforces 443 B. Kolya and Tandem Repeat
  13. [转]python单元测试unittest
  14. nginx简单安装设置
  15. J2EE相关概念,EJB/JNDI/JMS/RMI等
  16. GWAS群体分层校正,该选用多少个PCA
  17. DataSource - 常用数据库连接池 (DBCP、c3p0、Druid) 配置说明
  18. 20155226《网络攻防》 Exp3 免杀原理与实践
  19. request Dispatch
  20. javap -- Java 类文件解析器

热门文章

  1. [WPF系列]Button 自定义
  2. MVC架构学习之EasyFirst——快点夸我爱学习~
  3. maven私服搭建
  4. jQuery ui 框架
  5. dwarf格式解析
  6. ubuntu12.04中shell脚本无法使用source的原因及解决方法
  7. JS当心隐式的强制转换
  8. ES5基础之正则表达式01:初次见面
  9. IPv4组播通信原理
  10. Scrapy的中Css 选择器