We will analyze the whole project of Common-service and record the whole construction process, so that more followers can refer to the study.
First, before building the common-service of Spring cloud, we need to prepare the technology:
MAVEN (project Building), Spring Boot, Spring Cloud, microservices concept, decentralized thinking, distributed, etc., for top-of-the-line projects in Common-service, where we mainly use Maven to build, gossip less, we directly on the code is the most intuitive.
Create a MAVEN top-level project where the Pom.xml file is configured as follows:
<?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> <group Id>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-commonse Rvice-cache</module> <module>particle-commonservice-sso</module> <module>particle-common Service-apigateway</module> <module>particle-commonservice-zipkin</module> <module>parti Cle-commonservice-admin</module> <module>particle-commonservice-turbine</module> <module> ;p article-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> <!--Framework Universal Package version set--<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</mybat Is-spring.version> <shiro.version>1.2.3</shiro.version> <druid.version>1.0.11</druid.ver Sion> <ehcache.version>2.6.9</ehcache.version> <EHCACHE-WEB.VERSION>2.0.4</EHCACHE-WEB.V Ersion> <sitemesh.version>2.4.2</sitemesh.version> <activiti.version>5.15.1</activiti.ve Rsion> <wink.version>1.4</wink.version> <sso.client.version>3.4.1</sso.client.version> ; -<!--General Toolkit version Settings-<slf4j.version>1.7.7</slf4j.version> <commons-lang3.version& Gt;3.3.2</commons-lang3.version> <commons-io.version>2.4</commons-io.version> <commons-code C.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.ve Rsion> <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--&G T <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& Gt;spring-cloud-dependencies</artifactid> <version>Dalston.RELEASE</version> & lt;type>pom</type> <scope>import</scope> </dependency> <depen Dency> <groupId>org.jasig.cas.client</groupId> <artifactid>cas-client-core& lt;/artifactid> <version>3.4.1</version> </dependency> <dependency& Gt <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& Gt <version>${spring-boot-admin.version}</version> </dependency> <dependency> <groupId>de.codecentric</groupId> <ARTIFACTID>SPRING-BOOT-ADMIN-SERVER-UI-HYSTRIX&L T;/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.ver sion}</version> </dependency> <dependency> <groupid>de.codecentric& Lt;/groupid> <artifactId>spring-boot-admin-server-ui-activiti</artifactId> <ve Rsion>${spring-boot-admin.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <ve rsion>1.7.25</version> </dependency> <dependency> <GROUPID>COM.M L.honghu</groupid> <artifactId>component-base</artifactId> <version>${co m.ml.honghu.componet.version}</version> </dependency> <dependency> <gr Oupid>com.ml.honghu&lT;/groupid> <artifactId>component-redis</artifactId> <version>${com.ml.hong hu.componet.version}</version> </dependency> <dependency> <groupId> Com.ml.honghu</groupid> <artifactId>component-utils</artifactId> <VERSION&G T;${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> <depend Ency> <groupId>com.ml.honghu</groupId> <artifactid>component-admin-ui-zipki N</artifactid> <version>${com.ml.honghu.componet.version}</version> </dependenc Y> <depenDency> <groupId>com.ml.honghu</groupId> <artifactid>component-admin-ui-rout E</artifactid> <version>${com.ml.honghu.componet.version}</version> </dependenc y> <dependency> <groupId>com.ml.honghu</groupId> <artifactid> ;component-zuul-label</artifactid> <version>${com.ml.honghu.componet.version}</version> </dependency> </dependencies> </dependencyManagement> </project>
The current Pom.xml file introduces spring cloud related version configuration, generic tool version configuration, Honghu related component configuration (because other system service projects depend on related components, and component projects are created later)
From now on, I will be documenting the process and essence of the recent development of the spring cloud micro-service cloud architecture to help more friends who are interested in developing the Spring cloud framework to explore the process of building the spring cloud architecture and how to use it in enterprise projects.
Spring Cloud Cloud Service architecture-Common-service project build process