spring cloud学习笔记---02各个微服务模块创建

创建各个微服务模块

商品服务、仓储服务、订单服务、优惠券服务、用户服务

每个模块的共同点:
- 1、每个模块都包含 webOpenFeign
- 2、每个服务的包名都统一为:top.mgy.gulimall.xxx(xxx表示模块名称,如product/order/ware/coupon/member)
- 3、模块名称统一为:gulimall-xxx(xxx表示服务名称 如:gulimall-product)

创建好的模块如下图:

设置gitigonre文件

将下面的文件忽略

**/mvnw
**/mvnw.cmd
**/.mvn
**/target
.idea
**/.gitignore

gulimall项目设置为聚合父项目

修改其pom文件.设置为聚合父项目后,每次打包或者编译执行mvn命令都会对所有子模块生效

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>top.mgy.gulimall</groupId>
    <artifactId>gulimall</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>gulimall</name>
    <description>聚合服务</description>
    <packaging>pom</packaging>

    <modules>
        <module>gulimall-coupon</module>
        <module>gulimall-member</module>
        <module>gulimall-order</module>
        <module>gulimall-product</module>
        <module>gulimall-ware</module>
    </modules>
</project>
原文地址:https://www.cnblogs.com/maguangyi/p/14111825.html