CheckStyle的安装

来源:互联网 发布:淘宝网 卖家中心 编辑:程序博客网 时间:2024/06/04 19:56
CheckStyle好处就不说了,今天eclipse商店装了老半天没装上,挺烦恼的,虽然这个攻略有点笨且繁琐,但还是分享给大家参考,工作愉快哈~~

1、在官网下载最新版本

下载地址:http://sourceforge.net/projects/eclipse-cs/
2、采用link方式安装eclipse插件
解压主要文件为:features、plugins,在eclipse的安装目录下新建文件夹“myplu”,将压缩包中的features、plugins拷贝到myplu目录。
在eclipse主目录下的dropins文件夹中新建checkstyle.link文件(扩展名为.link),填写刚才的myplu路径,如:path=D://soft//Install//eclipse//myplu
3、验证安装是否成功
重新启动eclipse,选择“window”--“preferences”,查看是否存在Checkstyle选择,若存在说明安装成功。

4、配置Checksytel

选择“window”--“preferences”--“Checkstyle”,点击左侧的New按钮,出现添加新配置选项,Type中选择:External configuration file
Name:自己根据自己实际需求自定义名称,Location:选择Checksytel的配置文件(该配置文件中定义了相关的style规则),完成配置后将添加的配置选为默认配置

5、Checkstyle使用
在工程上点击右键,选择“Checkstyle”选项,常用的选项为“Activate Checkstyle”、“Check Code with Checkstyle”、“Clear Checkstyle violations”
原创粉丝点击