- What language is this for? Kotlin-based Gradle build file
- Which rule? Core plugins IDs should be replaced by their shortcuts [S6634]
- Why do you believe it’s a false-positive/false-negative? The
org.gradle.test-retry
plugin is in the core namespace, but is not actually a core plugin. If we follow Sonarqube’s advice, to use the “short name”, the build fails. - Are you using
- SonarQube Server / Community Build - which version?
v10.6 (92116)
- SonarQube Server / Community Build - which version?
- How can we reproduce the problem?
Within a gradle project’s build.gradle.kts
:
plugins {
id("org.gradle.test-retry") version "1.6.0"
}
This will build, but trigger the sonar issue.
On the other hand:
plugins {
id("test-retry") version "1.6.0"
}
will not trigger the sonar issue, but fails to build with an error like:
org.gradle.internal.exceptions.LocationAwareException: Build file '/path/to/build.gradle.kts' line: 6
Plugin [id: 'test-retry', version: '1.6.0'] was not found in any of the following sources:
- Gradle Core Plugins (not a core plugin. For more available plugins, please refer to https://docs.gradle.org/8.10.2/userguide/plugin_reference.html in the Gradle documentation.)
- Included Builds (No included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'test-retry:test-retry.gradle.plugin:1.6.0')
Searched in the following repositories:
Gradle Central Plugin Repository
at org.gradle.plugin.use.resolve.internal.PluginResolutionResult.getFound(PluginResolutionResult.java:113)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolvePluginRequest(DefaultPluginRequestApplicator.java:192)
at (...)