我想把Gradle (2.1版)和SonarQube (4.5.4lts)连接起来,但是有一个例外
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':<myProject>:sonarAnalyze'.
> java.io.IOException: Server returned HTTP response code: 400 for URL: http://localhost:9000/batch/
* Try:
Run with --debug option to get more log output.与此相关的Post应该是可能的,而here可能是相关解决方法的Bug。
但是我该如何使用它呢?将压缩包解压到项目中,然后从压缩文件中导入build.gradle中的行,这对我来说是不起作用的:( (没有区别)。
Build.gradle中的声纳配置:
apply plugin: "sonar"
sonar {
server {
url = "http://localhost:9000"
}
database {
url = "jdbc:mysql://localhost:3306/sonar"
driverClassName = "com.mysql.jdbc.Driver"
username = "sonar"
password = <myPassword>
}
}
apply plugin: 'sonar-runner'
sonarRunner {
sonarProperties {
property 'sonar.host.url', 'http://localhost:9000'
}
}提前感谢:)
注: Gradle和Sonarqube工作得很好。
发布于 2015-07-02 22:03:49
声纳插件是deprecated
您可能希望使用新的Sonar Runner插件,而不是此插件。特别是,只有Sonar Runner 插件支持Sonar 3.4和更高版本。
apply plugin: "sonar-runner"
sonarRunner {
sonarProperties {
property "sonar.host.url", "http://localhost:9000"
property "sonar.jdbc.url", "jdbc:mysql://localhost:3306/sonar"
property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver"
property "sonar.jdbc.username", "sonar"
property "sonar.jdbc.password", "<myPassword>"
}
}发布于 2015-07-03 18:11:38
事实上,Gradle发行版中的两个SonarQube插件现在已被弃用。请参阅下面来自Gradle团队的官方消息:https://twitter.com/gradle/status/613530568655966208。只能使用由SonarSource团队直接维护的新版本:http://docs.sonarqube.org/display/SONAR/Analyzing+with+Gradle
https://stackoverflow.com/questions/31185899
复制相似问题