springcloud 项目搭建
doc
- https://spring.io/projects/spring-cloud
- demo https://gitee.com/kwenj/lean-springcloud.git branch:spring-cloud
cloud版本和boot版本
- https://start.spring.io/actuator/info
|Release Train | Boot Version |
|—| —|
|2020.0.x aka Ilford | 2.4.x, 2.5.x (Starting with 2020.0.3) |
| Hoxton | 2.2.x, 2.3.x (Starting with SR5) |
| Greenwich | 2.1.x |
| Finchley | 2.0.x |
| Edgware | 1.5.x |
| Dalston | 1.5.x | - Dalston, Edgware, Finchley, and Greenwich已经走完了生命周期,不再支持
- 本次选择Greenwich的版本:最后几次的更新SR4 SR5 SR6显示版本成熟期,bug少
gitee地址
- https://gitee.com/kwenj/lean-springcloud
- 创建一个root项目(maven project)
- 创建一个微服务如:身份中心identityCenter
- 在上面的项目基础上创建一个网关apigateway(maven module)
Q & A
- dependencyManagement 与 dependencies
dependencyManagement声明依赖,父子项目都不实际引入;但子项目需要引入其中一个jar包的时候,不用声明version,自动引用父项目dependencyManagement的version。而父项目的dependencies则会强制子项目也引入这些jar包