Deprecated dependency when running gradle sonarqube

Hi @swiss-api-builder,

Thanks for your message. The problem is that if you’re using the Gradle scanner and its execution task actually depends on the compile tasks. This way, you will always build a project before analyzing it when executing sonarqube task. We still have discussions about whether it’s a good approach or not.

For now, you can try to exclude compile tasks (compileJava, compileTestJava, compileKotlin, etc…). Another possible solution could be to use is to add target and source compatibility in your grade configuration:

java {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}

Note, there were already some threads about this issue, so you can find some more information there:

Regards,
Margarita