使用Cloud Toolkit在IDEA中极速创建dubbo工程
环境
- 系统:win10专业版 1903
- IDEA版本:ULTIMATE 2019.2.4
- JDK: openjdk version "1.8.0_40"
一.安装Cloud Toolkit插件
1.在IDEA的欢迎页面中点击Configure
菜单(标注1)下拉列表中的Plugins
(标注2)进入IDEA插件管理面板

2.在插件搜索框(标注3)中输入Alibaba Cloud Toolkit
后按Enter
回车键后,下面的搜索列表(标注4)中会显示搜索出来的插件,点击右侧的插件介绍页面中的Install
(标注5)按钮后即可安装插件

3.安装过程中会显示安装进度,如标注6中所示

4.安装完成后会显示Restart IDE
(标注7),点击后会弹出面板,点击Restart
(标注8)后即可重启IDEA

二、使用Cloud Toolkit创建dubbo工程
1.在IDEA的欢迎页面点击Create New Project
(标注1)进入新建项目页面

2.在新建项目页面,点击左侧的Apache Dubbo
(标注2)后,在右侧选择项目的JDK版本,选择好后点击右下角的Next
进入项目详细配置页面

3.在项目配置页面中可以配置如下项:
- 项目的构建工具(Maven、Gradle)和GAV (标注5)
- 选择Dubbo的版本、注册中心、配置文件格式(xml文件或者注释)、和dubbo的类型(消费者、生产者) (标注6)
- SpringBoot版本、包名、项目描述信息 (标注7)

4.在项目配置的第2个页面中可以配置项目的名称、项目文件存放路径、模块名称、模块存放路(标注9、标注10),配置好后点击Finish
完成项目的创建。

5.第一次进入项目会弹出Cloud Toolkit
的欢迎页面(标注12),可以在这个页面中填入邀请码4QEFVD(标注13),填写好后点击关闭
即可进入项目的主页面
若之前你已安装Cloud Toolkit
但仍想填写邀请码,请在顶部导航栏单击阿里云图标,然后选择 User Guide。
在 Welcome to use Cloud Toolkit 页面填写邀请码,然后单击关闭。

可以通过这个入口重新进入欢迎页面填写邀请码

6.在项目的主页面中会加载maven中配置的依赖,可以选择Enable Auto-import
(标注15)让IDEA自动导入依赖

7.等所有的依赖下载完成后,整个Dubbo工程就创建完成了,工程包含如下模块
- 消费者模块(标注18)
- 接口模块(标注19)
- 生产者模块(标注20)
