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
<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> <!--Framework Universal Package version set--<va Lidator.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> <EHCAC He.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><!--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> <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> <artifact Id>spring-cloud-dependencies</artifactid> <version>Dalston.RELEASE</version> &L t;type>pom</type> <scope>import</scope> </dependency> <DEPENDENCY&G T <groupId>org.jasig.cas.client</groupId> <artifactId>cas-client-core</artifactId> <version>3.4.1</version> </dependency> <dependency> <groupid>i O.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&G T <dependency> <groupId>de.codecentric</groupId> <artifactid>spring-boot-admin -server-ui</artifactid> <version>${spring-boot-admin.version}</version> </dependenc y> <dependency> <groupId>de.codecentric</groupId> <artifactid>spri Ng-boot-admin-server-ui-hystrix</artifactid> <version>${spring-boot-admin.version}</version> </dependency> <dependency> <groupId>de.codecentric</groupId> & lt;artifactid≫spring-boot-admin-server-ui-turbine</artifactid> <version>${spring-boot-admin.version}</versi on> </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& gt;${spring-boot-admin.version}</version> </dependency> <dependency> <groupi D>org.slf4j</groupid> <artifactId>slf4j-api</artifactId> <version>1.7.25& lt;/version> </dependency> <dependency> <GROUPID>COM.ML.HONGHU</GROUPID&G T <artifaCtid>component-base</artifactid> <version>${com.ml.honghu.componet.version}</version> </dependency> <dependency> <groupId>com.ml.honghu</groupId> <ar Tifactid>component-redis</artifactid> <version>${com.ml.honghu.componet.version}</version> </dependency> <dependency> <groupId>com.ml.honghu</groupId> & Lt;artifactid>component-utils</artifactid> <version>${com.ml.honghu.componet.version}</versio n> </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}</ver sion> </dependency> <dependency> <groupId>com.ml.honghu</groupId> <artifactId>component-admin-ui-route</artifactId> <version>${com.ml.honghu.componet.ve rsion}</version> </dependency> <dependency> <groupid>com.ml.honghu</gr Oupid> <artifactId>component-zuul-label</artifactId> <version>${com.ml.honghu.c Omponet.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, component projects are also created later), and I will be developing a recent spring The building process and the essence of cloud micro-service clouds are documented 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 apply it to enterprise projects.
Spring Cloud architecture-Honghu Common-service project build process