Vladimir Voitekhovski
Vladimir Voitekhovski

Reputation: 1602

SonarRunner with gradle: Fail to download libraries from server

I have updated Sonar to the 4.5.1 LTS version, and now in my gradle task i have got the following error and can't fix it:

Fail to download libraries from server

build.gradle with sonar runner

sonarRunner {
 sonarProperties {
    property "sonar.host.url", "http://sonar:9000"
    property "sonar.login", ""
    property "sonar.password", ""
    property "sonar.jdbc.url", "jdbc:mysql://sonar"
    property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver"
    property "sonar.jdbc.username", "sonar"
    property "sonar.jdbc.password", "sonar"
    property "sonar.profile", "sonar"
    property "sonar.projectName", "sonar"
    property "sonar.language", "java"
    property "sonar.sources", "src/main/java"
    property "sonar.binaries", "build";
 }
}

i've tried to write this property, but nothing happend:

toolVersion = '2.3' // default

Upvotes: 3

Views: 3648

Answers (3)

Vampire
Vampire

Reputation: 38734

As said before, recent SonarQube versions need Gradle 2.2 on client side.

If you cannot or do not want to update your used Gradle version, you can easily copy the Gradle Sonar Runner plugin to your buildSrc project with some slight modifications to not depend on Gradle Injection which does not work for a custom plugin.

I just did this for our project that is still using Gradle 1.12 and it works great.

Upvotes: 0

Vladimir Voitekhovski
Vladimir Voitekhovski

Reputation: 1602

As a work around, i've installed sonar-runner, and analyzing my gradle project now via sonar-runner 2.4.

Upvotes: 0

Peter Niederwieser
Peter Niederwieser

Reputation: 123968

Recent Sonar versions require Gradle 2.2. (2.1 might also work but I'm not sure.)

Upvotes: 6

Related Questions