1. 下載地址
https://github.com/alibaba/p3c
2. Eclipse 中安裝規(guī)約插件
2.1 在線安裝
- Help >> Install New Software负芋,輸入:https://p3c.alibaba.com/plugin/eclipse/update
在線安裝.jpg
2.2 離線安裝
3. 設(shè)置代碼格式與注釋格式
注:下載這兩個(gè)文檔時(shí)始锚,應(yīng)該是在線打開,復(fù)制文檔中的內(nèi)容屋休,而不是右鍵另存為。
3.1 設(shè)置注釋格式
- eclipse_codetemplate.xml 為代碼注釋配置文件
在 Eclipse 中 Windows → Preferences → Java → Code Style → Code Templates 中導(dǎo)入十办;
Code Templates.jpg
3.2 設(shè)置代碼格式
- eclipse-codestyle.xml 為 Eclipse 代碼格式配置文件
在 Eclipse 中 Windows → Preferences → Java → Code Style → Formatter 中導(dǎo)入伴找;
Formatter.jpg