Plugin with id 'org.sonarqube' not found

Hi,

I want to use sonarqube on my project, thus I tried to use sonarqube plugin as described here:

Unfortunately, I am getting “Plugin with id ‘org.sonarqube’ not found.” error …

It seems that the plugin is not available on https://plugins.gradle.org/m2/

I guess the sources are here:

But they are even not tagged with any version yet.

The questions are:

  1. is there any quality assurance with plugins.gradle.org?
  2. anyone having a success with the latest sonarqube?

Thank you in advance,
M.

Hi @marmax,

In my environment, the plugin(version 1.0) can be downloaded and Gradle project apply the plugin.

From your post, I cannot find the cause of your error, would you ran gradle with --stacktrace?

I had the same problem and solved it by properly adding the repository and the dependency as described in the link you provided:
repositories {
maven {
url “https://plugins.gradle.org/m2/
}
}
dependencies {
classpath “org.sonarqube.gradle:gradle-sonarqube-plugin:1.0”
}

I still see the same problem (plugin not found) in spite of having the configuration as suggested in this link

I have the right maven repo config as well.

However I see that the link to m2 repo - https://plugins.gradle.org/m2/ is pointing to a non existent page. What’s the right one ?

Please help!

I just tried to reproduce this issue but can’t. Do you still face this issue?

The m2 repo https://plugins.gradle.org/m2/ is a valid repository. It just misses a landing page. This will be fixed soon(ish)

Hi @Rene,

https://plugins.gradle.org/m2/ is correctly redirecting to https://jcenter.bintray.com. But the full path to the plugin does not exist and causes the failure. https://jcenter.bintray.com/org/sonarqube results in > The requested path was not found. I have reverted back to the sonar-runner plugin in the meantime since it’s unavailable from the remote repo.

Thanks,
Daren

I am also facing the same issue.

https://plugins.gradle.org/m2/ is redirecting to https://jcenter.bintray.com.
And there’s nothing with this coordinate org.sonarqube.gradle:gradle-sonarqube-plugin:1.x.

Is the gradle plugin repository moved to some other location??

Thanks,
Pravin

https://plugins.gradle.org/m2/ is not redirecting to bintray. you should
be able to find the plugin when searching for it via plugins.gradle.org
along with information how to apply it in your build.

Hi @Rene,

Okay, https://plugins.gradle.org/m2/ is not redirecting however, when you try to browse https://plugins.gradle.org/m2/org/sonarqube/gradle/gradle-sonarqube-plugin/, it redirects to https://jcenter.bintray.com/org/sonarqube/gradle/gradle-sonarqube-plugin/.

Hi Guys,

we have the same problem. When i am using the code snippet from the sonar plugin site ( Gradle - Plugin: org.sonarqube ) , the gradle build fails with the following Stacktrace:

FAILURE: Build failed with an exception.

  • Where:
    Script (Path to Script) line: 14

  • What went wrong:
    A problem occurred evaluating script.

Plugin with id ‘org.sonarqube’ not found.

We just figured out, that the gradle package is missing in

https://jcenter.bintray.com/org/sonarsource/scanner/

Can you please publish/republish the necessary artifacts for the gradle sonar scanner plugin?

I had the same issue today. I couldn’t fetch the sonarqube plugin within my gradle build. Thats why I searched the JIRA issues of the project.

Theres an issues regarding this problem:
https://jira.sonarsource.com/browse/SONARGRADL-15

After some discussion with the developer we found out, that using the new plugin syntax is working, but the old syntax is not.

Does anybody has an idea, what could cause this strange behaviour?

UPDATE/SOLUTION: The old syntax is also working, but you cannot use the plugin id if you are using the plugin in an script that was included using
apply from: 'yourScriptUsingThePlugin.gradle'

Instead you have to use the PluginClass like that:

buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies { classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.0.1" }
}

// To apply a third-party plugin from an external build script,
// you have to use the plugin's fully qualified class name, rather than its ID
apply plugin: org.sonarqube.gradle.SonarQubePlugin

I hope this helps other users getting the same error message.

4 Likes

Thank you !! Indeed it helped.
In a single build.gradle, the plugin is resolved. In a script included with the ‘apply from:’ syntax, it’s not.
The strange thing is that the debug traces show that the plugin is found:

[org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 14: acquired lock on root.1.2.3
[org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve sonarqube-gradle-plugin.jar (org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2)' started
[org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve sonar-scanner-api.jar (org.sonarsource.scanner.api:sonar-scanner-api:2.9.0.887)' started
[org.gradle.cache.internal.DefaultCacheAccess] Creating new cache for metadata-2.58/module-artifact, path C:\Users\gerald\.gradle\caches\modules-2\metadata-2.58\module-artifact.bin, access org.gradle.cache.internal.DefaultCacheAccess@295a0c89
[org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache module-artifact.bin (C:\Users\gerald\.gradle\caches\modules-2\metadata-2.58\module-artifact.bin)
[org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Found artifact 'sonarqube-gradle-plugin.jar (org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2)' in resolver cache: C:\Users\gerald\.gradle\caches\modules-2\files-2.1\org.sonarsource.scanner.gradle\sonarqube-gradle-plugin\2.6.2\c6e2da4c6dd1bccab1753ca1faa9b33688339fb6\sonarqube-gradle-plugin-2.6.2.jar
[org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Resolve sonarqube-gradle-plugin.jar (org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2)'
[org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve sonarqube-gradle-plugin.jar (org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2)' completed
[org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.2.3 completed (1 worker(s) in use)
[org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Found artifact 'sonar-scanner-api.jar (org.sonarsource.scanner.api:sonar-scanner-api:2.9.0.887)' in resolver cache: C:\Users\gerald\.gradle\caches\modules-2\files-2.1\org.sonarsource.scanner.api\sonar-scanner-api\2.9.0.887\daf561ff8b9d3f83bbd2080c44083147426dc9ae\sonar-scanner-api-2.9.0.887.jar
[org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 14: released lock on root.1.2.3

Thank you anyway :slight_smile: