maven+sonarqube测试代码质量

前提:安装好sonarqube 参考教程《linux下安装sonarqube5.6.6》


测试过程

①.修改本地maven的settings.xml <profiles></profiles>节点中添加如下配置:
[html]  view plain  copy
  1. <profile>  
  2.     <id>sonar</id>  
  3.     <activation>  
  4.         <activeByDefault>true</activeByDefault>  
  5.     </activation>  
  6.     <properties>  
  7.         <!-- Example for MySQL-->  
  8.         <sonar.jdbc.url>  
  9.             jdbc:mysql://192.168.17.168:3306/sonarqube?useUnicode=true&characterEncoding=utf8  
  10.         </sonar.jdbc.url>  
  11.         <sonar.jdbc.username>root</sonar.jdbc.username>  
  12.         <sonar.jdbc.password>123456</sonar.jdbc.password>  
  13.         <!-- Optional URL to server. Default value is http://localhost:9000 -->  
  14.         <sonar.host.url>http://192.168.17.168:9090/sonarqube</sonar.host.url>  
  15.     </properties>  
  16. </profile>  


②.随便找一个类,故意搞两个bug

  
③右击项目,按照如图操作

  
④成功执行完分析命令后便可到 Web Server 中查看代码质量分析结果数据


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值