Can't import PMD Ruleset in Eclipse

后端 未结 6 2241
旧时难觅i
旧时难觅i 2021-02-14 03:24

I would like to use the same Ruleset in my IDE (Eclipse) that my Sonar profile.

I got the PMD XML ruleset from the Sonar Permalinks and would like to import it into my P

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-14 04:01

    Ivan Nikolov's answer is correct. Your problem are different versions of ruleset format . In my case I was trying to import ruleset exported from PMD plugin version 3.2.6 into plugin version 4.0.0. Here are my findings:

    • Path change that Ivan Nikolov mentioned is needed for all the rules. Be careful because not all the rules belong to java (I saw also rules for XML,...). I am not that deep into PMD, so I don't know in which version were rules for other technologies introduced.
    • It is useful to export default ruleset of PMD plugin 4.0.0 for comparison with old custom ruleset file. This way you can fix problems that can be spotted at next point.
    • During your behavior was thrown exception that wasn't visualized. This exception can be seen in your workspace log file (/.metadata/.log) at the end. This can give you a clue what else needs to be changed. Use the previous point to find out how to fix problems. In my case it was changed path of one rule from to

    After these changes I was able to import manually migrated custom ruleset file into PMD plugin 4.0.0.

    Hope this helps.

    BTW: I find 4.0.0 version of PMD plugin very buggy so I downgraded back to 3.2.6

提交回复
热议问题