《阿里巴巴Java开发手册》扫描插件正式发布--插件安装和使用分析
阿里巴巴于10月14日上午9:00在杭州云栖大会《研发效能峰会》上,正式发布《阿里巴巴Java开发手册》扫描插件。下面分享这个插件,希望公司更多的人使用,提高我们的代码/编码的规范!
阿里代码规约插件相关内容:
视频地址:https://yunqi.aliyun.com/#/video/detail1420
翘首期盼247天!《阿里巴巴Java开发手册》扫描插件正式发布:
https://mp.weixin.qq.com/s/KcPtgFbnU6CS3L49EKcnDg
阿里巴巴代码规范扫描插件github地址:
http://https://github.com/alibaba/p3c
阿里巴巴Java开发手册(终极版):
https://github.com/alibaba/p3c/blob/master/阿里巴巴Java开发手册(终极版).pdf
下面是我在Eclipse安装插件的过程和具体测试代码的分析示例:
在github中已经具体说明了Eclipse和Idea的开发工具如何安装插件,下面就都进行简单的介绍和说明!
安装注意版本问题:
我在IDEA上安装这个插件的时候,报错
Plugin Alibaba Java Coding Guidelines was not installed: Cannot download 'https://plugins.jetbrains.com/pluginManager/?action=download&;id=com.alibaba.p3c.smartfox&build=IU-172.4343.14&uuid=9f9fc264-a025-47ed-9bdc-c12871794d1c': Read timed out
这个是我网络的问题!
IDEA版的插件 :我们发布到了IDEA官方仓库中(最低支持版本14.1.7,JDK1.7+)
Eclipse版插件 :支持4.2(Juno,JDK1.8+)及以上版本
1.Eclipse 安装和使用
第一步:安装插件:
Help>>Install New Software然后在框中输入URL:https://p3c.alibaba.com/plugin/eclipse/update

安装完成后,重启Eclipse!
然后右键可以看到,第一次显示

然后点击切换为中文:

第二步:简单使用插件
编写了一个不符合阿里代码规约的例子,进行测试,代码如下:

右键,选择 阿里编码规约扫描,结果如下图 :

2.IDEA安装和使用
安装和使用和Eclipse大同小异,具体安装也可以参考github介绍。
第一步
Settings>>Plugins>>Browse repositories... 搜 Alibaba 就可以。

安装 然后重启;
就可以看见Tools 》》 阿里编码规约:

第二步:使用
请看下图,注意代码一定要编译过后在进行 扫描,否则结果可能不完全!

网友评论