ZOL论坛 > 技术论坛 > Spring Cloud云服务架构 - common-service 项目构建过程
帖子很冷清,卤煮很失落!求安慰
返回列表
签到
手机签到经验翻倍!
快来扫一扫!

Spring Cloud云服务架构 - common-service 项目构建过程

49浏览 / 1回复

qq_5418t8880...

qq_5418t8880l3r

0
精华
36
帖子

等  级:Lv.3
经  验:764
  • Z金豆: 252

    千万礼品等你来兑哦~快点击这里兑换吧~

  • 城  市:
  • 注  册:2017-11-17
  • 登  录:2017-12-12
发表于 2017-12-05 15:16:55
电梯直达 确定
楼主

我们将对common-service整个项目进行剖析,将整个构建的流程给记录下来,让更多的关注者来参考学习。

首先在构建spring cloud的common-service之前,我们需要准备的技术:

Maven(项目构建)、Spring Boot、Spring Cloud、微服务概念、去中心化思想、分布式等,针对于common-service的顶级项目,这里我们主要使用Maven来构建,闲话少说,我们直接上代码是最直观的。

1. 创建一个Maven的顶级项目,其中pom.xml文件配置如下:

Xml代码  Spring Cloud云服务架构 - common-service 项目构建过程

  1. xml version="1.0" encoding="UTF-8"?>  

  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  

  3.     xsi:schemalocetion="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  

  4.     <modelVersion>4.0.0modelVersion>  

  5. <parent>  

  6.         <groupId>org.springframework.cloudgroupId>  

  7.         <artifactId>spring-cloud-starter-parentartifactId>  

  8.         <version>Dalston.RELEASEversion>  

  9.         <relativePath />  

  10.     parent>  

  11.   

  12.     <groupId>com.ml.honghugroupId>  

  13.     <artifactId>particle-commonserviceartifactId>  

  14.     <version>0.0.1-SNAPSHOTversion>  

  15.     <packaging>pompackaging>  

  16.   

  17.     <name>particle-commonservicename>  

  18.     <descripqion>particle-commonservice project for Spring Bootdescripqion>  

  19.   

  20.     <modules>  

  21.         <module>particle-commonservice-configmodule>  

  22.         <module>particle-commonservice-eurekamodule>  

  23.         <module>particle-commonservice-mqmodule>  

  24.         <module>particle-commonservice-cachemodule>  

  25.         <module>particle-commonservice-ssomodule>  

  26.         <module>particle-commonservice-apigatewaymodule>  

  27.         <module>particle-commonservice-zipkinmodule>  

  28.         <module>particle-commonservice-adminmodule>  

  29.         <module>particle-commonservice-turbinemodule>  

  30.         <module>particle-commonservice-combinemodule>  

  31.         <module>particle-commonservice-sequencemodule>  

  32.     modules>  

  33.   

  34.     <properties>  

  35.         <project.build.sourceEncoding>UTF-8project.build.sourceEncoding>  

  36.         <project.reporting.outputEncoding>UTF-8project.reporting.outputEncoding>  

  37.         <java.version>1.8java.version>  

  38.           

  39.           

  40.         <validator.version>5.3.4.Finalvalidator.version>  

  41.         <shiro.version>1.2.3shiro.version>  

  42.         <druid.version>1.0.26druid.version>  

  43.         <mybatis-spring.version>1.2.2mybatis-spring.version>  

  44.         <shiro.version>1.2.3shiro.version>  

  45.         <druid.version>1.0.11druid.version>  

  46.         <ehcache.version>2.6.9ehcache.version>  

  47.         <ehcache-web.version>2.0.4ehcache-web.version>  

  48.         <sitemesh.version>2.4.2sitemesh.version>  

  49.         <activiti.version>5.15.1activiti.version>  

  50.         <wink.version>1.4wink.version>  

  51.         <sso.client.version>3.4.1sso.client.version> -->  

  52.   

  53.           

  54.         <slf4j.version>1.7.7slf4j.version>  

  55.         <commons-lang3.version>3.3.2commons-lang3.version>  

  56.         <commons-io.version>2.4commons-io.version>  

  57.         <commons-codec.version>1.9commons-codec.version>  

  58.         <commons-fileupload.version>1.3.1commons-fileupload.version>  

  59.         <commons-beanutils.version>1.9.1commons-beanutils.version>  

  60.         <fastjson.version>1.1.40fastjson.version>  

  61.         <xstream.version>1.4.7xstream.version>  

  62.         <guava.version>17.0guava.version>  

  63.         <dozer.version>5.5.1dozer.version>  

  64.         <email.version>1.4.7email.version>  

  65.         <poi.version>3.9poi.version>  

  66.         <cglib.version>3.2.5cglib.version>  

  67.           

  68.           

  69.         <aliyun-sdk-oss.version>2.6.0aliyun-sdk-oss.version>  

  70.         <aliyun-sdk-openservices-ons.version>1.2.7.Finalaliyun-sdk-openservices-ons.version>  

  71.         <com.ml.honghu.componet.version>0.0.1-SNAPSHOTcom.ml.honghu.componet.version>  

  72.         <spring-boot-admin.version>1.5.1spring-boot-admin.version>  

  73.         <fastjson.version>1.2.35fastjson.version>  

  74.     properties>  

  75.   

  76.     <dependencyManagement>  

  77.         <dependencies>  

  78.   

  79.               

  80.             <dependency>  

  81.                 <groupId>org.springframework.cloudgroupId>  

  82.                 <artifactId>spring-cloud-dependenciesartifactId>  

  83.                 <version>Dalston.RELEASEversion>  

  84.                 <type>pomtype>  

  85.                 <scope>importscope>  

  86.             dependency>  

  87.               

  88.             <dependency>  

  89.                 <groupId>org.jasig.cas.clientgroupId>  

  90.                 <artifactId>cas-client-coreartifactId>  

  91.                 <version>3.4.1version>  

  92.             dependency>  

  93.               

  94.             <dependency>  

  95.                 <groupId>io.springfoxgroupId>  

  96.                 <artifactId>springfox-swagger2artifactId>  

  97.                 <version>2.5.0version>  

  98.             dependency>  

  99.             <dependency>  

  100.                 <groupId>de.codecentricgroupId>  

  101.                 <artifactId>spring-boot-admin-serverartifactId>  

  102.                 <version>${spring-boot-admin.version}version>  

  103.             dependency>  

  104.             <dependency>  

  105.                 <groupId>de.codecentricgroupId>  

  106.                 <artifactId>spring-boot-admin-server-uiartifactId>  

  107.                 <version>${spring-boot-admin.version}version>  

  108.             dependency>  

  109.             <dependency>  

  110.                 <groupId>de.codecentricgroupId>  

  111.                 <artifactId>spring-boot-admin-server-ui-hystrixartifactId>  

  112.                 <version>${spring-boot-admin.version}version>  

  113.             dependency>  

  114.             <dependency>  

  115.                 <groupId>de.codecentricgroupId>  

  116.                 <artifactId>spring-boot-admin-server-ui-turbineartifactId>  

  117.                 <version>${spring-boot-admin.version}version>  

  118.             dependency>  

  119.             <dependency>  

  120.                 <groupId>de.codecentricgroupId>  

  121.                 <artifactId>spring-boot-admin-server-ui-loginartifactId>  

  122.                 <version>${spring-boot-admin.version}version>  

  123.             dependency>  

  124.             <dependency>  

  125.                 <groupId>de.codecentricgroupId>  

  126.                 <artifactId>spring-boot-admin-server-ui-activitiartifactId>  

  127.                 <version>${spring-boot-admin.version}version>  

  128.             dependency>  

  129.             <dependency>  

  130.                 <groupId>org.slf4jgroupId>  

  131.                 <artifactId>slf4j-apiartifactId>  

  132.                 <version>1.7.25version>  

  133.             dependency>  

  134.             <dependency>  

  135.                 <groupId>com.ml.honghugroupId>  

  136.                 <artifactId>component-bbseartifactId>  

  137.                 <version>${com.ml.honghu.componet.version}version>  

  138.             dependency>  

  139.             <dependency>  

  140.                 <groupId>com.ml.honghugroupId>  

  141.                 <artifactId>component-redisartifactId>  

  142.                 <version>${com.ml.honghu.componet.version}version>  

  143.             dependency>  

  144.             <dependency>  

  145.                 <groupId>com.ml.honghugroupId>  

  146.                 <artifactId>component-utilsartifactId>  

  147.                 <version>${com.ml.honghu.componet.version}version>  

  148.             dependency>  

  149.             <dependency>  

  150.                 <groupId>com.ml.honghugroupId>  

  151.                 <artifactId>component-sequence-apiartifactId>  

  152.                 <version>${com.ml.honghu.componet.version}version>  

  153.             dependency>  

  154.             <dependency>  

  155.                 <groupId>com.ml.honghugroupId>  

  156.                 <artifactId>component-admin-ui-zipkinartifactId>  

  157.                 <version>${com.ml.honghu.componet.version}version>  

  158.             dependency>  

  159.             <dependency>  

  160.                 <groupId>com.ml.honghugroupId>  

  161.                 <artifactId>component-admin-ui-routeartifactId>  

  162.                 <version>${com.ml.honghu.componet.version}version>  

  163.             dependency>  

  164.             <dependency>  

  165.                 <groupId>com.ml.honghugroupId>  

  166.                 <artifactId>component-zuul-labelartifactId>  

  167.                 <version>${com.ml.honghu.componet.version}version>  

  168.             dependency>  

  169.         dependencies>  

  170.     dependencyManagement>  

  171. project>  

 

当前的pom.xml文件引入了spring cloud相关版本配置,通用工具版本配置,honghu相关组件配置(因为其他的系统服务项目依赖于相关的组件,组件项目也是后面来创建的)


qq_5418t8880...

qq_5418t8880l3r


精华

帖子

等  级:Lv.3
经  验:764
发表于 2017-12-05 15:24:46 1楼

有兴趣可以加企鹅2147775633,希望可以帮助更多的好学者。

高级模式
论坛精选大家都在看24小时热帖7天热帖大家都在问最新回答

针对ZOL论坛您有任何使用问题和建议 您可以 联系论坛管理员查看帮助  或  给我提意见

快捷回复 APP下载 返回列表