我已经配置了gradle和sonar插件:
apply plugin: 'sonar'
// sonar settings - gradle-1.0-milestone-3 2 - check new sonar plugin for milestone 5 release
sonar {
server {
Url = "http://myserver:9000"
}
database {
url="jdbc:mysql://myserver:3306/sonar?useUnicode=true&characterEncoding=utf8"
driverClassName="com.mysql.jdbc.Driver"
username="usrname"
password="pwd"
}
}
当我跑
时gradle -debug sonarAnalyze
我得到了:
09:42:25.074 [ERROR] [org.gradle.BuildExceptionReporter] ... 53 more
09:42:25.074 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.net.ConnectException: **Connection refused: connect**
09:42:25.074 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.bootstrapper.Bootstrapper.remoteContent(Bootstrapper.java:123)
09:42:25.075 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.bootstrapper.Bootstrapper.downloadBatchFiles(Bootstrapper.java:156)
09:42:25.075 [ERROR] [org.gradle.BuildExceptionReporter] ... 65 more
09:42:25.075 [ERROR] [org.gradle.BuildExceptionReporter]
09:42:25.075 [LIFECYCLE] [org.gradle.BuildResultLogger]
09:42:25.076 [LIFECYCLE] [org.gradle.BuildResultLogger] **BUILD FAILED**
09:42:25.076 [LIFECYCLE] [org.gradle.BuildResultLogger]
09:42:25.076 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 5.59 secs
可能是什么问题? 感谢
答案 0 :(得分:1)
server.url
拼写错误;它需要是一个小写u
。除此之外,它可能是错误的URL或错误的网络配置。或者您使用的Sonar服务器版本与Gradle 1.0-milestone-3附带的Sonar客户端库不兼容。
顺便说一下,Gradle 1.0-milestone-3真的很旧(18个月左右),从那以后发生了很多变化。我建议尝试使用1.0。