我們將對(duì)common-service整個(gè)項(xiàng)目進(jìn)行剖析蒸殿,將整個(gè)構(gòu)建的流程給記錄下來(lái),讓更多的關(guān)注者來(lái)參考學(xué)習(xí)恬总。
首先在構(gòu)建spring cloud的common-service之前前普,我們需要準(zhǔn)備的技術(shù):
Maven(項(xiàng)目構(gòu)建)、Spring Boot壹堰、Spring Cloud拭卿、微服務(wù)概念骡湖、去中心化思想、分布式等峻厚,針對(duì)于common-service的頂級(jí)項(xiàng)目勺鸦,這里我們主要使用Maven來(lái)構(gòu)建,閑話少說(shuō)目木,我們直接上代碼是最直觀的换途。
1. 創(chuàng)建一個(gè)Maven的頂級(jí)項(xiàng)目,其中pom.xml文件配置如下:
Xml代碼
4.0.0xsi:schemaLocation="http://maven.apache.org/POM/4.0.0?http://maven.apache.org/xsd/maven-4.0.0.xsd">
org.springframework.cloud
spring-cloud-starter-parent
Dalston.RELEASE
com.ml.honghu
particle-commonservice
0.0.1-SNAPSHOT
pom
particle-commonservice
particle-commonservice?project?for?Spring?Boot
particle-commonservice-config
particle-commonservice-eureka
particle-commonservice-mq
particle-commonservice-cache
particle-commonservice-sso
particle-commonservice-apigateway
particle-commonservice-zipkin
particle-commonservice-admin
particle-commonservice-turbine
particle-commonservice-combine
particle-commonservice-sequence
Final
org.springframework.cloud
spring-cloud-dependencies
Dalston.RELEASE
pom
import
org.jasig.cas.client
cas-client-core
io.springfox
springfox-swagger2
de.codecentric
spring-boot-admin-server
${spring-boot-admin.version}
de.codecentric
spring-boot-admin-server-ui
${spring-boot-admin.version}
de.codecentric
spring-boot-admin-server-ui-hystrix
${spring-boot-admin.version}
de.codecentric
spring-boot-admin-server-ui-turbine
${spring-boot-admin.version}
de.codecentric
spring-boot-admin-server-ui-login
${spring-boot-admin.version}
de.codecentric
spring-boot-admin-server-ui-activiti
${spring-boot-admin.version}
org.slf4j
slf4j-api
com.ml.honghu
component-base
${com.ml.honghu.componet.version}
com.ml.honghu
component-redis
${com.ml.honghu.componet.version}
com.ml.honghu
component-utils
${com.ml.honghu.componet.version}
com.ml.honghu
component-sequence-api
${com.ml.honghu.componet.version}
com.ml.honghu
component-admin-ui-zipkin
${com.ml.honghu.componet.version}
com.ml.honghu
component-admin-ui-route
${com.ml.honghu.componet.version}
com.ml.honghu
component-zuul-label
${com.ml.honghu.componet.version}
當(dāng)前的pom.xml文件引入了spring cloud相關(guān)版本配置刽射,通用工具版本配置军拟,honghu相關(guān)組件配置(因?yàn)槠渌南到y(tǒng)服務(wù)項(xiàng)目依賴于相關(guān)的組件,組件項(xiàng)目也是后面來(lái)創(chuàng)建的)
從現(xiàn)在開始誓禁,我這邊會(huì)將近期研發(fā)的spring cloud微服務(wù)云架構(gòu)的搭建過(guò)程和精髓記錄下來(lái)懈息,幫助更多有興趣研發(fā)spring cloud框架的朋友,大家來(lái)一起探討spring cloud架構(gòu)的搭建過(guò)程及如何運(yùn)用于企業(yè)項(xiàng)目摹恰。源碼來(lái)源