2. 创建工程
分支: git checkout -b 3.2.0_init
2.1 项目架构图
2.2 工程创建计划
2.3 Maven 工程和 Maven 模块
2.3.1 创建父工程 atcrowdfunding01-admin-parent
GroupId: com.atguigu.crowd
- New Project
- GitHub
- 选择 Maven
-
命名: atcrowdfinding01-admin-parend
-
- GroupId:
com.atguigu.crowd
- GroupId:
2.3.2 创建子工程 atcrowdfunding02-admin-webui
2.3.3 创建子工程 atcrowdfunding03-admin-component
2.3.4 创建子工程 atcrowdfunding04-admin-entity
- 选择
Module
- 选择 Mavne
- 命名
2.3.5 创建公共模块 atcrowdfunding05-common-util
2.3.6 创建公共模块 atcrowdfunding06-common-reverse
GroupId: com.atguigu.crowd
- 选择
Module
- 父依赖选择空
- 命名并设置 GroupId:
com.atguigu.crowd
2.4. 建立过程间的依赖关系
- webui 依赖 component
- component 依赖 entity
- component 依赖 util
2.4.1 webui 依赖 component
- pom.xml 设置
<dependencies>
<dependency>
<groupId>com.atguigu.crowd</groupId>
<artifactId>atcrowdfunding03-admin-component</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
2.4.2 component 依赖 entity 和 util
- pom.xml 设置
<dependencies>
<dependency>
<groupId>com.atguigu.crowd</groupId>
<artifactId>atcrowdfunding04-admin-entity</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.atguigu.crowd</groupId>
<artifactId>atcrowdfunding05-common-util</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
2.5 github 不能上传空文件夹
在项目开发中,我们有时候会遇到要上传空文件夹到远程服务器的情况,在这里我提供了将空文件夹上传到github仓库中的方法的完美方案(创建无关文件,删除无关文件)。众所周知,git仅仅跟踪文件的变动,不跟踪目录。
方法:先在目录下的所有空文件夹下,创建一个无关文件(.gitxxx文件)。
在项目的根目录下输入命令行(用Git Bash Here打开),
find . \( -type d -empty \) -and \( -not -regex ./\.git.* \) -exec touch {}/.gitxxx \;
这样,在目录下的所有空文件夹下,就有.gitxxx文件了。此时,你可以上传此项目到远程服务器了,相信大家还有一个困惑,空文件夹下的.gitxxx文件,并不是我们 想看到的,所有在开发到一定阶段时,我们可以通过命令行删除所有的.gitxxx文件(无关文件)
删除当前目录下的.gitxxx文件
find ./ -type f -name '.gitxxx' -delete
这样,你就可以把目录下的所有.gitxxx文件删除了。
- 报错:
no matches found: ./.git.*
- 使用:
find . \( -type d -empty \) -exec touch {}/.gitxxx \;