jborgers / sonar-pmd

☕️ PMD Plugin for SonarQube
https://redirect.sonarsource.com/plugins/pmd.html
GNU Lesser General Public License v3.0
261 stars 156 forks source link

NoSuchMethodError: 'org.sonar.api.rules.RulePriority org.sonar.api.rules.RulePriority.valueOfString(java.lang.String)' #413

Closed irina-batinic-sonarsource closed 5 months ago

irina-batinic-sonarsource commented 1 year ago

Hi,

sonar-api-plugin in version 10.0, removed some deprecated methods, and one 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)
jborgers commented 5 months ago

Thanks Irina, this PR is part of the 3.5.0 release