PMD Eclipse 的导入规则
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16778062/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Importing rules for PMD Eclipse
提问by user2425896
I'm installing Eclipse Juno for Java Developers for a class, and we've been asked to install the PMD plugin. We have our own xml file with the rules and we have to replace the default rules for the plugin. When I browse and select the file, the import tool doesn't allow me to press 'ok'.
我正在为一个班级安装 Eclipse Juno for Java Developers,我们被要求安装 PMD 插件。我们有自己的带有规则的 xml 文件,我们必须替换插件的默认规则。当我浏览并选择文件时,导入工具不允许我按“确定”。
Any suggestions? I'm pretty new to this stuff.
有什么建议?我对这个东西很陌生。
回答by ben rhouma moez
It's a problem with the plugin 4, try with 3. Import your rules and you can after that do an update to 4.
插件4有问题,试试3。导入你的规则,然后你可以更新到4。
回答by Kai
You have to set it in the Eclipse configuration of PMD: Window
-> Preferences
-> PMD
-> Rules Configuration
-> Import Rules Set
你必须在 PMD 的 Eclipse 配置中设置它:Window
-> Preferences
-> PMD
-> Rules Configuration
->Import Rules Set
Before you can do this the PMD plug-in itself must be installed: Help
-> Eclipse Marketplace...
-> Search for PMD, install it and restart eclipse.
在执行此操作之前,必须安装 PMD 插件本身:Help
-> Eclipse Marketplace...
-> 搜索 PMD,安装它并重新启动 eclipse。
回答by Rajakumar Munna
Right click on project
- > properties
-> PMD
-> check Enable PMD
-> click on radio button Use the ruleset configuration in project file
-> Browse
-> select your custom pmd xml file
Right click on project
-> properties
-> PMD
-> 检查Enable PMD
-> 单击单选按钮Use the ruleset configuration in project file
-> Browse
-> 选择您的自定义 pmd xml 文件