导入用户定义的 checkstyle eclipse

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17338283/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 20:48:34  来源:igfitidea点击:

Import a user defined checkstyle eclipse

javaeclipsecheckstyle

提问by Anand B

I have a user defined checkstyle xml file and jar file. How can I import the xml and jar file in eclipse.

我有一个用户定义的 checkstyle xml 文件和 jar 文件。如何在eclipse中导入xml和jar文件。

Should I install eclipse checkstyle plugin and then import my user defined check style in it or is there any alternate way

我应该安装 eclipse checkstyle 插件,然后在其中导入我的用户定义的检查样式还是有任何替代方法

采纳答案by Denim Datta

If by user defined checkstyle, you mean you created some new rules and want them to be a part of your checkstyle, then you can do it like following :

如果通过用户定义的 checkstyle,您的意思是您创建了一些新规则并希望它们成为您的 checkstyle 的一部分,那么您可以这样做:

  1. Create plugin projectand add your custom checksthere.
  2. Make appropriate changes to plugin.xml, checkstyle_packages.xml.
  3. Export the project as Deployable Plug-ins and fragments(Export > Plug-in Developement)
  4. Copy the jar file to Eclipse Pluginfolde, so no need to install your custom check.
  1. 创建插件项目并在那里添加您的自定义检查
  2. plugin.xmlcheckstyle_packages.xml 进行适当的更改
  3. 将项目导出为可部署插件和片段导出 > 插件开发
  4. 将 jar 文件复制到Eclipse Plugin文件夹,因此无需安装自定义检查

You can refer this tutorial

你可以参考这个教程

回答by Luis Sep

Go to Preferences -> Checkstyle. In the Global Check Configurations box you can specify your own files.

转到首选项 -> Checkstyle。在全局检查配置框中,您可以指定自己的文件。

回答by prem

In eclipse inbuilt checkstyle will not be available,so first you need to install the plugin.

在 Eclipse 中内置的 checkstyle 将不可用,因此首先您需要安装该插件。

I found this helpful

我发现这很有帮助

https://code.google.com/p/instinct/wiki/ConfiguringCheckstyleForEclipse

https://code.google.com/p/instinct/wiki/ConfiguringCheckstyleForEclipse