栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

分布式基础多模块工程搭建

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

分布式基础多模块工程搭建

多模块项目 :
父:pom

    org.example
    gulimmall1
    pom
    1.0-SNAPSHOT
    
        gulimall-common
        gulimall-coupon
        gulimall-gateway
        gulimall-member
        gulimall-order
        gulimall-product
        gulimall-ware
    

配置中心:
引入父依赖;

 
        gulimmall1
        org.example
        1.0-SNAPSHOT
    
    4.0.0

    gulimall-common
    
        10
        Greenwich.SR3
    
    
        
            org.springframework.boot
            spring-boot-starter-web
            2.6.7
        

        
            org.mybatis.spring.boot
            mybatis-spring-boot-starter
            2.2.1
        

        
            org.projectlombok
            lombok
            1.18.8
        

        
        
            org.apache.httpcomponents
            httpcore
            4.4.12
        
        
            commons-lang
            commons-lang
            2.6
        
        
        
        
            mysql
            mysql-connector-java
            8.0.17
        
        
            javax.servlet
            servlet-api
            2.5
            provided
        
        
        
            com.alibaba.cloud
            spring-cloud-starter-alibaba-nacos-discovery
        
        
        
            com.alibaba.cloud
            spring-cloud-starter-alibaba-nacos-config
        






        
            com.alibaba
            fastjson
            1.2.15
        
        
            org.apache.httpcomponents
            httpclient
            4.2.1
        
        
            org.apache.httpcomponents
            httpcore
            4.2.1
        
        
            commons-lang
            commons-lang
            2.6
        
        
            org.eclipse.jetty
            jetty-util
            9.3.7.v20160115
        

        
            com.alibaba.cloud
            spring-cloud-starter-alibaba-sentinel
        

        
        
        
        
        
        

        
        
            org.springframework.cloud
            spring-cloud-starter-zipkin
        
    
    
        
            
                org.springframework.cloud
                spring-cloud-dependencies
                ${spring-cloud.version}
                pom
                import
            
            
                com.alibaba.cloud
                spring-cloud-alibaba-dependencies
                2.1.0.RELEASE
                pom
                import
            
        
    

子模块:

   
        org.springframework.boot
        spring-boot-starter-parent
        2.1.8.RELEASE
         
    
    4.0.0
    gulimall-coupon
    
        1.8
        Greenwich.SR3
    
    
        
            org.example
            gulimall-common
            1.0-SNAPSHOT
        
    

配置中心:
注意配置中心的名字:

  application:
    name: gulimall-product
  cloud:
    nacos:
      discovery:
        server-addr: 192.168.31.190:8848

再启动类中加上注解:

@SpringBootApplication
@EnableDiscoveryClient   //服务发现
public class Main {
	public static void main(String[] args) {
		SpringApplication.run( Main.class,args );
	}
}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/972299.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号