sonar和gradle集成

在build.gradle中添加如下配置

  1. 旧插件 apply plugin: 'sonar'
    sonar { server { url = "http://locahost:9000" } database { url="jdbc:mysql://locahost:3306/sonar?useUnicode=true&characterEncoding=utf8" driverClassName="com.mysql.jdbc.Driver" username="sonar" password="sonar" } }

命令: gradle clean build sonarAnalyze 可能的错误:

  • What went wrong: Execution failed for task ':sonarAnalyze'.

org.sonar.batch.bootstrapper.BootstrapException: Fail to download the file: http://locahost:9000/batch/sonar-batch-maven-compat-5.1.jar|3bf6a6eba33643805149fd9ad258744e

  1. 新插件 apply plugin: 'sonar-runner'
    sonarRunner { sonarProperties { property "sonar.host.url", "hhttp://locahost:9000" property "sonar.jdbc.url", "jdbc:mysql://locahost:3306/sonar?useUnicode=true&characterEncoding=utf8" property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver" property "sonar.jdbc.username", "sonar" property "sonar.jdbc.password", "sonar" property "sonar.language", "java" property "sonar.sources", "src" property "sonar.binaries", "build"

     // There is a problem when using "standard-project-layout:Sample Project" (by default)
     // because of the wide space
      property "sonar.projectKey", "jstinno:Mirror"
    

    } }

    命令: gradle clean build sonarRunner 可能错误:

    • What went wrong: Execution failed for task ':sonarRunner'.

Could not resolve all dependencies for configuration ':sonarRunner'. Could not find org.codehaus.sonar.runner:sonar-runner-dist:2.3. Searched in the following locations: file:/home/android/soft/android-sdk/extras/android/m2repository/org/codehaus/sonar/runner/sonar-runner-dist/2.3/sonar-runner-dist-2.3.pom

转载于:https://my.oschina.net/hopeMan/blog/413433

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值