sonar-pmd icon indicating copy to clipboard operation
sonar-pmd copied to clipboard

Make sonar-pmd compatible with SonarQube 10.4 'DownloadOnlyWhenRequired' feature

Open ganncamp opened this issue 5 months ago • 1 comments

SonarQube 10.4 will come with a feature to only download plugins when they are required. When there are files corresponding to the language handled by the plugin, the plugin will be downloaded, otherwise, the plugin won't be downloaded. This is great to save network bandwidth and speed up the bootstrap of the scans. This feature will be disabled by default to let the time to plugin maintainers to adjust their plugin. It will be activated by default with SonarQube 10.5

For plugins that have a dependency on a base analyzer provided by default with SonarQube, an additional property is required to be added to the MANIFEST of the plugin. By doing so you will avoid being in this situation:

sonar-pmd is downloaded because it doesn't support the new property so it is downloaded from the server at each scan sonar-java is not downloaded because there are no .java files in the repo to scan a NoClassDefFoundError is thrown In order to avoid that you need to:

upgrade sonar-packaging-maven-plugin to https://github.com/SonarSource/sonar-packaging-maven-plugin/releases/tag/1.22.0.705 add <requiredForLanguages>java</requiredForLanguages>

ganncamp avatar Feb 02 '24 14:02 ganncamp