(七)整合spring cloud云服務架構 - common-service 項目構建過程

我們將對common-service整個項目進行剖析,將整個構建的流程給記錄下來,讓更多的關注者來參考學習。

首先在構建spring cloud的common-service之前,我們需要準備的技術:

Maven(項目構建)、Spring Boot、Spring Cloud、微服務概念、去中心化思想、分布式等,針對于common-service的頂級項目,這里我們主要使用Maven來構建,閑話少說,我們直接上代碼是最直觀的。

1. 創建一個Maven的頂級項目,其中pom.xml文件配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion>
<parent><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-parent</artifactId><version>Dalston.RELEASE</version><relativePath /></parent><groupId>com.ml.honghu</groupId><artifactId>particle-commonservice</artifactId><version>0.0.1-SNAPSHOT</version><packaging>pom</packaging><name>particle-commonservice</name><description>particle-commonservice project for Spring Boot</description><modules><module>particle-commonservice-config</module><module>particle-commonservice-eureka</module><module>particle-commonservice-mq</module><module>particle-commonservice-cache</module><module>particle-commonservice-sso</module><module>particle-commonservice-apigateway</module><module>particle-commonservice-zipkin</module><module>particle-commonservice-admin</module><module>particle-commonservice-turbine</module><module>particle-commonservice-combine</module><module>particle-commonservice-sequence</module></modules><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding><java.version>1.8</java.version><!-- 框架通用包版本設置 --><validator.version>5.3.4.Final</validator.version><shiro.version>1.2.3</shiro.version><druid.version>1.0.26</druid.version><mybatis-spring.version>1.2.2</mybatis-spring.version><shiro.version>1.2.3</shiro.version><druid.version>1.0.11</druid.version><ehcache.version>2.6.9</ehcache.version><ehcache-web.version>2.0.4</ehcache-web.version><sitemesh.version>2.4.2</sitemesh.version><activiti.version>5.15.1</activiti.version><wink.version>1.4</wink.version><sso.client.version>3.4.1</sso.client.version> --><!-- 通用工具包版本設置 --><slf4j.version>1.7.7</slf4j.version><commons-lang3.version>3.3.2</commons-lang3.version><commons-io.version>2.4</commons-io.version><commons-codec.version>1.9</commons-codec.version><commons-fileupload.version>1.3.1</commons-fileupload.version><commons-beanutils.version>1.9.1</commons-beanutils.version><fastjson.version>1.1.40</fastjson.version><xstream.version>1.4.7</xstream.version><guava.version>17.0</guava.version><dozer.version>5.5.1</dozer.version><email.version>1.4.7</email.version><poi.version>3.9</poi.version><cglib.version>3.2.5</cglib.version><!-- aliyun --><aliyun-sdk-oss.version>2.6.0</aliyun-sdk-oss.version><aliyun-sdk-openservices-ons.version>1.2.7.Final</aliyun-sdk-openservices-ons.version><com.ml.honghu.componet.version>0.0.1-SNAPSHOT</com.ml.honghu.componet.version><spring-boot-admin.version>1.5.1</spring-boot-admin.version><fastjson.version>1.2.35</fastjson.version></properties><dependencyManagement><dependencies><!-- spring cloud --><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>Dalston.RELEASE</version><type>pom</type><scope>import</scope></dependency><dependency><groupId>org.jasig.cas.client</groupId><artifactId>cas-client-core</artifactId><version>3.4.1</version></dependency><dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger2</artifactId><version>2.5.0</version></dependency><dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-server</artifactId><version>${spring-boot-admin.version}</version></dependency><dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-server-ui</artifactId><version>${spring-boot-admin.version}</version></dependency><dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-server-ui-hystrix</artifactId><version>${spring-boot-admin.version}</version></dependency><dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-server-ui-turbine</artifactId><version>${spring-boot-admin.version}</version></dependency><dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-server-ui-login</artifactId><version>${spring-boot-admin.version}</version></dependency><dependency><groupId>de.codecentric</groupId><artifactId>spring-boot-admin-server-ui-activiti</artifactId><version>${spring-boot-admin.version}</version></dependency><dependency><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId><version>1.7.25</version></dependency><dependency><groupId>com.ml.honghu</groupId><artifactId>component-base</artifactId><version>${com.ml.honghu.componet.version}</version></dependency><dependency><groupId>com.ml.honghu</groupId><artifactId>component-redis</artifactId><version>${com.ml.honghu.componet.version}</version></dependency><dependency><groupId>com.ml.honghu</groupId><artifactId>component-utils</artifactId><version>${com.ml.honghu.componet.version}</version></dependency><dependency><groupId>com.ml.honghu</groupId><artifactId>component-sequence-api</artifactId><version>${com.ml.honghu.componet.version}</version></dependency><dependency><groupId>com.ml.honghu</groupId><artifactId>component-admin-ui-zipkin</artifactId><version>${com.ml.honghu.componet.version}</version></dependency><dependency><groupId>com.ml.honghu</groupId><artifactId>component-admin-ui-route</artifactId><version>${com.ml.honghu.componet.version}</version></dependency><dependency><groupId>com.ml.honghu</groupId><artifactId>component-zuul-label</artifactId><version>${com.ml.honghu.componet.version}</version></dependency></dependencies></dependencyManagement>
</project>復制代碼

當前的pom.xml文件引入了spring cloud相關版本配置,通用工具版本配置,honghu相關組件配置(因為其他的系統服務項目依賴于相關的組件,組件項目也是后面來創建的)

從現在開始,我這邊會將近期研發的spring cloud微服務云架構的搭建過程和精髓記錄下來,幫助更多有興趣研發spring cloud框架的朋友,大家來一起探討spring cloud架構的搭建過程及如何運用于企業項目。完整項目的源碼來源


轉載于:https://juejin.im/post/5bf7c9a5e51d454c1c45d74b

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/276839.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/276839.shtml
英文地址,請注明出處:http://en.pswp.cn/news/276839.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

python list元素合并_python list 合并連接字符串的方法

python list 合并連接字符串的方法 更新時間&#xff1a;2013年03月09日 22:02:18 作者&#xff1a; python 列表合并字符串&#xff0c;我們一般會用到字符串的join方法來操作。下面通過代碼的形式&#xff0c;詳細的說下list怎么拼成字符串&#xff1f; 相關文章這篇文章主要…

修改citrix 默認偵聽端口的命令和XML Service端口

修改citrix 默認偵聽端口的命令&#xff1a; 在命令行下輸入icaport /port&#xff1a;2494&#xff0c;或你所想改成的端口 如果輸入 icaport /reset 恢復默認偵聽端口 ctxxmlss /r8080 在citrix的外部客戶端通過web方式登陸時&#xff0c;提示“the alternate address cannot…

spfa算法

1 轉載于:https://www.cnblogs.com/Emcikem/p/11346073.html

集成方法-概念理解

集成方法&#xff08;ensemble method&#xff09;又叫元算法&#xff08;meta-algorithm&#xff09;&#xff1a;將不同的分類器組合起來。 通俗的說&#xff1a;就是三個臭皮匠賽過諸葛亮。做決定時&#xff0c;考慮多個人的意見&#xff0c;不是一個人的意見 集成方法&…

單片機按鍵防抖程序_這些單片機按鍵設計方案,請拿好,不謝!

在單片機系統里&#xff0c;按鍵是常見的輸入設備&#xff0c;在本文中介紹幾種按鍵硬件、軟件設計方面的技巧。一般的在按鍵的設計上&#xff0c;一般有四種方案&#xff0c;創客學院帶你零基礎學習電子產品設計。一是GPIO口直接檢測單個按鍵&#xff0c;如圖1.1所示;二是按鍵…

Oracle 11G 安裝詳解

oracle官網下載地址&#xff1a;http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html 官網下載需要注冊orcale賬號&#xff0c;比較繁瑣&#xff0c;這里直接放已經下載好的安裝包鏈接 Oracle11G下載鏈接: https://pan.baidu.com/s/1v6oD4jAt…

程序員何苦為難程序員?

有時候想想程序員為何為難程序員呢&#xff1f; 扳扳手指走上碼農這個行業也有幾年了&#xff0c;但是越來越覺得這個行業很累&#xff0c;有人說程序員就是二代農民工&#xff0c;我個人還是比較贊同的&#xff0c;對于剛入道的同仁們來說確實就是個體力(腦力&#xff0c;眼力…

kubeadm部署k8s_用 kubeadm 部署生產級 k8s 集群

概述kubeadm 已?持集群部署&#xff0c;且在1.13 版本中 GA&#xff0c;?持多 master&#xff0c;多 etcd 集群化部署&#xff0c;它也是官?最為推薦的部署?式&#xff0c;?來是由它的 sig 組來推進的&#xff0c;?來 kubeadm 在很多??確實很好的利?了 kubernetes 的許…

poj 題目分類

1000 AB Problem 送分題 1001 Exponentiation 高精度 1003 Hangover 送分題 1004 Financial Management 送分題 1005 I Think I Need a Houseboat 幾何 1006 Biorhythms 送分題 1007 …

模板的語法

我已經碰到過好幾次這種錯誤了. template<typename R>static_inline vec4<typename R::scalar>point(constrhs2<R>&v) { returnvec4<P>(v.x, v.y, 0, 1); } template<typename R>static_inline vec4<typename R::sca…

統計學習方法概論---分類問題

為什么80%的碼農都做不了架構師&#xff1f;>>> 分類問題 轉載于:https://my.oschina.net/liyangke/blog/2945185

IEPLUS(IE增強性插件)

用Vista好長好長時間了&#xff0c;除了比較吃硬件、老的游戲不兼容、我350W像素的老羅技不能用等等&#xff0c;感覺不是非常不錯的。IE 7也還可以&#xff0c;后來我試用了傲游、火狐&#xff0c;在多標簽后傲游的一些操作更人性化&#xff0c;我最喜歡它的托拉即可自動出新標…

CENTOS7 Python3.7 PyAudio 安裝

2019獨角獸企業重金招聘Python工程師標準>>> 出現錯誤: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/usr/local/python371/include/python3.7m -c src/_portaudiomodule.c -o build/temp.linux-aarch64-3.7/src/…

bash for循環_Bash 中的 For 循環

循環是編程語言的基本概念之一。當你想要一遍又一遍地運行一系列命令直到達到某個條件后終止退出時&#xff0c;循環很方便。在諸如 Bash 之類的腳本語言中&#xff0c;循環對于自動執行重復性任務非常有用。在 Bash 腳本中有3個基本的循環結構&#xff0c;for 循環&#xff0c…

Atlas Unknown Error

if("using Atlas" and "there are some js codes in HEAD tag") then "Unknown Error" solution: copy the js codes to other position 轉載于:https://www.cnblogs.com/JoeHou/archive/2009/02/03/1383231.html

軟件工程師的6年總結

“又是一年畢業時”&#xff0c;看到一批批學子離開人生的象牙塔&#xff0c;走上各自的工作崗位&#xff1b;想想自己也曾經意氣風發、躊躇滿志&#xff0c;不覺感嘆萬千……本文是自己工作6年的經歷沉淀或者經驗提煉&#xff0c;希望對所有的軟件工程師們有所幫助&#xff0c…

linux 信號_Linux的信號和線程

Linux的信號和線程-Tech Talk 讓技術發出聲音?www.ttalk.im什么是線程線程&#xff0c;有時被稱為輕量級進程(Lightweight Process&#xff0c;LWP&#xff09;&#xff0c;是程序執行流的最小單元。一個標準的線程由線程ID&#xff0c;當前指令指針(PC&#xff09;&#xff0…

tomcat部署教程

參考博客地址&#xff1a; https://blog.csdn.net/xiaoyu940601/article/details/54950673轉載于:https://www.cnblogs.com/liuniublogs/p/10019068.html

選擇文字就能選擇復選框

更方便的單選框下面為腳本顯示區  看看下面的選擇框&#xff0c;似乎沒有什么不同的。微妙之處在于&#xff0c;選擇項目時不必非得在框內點擊鼠標了&#xff0c;在文本上選擇即可。不信試一試吧。 經常來這里 偶爾來看看 轉載于:https://www.cnblogs.com/leevane/archive/200…