无法在 Eclipse 中导入 PMD 规则集 [英] Can't import PMD Ruleset in Eclipse

查看:33
本文介绍了无法在 Eclipse 中导入 PMD 规则集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的 IDE (Eclipse) 中使用与我的 Sonar 配置文件相同的规则集.

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

我从 Sonar Permalinks 获得了 PMD XML 规则集,并希望将其导入我的 PMD Eclipse 插件,但是当我尝试这样做时,确定"按钮被停用...

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 ...

有人可以帮我吗?

推荐答案

问题可能是 Sonar 正在将您的规则集导出为 v4.x 格式,而您的 Eclipse 插件需要它们为 v5.x 格式.

The problem could be that Sonar is exporting your ruleset for v4.x format and your Eclipse plugin expects them in v5.x format.

尝试更改您的规则:

<rule ref="rulesets/basic.xml/UnusedNullCheckInEquals">
    <priority>3</priority>
</rule>

<rule ref="rulesets/java/basic.xml/UnusedNullCheckInEquals">
    <priority>3</priority>
</rule>

请注意 ref 属性.一个简单的查找并替换所有内容对您来说效果很好.

Please note the ref attribute. A simple find and replace all will work out fine for you.

这篇关于无法在 Eclipse 中导入 PMD 规则集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆