關於《阿里巴巴Java開發規約》插件的安裝與使用


一、安裝

二、idea插件的安裝與使用

 

https://github.com/alibaba/p3c/tree/master/idea-plugin#run-plugin

Idea Plugin


Prepare

  • Project JDK: 1.7+
  • Gradle: 3.0+(Require JDK1.8+ for gradle)

Build

cd p3c-idea
gradle clean buildPlugin

Run plugin

cd p3c-idea
gradle runIde
# run specific IDEA
gradle runIde -Pidea_version=14.1.7

Use p3c-common as your plugin dependency

compile 'com.alibaba.p3c.idea:p3c-common:1.0.0'

Install

  1. Settings >> Plugins >> Browse repositories...

    Switch language

  2. Search plugin by keyword 'alibaba' then install 'Alibaba Java Coding Guidelines' plugin

    Switch language

  3. Restart to take effect.

Use

  1. Switch language

    Switch language

  2. Inspections

    Real time

    Settings

  3. Code Analyze

    Settings

    We use the idea standard Inspection Results to show our violations.

    Result

    We can also analyze file which is modified before vsc checkin.

    Before Checkin

  4. https://github.com/alibaba/p3c/tree/master/eclipse-plugin

  5. Eclipse Plugin


  6. Prepare

    • Eclipse Juno+
    • maven3.+
    • JDK 1.7+

    Build

    mvn -U clean install
    

    Install

    1. Help >> Install New Software then enter this update site URL https://p3c.alibaba.com/plugin/eclipse/update

    Install Plugin

    1. Follow the wizard, restart Eclipse to take effect after install success.

    Use

    1. Switch language

      Switch language

    2. Code Analyze

    Analyze

    Analyze


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM