PMD Plugin causes Sonar maven to fail with Sonarqube 10.2

Sonarqube: 10.2
Maven Plugin: 3.10.0

After updating to Sonarqube 10.2 the maven plugin does not work anymore. We updated the maven plugin from version 3.9 to 3.10, but it doesn’t help

Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.10.0.2594:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.10.0.2594:sonar: java.lang.NoSuchMethodError: 'org.sonar.api.rules.RulePriority org.sonar.api.rules.RulePriority.valueOfString(java.lang.String)'
10:32:20  [ERROR] -----------------------------------------------------
10:32:20  [ERROR] realm =    plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.10.0.2594

Please help, this breaks the whole build pipeline

Looks like this is due to other plugins like findbugs or PMD, have to find the guilty one

PMD plugin has an issue for it:

Too bad that the whole analysis breaks when one plugin has an exception

hint hint :blush: :point_right: Restriction of the download of scanner plugins to those that are essentially needed - #12 by daniel

context: that would create a temporary workaround in case incompatibilities are the reason for hiccups

@reitzmichnicht maybe you could change the title of your OP to reflect that not maven is the cause but the plugin-hiccups?

Thats not basically the problem, I just had to deactivate the PMD rules in the quality profile to get around that error.
What I do not understand is that we did not had this issue with Sonarqube 10.1 and I would not expect that deprecated API changes happen with minor versions.

Hi all,

Thanks for this discussion. I’ve updated the Marketplace to end PMD’s compatibility at 10.1. But in fact, I’m wondering if it doesn’t end earlier. Looking through Jira, I can’t find any relevant-looking API changes in 10.2, but a number of deprecated fields &etc got dropped in 10.1.

Did anyone successfully use PMD with 10.1? 10.0?

Because the updated deprecation policy specifies that

Everything deprecated during an LTS cycle will be kept until the next LTS is released. So anything deprecated in a 9.x version (9.0, 9.1, 9.2…) will be kept until 9.x LTS is released, and then dropped in 10.0.

As it actually happened, a number of things weren’t dropped in 10.0 but were held over to be dropped in 10.1 for… reasons.

 
Thx,
Ann

Hmmm :thinking: :nerd_face: (just kiddin’)

Michael @reitzmichnicht , i just wanted to add/refine: There is a “lingering design decision”, imo:

Do you want to mitigate this by editing your Qualityprofile (QP) or do you want to mitigate by deactivating the process that tries to use your QP. (as someone “who wants to keep the machine running”, i presume you would want a coarse wedge. maybe you can read the logs but are not proficient editing a QualityProfile. so you can disable the PMD Plugin at large but cannot edit the other stuff?)

We have released sonar-pmd-plugin 3.5.0 which solves this issue.

2 Likes