Gradle cannot resolve dependencies for Sonar-Runner

I am trying to configure Sonar-Runner using my existing gradle project. I am using Sonar-Runner 2.4 gradle 2.2.1, and our Sonar server is 4.3.1. When I run gradle sonarRunner, I get the following error:

Failed to resolve all dependencies for configuration: sonarRunner. The external dependency org.codehaus.sonar.runner: sonar-runner-dist: 2.4 cannot be resolved because no repositories are defined.

I have the artifact "org.codehaus.sonar.runner: sonar-runner-dist: 2.4" on my connector server that is configured in my build.gradle file. Does anyone have an intuition about this error? I looked into it many times and got stuck on it for a couple of hours.

My build.gradle for runner sonar is very simple:

apply plugin: 'sonar-runner" sonarRunner{ toolVersion = '2.4' sonarProperties{ property "sonar.host.url", "$sonarHost" } } 
+6
source share
1 answer

It seems the repository has not been announced for the project you want to use with the sonar plugin. Perhaps you have configured repositories for buildscript or only for other projects (in your assembly of multiprojects?)

To enable sonar, you need to set up a repository where it can be enabled. You can have a corporate repository in your company, or you can use public ones, for example, mavencentral or bintray. declare, for example, a jcenter repository to resolve sonar. just add the following to your build script:

 repositories { jcenter() } 
+12
source

Source: https://habr.com/ru/post/980546/


All Articles