Checkstyle:自定义规则 - Eclipse插件 [英] Checkstyle: Custom Rules - Eclipse Plugin
问题描述
现在我希望这些规则被Eclipse Checkstyle插件使用。这是我在挣扎的地方。
阅读这些链接后,我不明白下一步该怎么做。
- 我需要将我的项目导出为JAR吗?
- 如何将其插入现有的Checkstyle插件?
谢谢
你已经有了正确的链接,最终会让你在那里。对于您的问题:
-
所有您的自定义检查都可以进入一个JAR文件。该JAR文件必须是Eclipse插件JAR。我可以通过将其复制到Eclipse dropins 文件夹来安装,但可能会有更优雅的方式来实现。
-
所以你最终得到两个插件:原来的,未修改的Eclipse-CS和你自己的插件,其中包含自定义检查。当两者都独立安装在Eclipse中时,Eclipse-CS配置对话框将提供您在Checkstyle配置中使用的自定义检查。
I have written few custom checkstyle rules using checkstyle API. They run fine using Maven (after I add the new project as a dependency to the checkstyle plugin).
Now I want these rules to be used by the Eclipse Checkstyle plugin. And this is where I am stuggling.
I've downloaded the sample plugin project (as suggested here and here).
I do not understand what to do next after reading these links.
- Do I need to export my project as a JAR?
- How do I plug it into my existing Checkstyle plugin?
Thanks
You already have the correct links that will eventually get you there. As for your questions:
All your custom checks can go into one JAR file. That JAR file must be an Eclipse plugin JAR. I simply install it by copying it to the Eclipse dropins folder, but there may be more elegant ways to do that.
So you end up with two plugins: The original, unmodified Eclipse-CS, and your own plugin which contains the custom checks. When both are independently installed in Eclipse, the Eclipse-CS configuration dialog will offer your custom checks for use in Checkstyle configurations.
这篇关于Checkstyle:自定义规则 - Eclipse插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!