本文介绍了无法在Eclipse中导入PMD规则集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的IDE(Eclipse)中使用相同的规则集,我的Sonar配置文件。我从Sonar固定链接获得了PMD XML规则集,并希望将其导入我的PMD Eclipse插件,但是当我尝试这样做时,确定按钮被停用...
有人可以帮助我吗? p>
解决方案
问题可能是Sonar正在导出您的v4.x格式的规则集,Eclipse插件期待他们使用v5.x格式。
尝试更改您的规则:
< rule ref = 规则集/ basic.xml / UnusedNullCheckInEquals >
< priority> 3< / priority>
< / rule>
至
< rule ref =rulesets / java / basic.xml / UnusedNullCheckInEquals>
< priority> 3< / priority>
< / rule>
请注意 ref 属性。一个简单的查找和更换所有的将会为您工作。
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 PMD Eclipse Plugin but when i try to do it, the "OK" button is desactivated ...
Can someone help me ?
解决方案
The problem could be that Sonar is exporting your ruleset for v4.x format and your Eclipse plugin expects them in v5.x format.
Try changing your rules from:
<rule ref="rulesets/basic.xml/UnusedNullCheckInEquals">
<priority>3</priority>
</rule>
to
<rule ref="rulesets/java/basic.xml/UnusedNullCheckInEquals">
<priority>3</priority>
</rule>
Please note the ref attribute. A simple find and replace all will work out fine for you.
这篇关于无法在Eclipse中导入PMD规则集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!