三 后台环境搭建 - 2. 创建工程

2. 创建工程

分支: git checkout -b 3.2.0_init

2.1 项目架构图

img

2.2 工程创建计划

img

2.3 Maven 工程和 Maven 模块

2.3.1 创建父工程 atcrowdfunding01-admin-parent

GroupId: com.atguigu.crowd

  1. New Project

img

  • GitHub

img

  1. 选择 Maven

img

  1. 命名: atcrowdfinding01-admin-parend

    1. GroupId: com.atguigu.crowd

img

2.3.2 创建子工程 atcrowdfunding02-admin-webui
2.3.3 创建子工程 atcrowdfunding03-admin-component
2.3.4 创建子工程 atcrowdfunding04-admin-entity
  1. 选择 Module

img

  1. 选择 Mavne

img

  1. 命名

img

2.3.5 创建公共模块 atcrowdfunding05-common-util
2.3.6 创建公共模块 atcrowdfunding06-common-reverse

GroupId: com.atguigu.crowd

  1. 选择 Module

img

  1. 父依赖选择空

img

  1. 命名并设置 GroupId: com.atguigu.crowd

img

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>

img

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文件删除了。

img

img

  • 报错:
no matches found: ./.git.*
  • 使用:
find . \( -type d -empty \) -exec touch {}/.gitxxx \;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值