44 lines
1.8 KiB
Markdown
44 lines
1.8 KiB
Markdown
![]() |
> 本文由 [简悦 SimpRead](http://ksria.com/simpread/) 转码, 原文地址 [blog.51cto.com](https://blog.51cto.com/yszr/2820700)
|
|||
|
|
|||
|
> IDEA 中启动多个微服务(开启 Services 管理),方法一、微服务项目的开发过程中,工程会非常多,经常要启动很多个服务,才能完成一项测试。
|
|||
|
|
|||
|
### 方法一、
|
|||
|
|
|||
|
微服务项目的开发过程中,工程会非常多,经常要启动很多个服务,才能完成一项测试。启动的多了,容易开发者带来错乱的感觉,很不方便管理。在 idea 作为开发工具时,推荐一个很好用的功能 --Run Dashboard,新版本里面的名字改成了 Services
|
|||
|
|
|||
|
.idea > workspace.xml 中添加如下配置,重启 idea
|
|||
|
|
|||
|
```
|
|||
|
<component >
|
|||
|
<option >
|
|||
|
<set>
|
|||
|
<option value="SpringBootApplicationConfigurationType" />
|
|||
|
</set>
|
|||
|
</option>
|
|||
|
<option >
|
|||
|
<list>
|
|||
|
<RuleState>
|
|||
|
<option />
|
|||
|
</RuleState>
|
|||
|
<RuleState>
|
|||
|
<option />
|
|||
|
</RuleState>
|
|||
|
</list>
|
|||
|
</option>
|
|||
|
</component>
|
|||
|
|
|||
|
```
|
|||
|
|
|||
|
此外,“ _运行_ / _调试”_ 工具窗口现在有一个名为 “ _端点”_ 的选项卡。此选项卡显示有关信息_健康_和_豆类_端点
|
|||
|
|
|||
|

|
|||
|
|
|||
|
### 方法二、
|
|||
|
|
|||
|
1. 点击菜单栏:Views -> Tool Windows -> Services;中文对应:视图 -> 工具窗口 -> 服务;快捷键是 Alt + F8,但是本地快捷键可能冲突,并未成功
|
|||
|
|
|||
|

|
|||
|
|
|||
|
2. 刚创建好的窗口是空白的,需要我们把服务加进去。也是比较简单:点击最右侧加号`Add Service`,选择`Run Configuration Type`,最后选择`SpringBoot`,IDEA 就会把所有项目加进来了
|
|||
|
|
|||
|

|