关于《阿里巴巴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