# PMD Plugin causes Sonar maven to fail with Sonarqube 10.2

**URL:** <https://community.sonarsource.com/t/pmd-plugin-causes-sonar-maven-to-fail-with-sonarqube-10-2/99605>\
**Category:** SonarQube Server / Community Build\
**Tags:** maven, java\
**Created:** [September 20, 2023, 8:43am UTC](https://community.sonarsource.com/t/pmd-plugin-causes-sonar-maven-to-fail-with-sonarqube-10-2/99605 "2023-09-20T08:43:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![reitzmichnicht](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/reitzmichnicht/32/288_2.png) [@reitzmichnicht](https://community.sonarsource.com/u/reitzmichnicht)\
**Post date:** [September 20, 2023, 8:43am UTC](https://community.sonarsource.com/t/pmd-plugin-causes-sonar-maven-to-fail-with-sonarqube-10-2/99605/1 "2023-09-20T08:43:52Z")

</div>

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

```auto
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

---

<div class="post-metadata">

**Author:** ![reitzmichnicht](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/reitzmichnicht/32/288_2.png) [@reitzmichnicht](https://community.sonarsource.com/u/reitzmichnicht)\
**Post date:** [September 20, 2023, 8:55am UTC](https://community.sonarsource.com/t/pmd-plugin-causes-sonar-maven-to-fail-with-sonarqube-10-2/99605/2 "2023-09-20T08:55:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![reitzmichnicht](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/reitzmichnicht/32/288_2.png) [@reitzmichnicht](https://community.sonarsource.com/u/reitzmichnicht)\
**Post date:** [September 20, 2023, 9:02am UTC](https://community.sonarsource.com/t/pmd-plugin-causes-sonar-maven-to-fail-with-sonarqube-10-2/99605/3 "2023-09-20T09:02:00Z")

</div>

PMD plugin has an issue for it:

> <https://github.com/jborgers/sonar-pmd/issues/413>
>
> Hi,
> 
> sonar-api-plugin in version 10.0, removed some deprecated methods, and on…e of them is \`org.sonar.api.rules.RulePriority.valueOfString(java.lang.String)\`
> Here is a change log of all changes that were made: https://github.com/SonarSource/sonar-plugin-api/blob/master/CHANGELOG.md
> 
> We noticed the problem with the sonar-pmd-plugin because of this.
> Here is the stack trace:
> \`\`\`
> Caused by: java.lang.NoSuchMethodError: 'org.sonar.api.rules.RulePriority org.sonar.api.rules.RulePriority.valueOfString(java.lang.String)'
> at org.sonar.plugins.pmd.xml.factory.ActiveRulesRuleSetFactory.create (ActiveRulesRuleSetFactory.java:57)
> at org.sonar.plugins.pmd.xml.PmdRuleSets.create (PmdRuleSets.java:73)
> at org.sonar.plugins.pmd.xml.PmdRuleSets.from (PmdRuleSets.java:60)
> at org.sonar.plugins.pmd.PmdExecutor.dumpXml (PmdExecutor.java:150)
> at org.sonar.plugins.pmd.PmdExecutor.createRuleSet (PmdExecutor.java:136)
> at org.sonar.plugins.pmd.PmdExecutor.executeRules (PmdExecutor.java:123)
> at org.sonar.plugins.pmd.PmdExecutor.executePmd (PmdExecutor.java:89)
> at org.sonar.plugins.pmd.PmdExecutor.execute (PmdExecutor.java:75)
> at org.sonar.plugins.pmd.PmdSensor.execute (PmdSensor.java:71)
> \`\`\`

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

---

<div class="post-metadata">

**Author:** ![daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@daniel](https://community.sonarsource.com/u/daniel)\
**Post date:** [September 20, 2023, 10:21am UTC](https://community.sonarsource.com/t/pmd-plugin-causes-sonar-maven-to-fail-with-sonarqube-10-2/99605/4 "2023-09-20T10:21:49Z")

</div>

`hint hint` 😊 👉 [Restriction of the download of scanner plugins to those that are essentially needed - #12 by daniel](https://community.sonarsource.com/t/restriction-of-the-download-of-scanner-plugins-to-those-that-are-essentially-needed/75847/12)

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?

---

<div class="post-metadata">

**Author:** ![reitzmichnicht](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/reitzmichnicht/32/288_2.png) [@reitzmichnicht](https://community.sonarsource.com/u/reitzmichnicht)\
**Post date:** [September 20, 2023, 10:40am UTC](https://community.sonarsource.com/t/pmd-plugin-causes-sonar-maven-to-fail-with-sonarqube-10-2/99605/5 "2023-09-20T10:40:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [September 20, 2023, 1:05pm UTC](https://community.sonarsource.com/t/pmd-plugin-causes-sonar-maven-to-fail-with-sonarqube-10-2/99605/6 "2023-09-20T13:05:48Z")

</div>

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](https://community.sonarsource.com/t/api-deprecation-policy-change/57998) 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.

&nbsp;  
Thx,  
Ann

---

<div class="post-metadata">

**Author:** ![daniel](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@daniel](https://community.sonarsource.com/u/daniel)\
**Post date:** [September 22, 2023, 12:00pm UTC](https://community.sonarsource.com/t/pmd-plugin-causes-sonar-maven-to-fail-with-sonarqube-10-2/99605/9 "2023-09-22T12:00:35Z")

</div>

> [@reitzmichnicht](#):
>
> What I do not understand is that we did not had this issue with Sonarqube 10.1

> [@ganncamp](#):
>
> Did anyone successfully use PMD with 10.1?

Hmmm 🤔 🤓 (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?)

---

<div class="post-metadata">

**Author:** ![jborgers](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jborgers/32/29079_2.png) [@jborgers](https://community.sonarsource.com/u/jborgers)\
**Post date:** [April 29, 2024, 1:22pm UTC](https://community.sonarsource.com/t/pmd-plugin-causes-sonar-maven-to-fail-with-sonarqube-10-2/99605/10 "2024-04-29T13:22:33Z")

</div>

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