• Sonar入门(二): Maven集成Sonar


    Sonar对maven提供了简单可配的支持,要做的事情很简单——在maven/conf下settings.xml <profiles></profiles>标签之间添加如下内容:

     
     

        <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.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver>

            <sonar.jdbc.username>sonar</sonar.jdbc.username>

            <sonar.jdbc.password>sonar</sonar.jdbc.password>

            <sonar.host.url>http://localhost:8384</sonar.host.url>

          </properties>

        </profile>

     

     

     

     

     

     

     

     

    这样maven已经集成了sonar。进入maven项目,执行mvn clean install,然后执行mvn sonar:sonar,就会执行静态代码检查(包括checkstyle、pmd)、覆盖率报告分析、代码行数统计,并插入到sonar依赖的数据库中。

    以test为例:

    a.        svn co https://svn.test.com/inf/computing/trunk/test

    b.        cd ark && sh -ex build.sh# 执行编译测试

    c.        cd arkproject && mvntest # 执行单元测试

    d.        mvn sonar:sonar # 将执行静态代码检查+覆盖率分析+代码行数统计


  • 相关阅读:
    Linux 高性能server编程——高级I/O函数
    中国儿童移动游戏市场解读 潜力巨大有待开发
    HDU 2152 Fruit (母函数)
    Currying vs Partial Application
    我的最爱Lambda演算——开篇
    函数式编程-数据结构+算法
    高阶函数 、高阶类型
    高阶函数-哈哈
    备份-泛函编程(23)-泛函数据类型-Monad
    高阶函数
  • 原文地址:https://www.cnblogs.com/riskyer/p/3339397.html
Copyright © 2020-2023  润新知