We will analyze the whole project of common-Service and record the whole construction process for more followers to reference and learn.

First, before building common-Service of Spring Cloud, we need to prepare the following techniques:

Maven (Project Construction), Spring Boot, Spring Cloud, microservice concept, decentralization, distribution, etc., for the top project of common-Service, here we mainly use Maven to build, without further talk, we directly on the code is the most intuitive. Complete project source code technical support 2147756333

  1. Create a top-level project for Maven with the pom.xml file 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 > < the parent > < groupId > org. Springframework. Cloud < / groupId > <artifactId>spring-cloud-starter-parent</artifactId> <version>Dalston.RELEASE</version> <relativePath /> </parent> < the groupId > com. Ml. Honghu < / groupId > < artifactId > particle - commonservice < / artifactId > < version > 0.0.1 - the SNAPSHOT < / version > <packaging>pom</packaging> <name>particle-commonservice</name> <description>particle-commonservice projectforSpring 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 > <! Final</validator.version> < shro.version >1.2.3</ shro.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 track < / sso. Client. Version > -- > <! -- Common toolkit version Settings --> <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 > <. Additional version > 3.2.5 < / additional version > <! - aliyun - > < aliyun - SDK - oss. Version > server < / aliyun - SDK - oss. Version > < aliyun - SDK - openservices - ons. Version > 1.2.7. The Final < / aliyun - SDK - openservices - ons. Version > < com.ml.honghu.com ponet version > 0.0.1 - the SNAPSHOT < / com.ml.honghu.com ponet version > < spring - the boot - admin. Version > 1.5.1 < / spring - the 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 - the client - core < / artifactId > < version > 3.4.1 track < / version > < / dependency > < the dependency > < the 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 > < the 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>
Copy the code

The current POM.xml file introduces spring Cloud related version configuration, common tool version configuration, honghu related component configuration (because other system service projects depend on related components, component projects are also created later)

From now on, I will record the construction process and essence of spring Cloud micro-service cloud architecture recently developed, so as to help more friends who are interested in developing Spring Cloud framework to discuss the construction process of Spring Cloud architecture and how to apply it to enterprise projects. Source source