【问题标题】:Eclipse PMD :Not able to import custom rulesetEclipse PMD:无法导入自定义规则集
【发布时间】:2016-02-25 10:33:11
【问题描述】:

我无法在 Eclipse 中为 pmd 上传自定义规则集。我正在使用 eclipse LUNA 和 eclipse-pmd 1.8 插件。我尝试过使用 eclipse pmd 插件以及 源伪造的 pmd 插件。

我已经参考了Can't import PMD Ruleset in Eclipse 链接并完成了建议的修改,但没有运气。

我的ruleset.xml 是这样说的:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ruleset xmlns="pmd.sf.net/ruleset/1.0.0"; name="pmd_eclipse" xmlns:xsi="w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="pmd.sf.net/ruleset_xml_schema.xsd"; xsi:schemaLocation="pmd.sf.net/ruleset/1.0.0 pmd.sf.net/ruleset_xml_schema.xsd">;
    <description>PMD Plugin preferences rule set</description>
    <rule ref="rulesets/java/strings.xml/AppendCharacterWithChar">
        <priority>4</priority>
    </rule>

【问题讨论】:

  • 我自己也面临同样的问题

标签: java eclipse eclipse-plugin pmd


【解决方案1】:

这可能是 pmd 插件版本的问题。我在使用 Eclipse 4 的 pmd 插件 PMD 时遇到了这个问题。我的规则集是从带有 Eclipse 3 插件的 PMD 的 Eclipse 导出的。

我为 Eclipse 3 安装了 PMD 插件。(从https://sourceforge.net/projects/pmd/files/pmd-eclipse/3.2.6/ 下载 zip 文件)

提取 zip 并复制功能和插件文件夹。 转到您的本地 Eclipse 安装并将其粘贴到那里。出现提示时进行合并。重启你的 Eclipse。

现在您应该可以导入您的规则集了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-21
    • 2013-02-14
    • 2017-03-10
    • 1970-01-01
    • 1970-01-01
    • 2015-08-25
    相关资源
    最近更新 更多