4. 项目初始结构创建及提交至gitee

基础模块创建:

1. 在IDEA中New Project from version control Git 复制刚才项目的地址,如https://gitee.com/zhang8090/gulimall.git,自动生成初始项目目录。

2. 按照下图方式创建相关模块(每个模块都要导入web和openFeign):

 

 

商品服务product

 

 

 

 

 

 

 

仓储服务ware

 

 

 订单服务order

优惠券服务coupon

用户服务member

整体效果如下:

 

 

 3. 创建父模块:在gulimall中创建pom.xml,可以从创建的子模块中复制一个过去修改。

修改后代码如下:

<?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>com.zm.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>

 

 

 将总服务添加进Maven

 

 

 此时,执行总服务相关命令,所有子模块也同步执行

 

 4. 修改总项目的ignore模板,为了提交时可以忽略掉垃圾文件。

修改后代码如下:

target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar

**/mvnw
**/mvnw.cmd

**/.mvn
**/target/
.idea
**/.gitignore

在Version control 中刷新查看可以提交的文件,右键ADD TO VCS,加入到版本控制中。

 

 5. 需要提交文件之前,先在IDEA的Setting中安装码云的插件。

 

 提交步骤:commit

 

commit:提交到本地仓库   commit and push:提交到码云

 

 Push

 

 提示Push成功

 

 可以到码云中查看:

 

posted @ 2022-03-27 19:40  明明改变世界  阅读(67)  评论(0编辑  收藏  举报