title: '智平台后台项目搭建'
linkTitle: '智平台后台项目搭建'
weight: 78785
``` 先不发布
## 概述
## 智平台后台代码管理使用说明
### 1.新建项目
### 1.1首先在git上面创建一下新的空项目:
![image-20220615140254640](D:/liujh/project/智平台/智平台代码主子模块使用说明/image-20220615140254640.png)
### 1.2 克隆项目
在本地将新建的项目克隆下来本地目录为:D:\liujh\smart_parent,克隆自己新建的项目
git clone http://scm.hollysmart.com/xxx.git
### 1.3 添加子项目
将智平台本身的代码作为子模块,在本地文件夹(D:\liujh\smart_parent)下执行(-b smart_platform06)为指定分支)
smart_platform06为当前截止到202206月的稳定版本
git submodule add -b smart_platform06 http://scm.hollysmart.com/jeecg2.4/jeecg-boot-framework.git
如果出现错误:
![image-20220616104128970](D:/liujh/project/智平台/智平台代码主子模块使用说明/image-20220616104128970.png)
执行:
git config –global core.longpaths true
即可
### 1.4 用idea打开项目后的目录结构
![image-20220615145229955](D:/liujh/project/智平台/智平台代码主子模块使用说明/image-20220615145229955.png)
#### 1.4.1设置为maven项目
创建好以后,将smart_parent项目设置为maven项目,选择smart_parent-->右键-->add freamwork support-->选择maven
![image-20220615145726200](D:/liujh/project/智平台/智平台代码主子模块使用说明/mage-20220615145726200.png)
![image-20220615145928152](D:\liujh\project\智平台\智平台代码主子模块使用说明\image-20220615145928152.png)
### 1.4.2修改smart_parent项目pom.xml
将jeecg-boot-framework项目的pom.xml中的截图中的模块复制到smart_parent项目pom.xml中
![image-20220615150215983](D:/liujh/project/智平台/智平台代码主子模块使用说明/image-20220615150215983.png)
拷贝过来以后,需要修改modules模块,将子模块jeecg-boot-framework的加入到modules中
修改后结构如图:
![image-20220615150452121](D:/liujh/project/智平台/智平台代码主子模块使用说明/image-20220615150452121.png)
修改pom.xml的groupId等信息,因为1.4.1中指定后,不会生成groupId,需要修改,修改后结果如图:
![image-20220615152018654](D:/liujh/project/智平台/智平台代码主子模块使用说明/image-20220615152018654.png)
## 1.5创建项目
将所需要创建的模块,进行创建,本次是以jeecg-module-yanglao为例
创建后的目录:
![image-20220615152255368](D:/liujh/project/智平台/智平台代码主子模块使用说明/image-20220615152255368.png)
至此项目创建完成。
将jeecg-boot-framework目录下的 .gitignore拷贝一份到smart_parent目录下。
将jeecg-boot-framework目录下的 spotbugs-exclude.xml拷贝一份到smart_parent目录下
![image-20220615153922008](D:/liujh/project/智平台/智平台代码主子模块使用说明/image-20220615153922008.png)
代码提交后的目录:
![image-20220615152713466](D:/liujh/project/智平台/智平台代码主子模块使用说明/image-20220615152713466.png)
## 1.6增加依赖
在jeecg-moudle-yanglao-start的pom.xml中增加依赖
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-okhttp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
## 启动项目
### 1.配置nacos的地址和命名空间
jeecg-boot-starter/jeecg-boot-starter-cloud/src/main/resources/bootstarp-dev.yml中进行配置
![image-20220615155255810](D:/liujh/project/智平台/智平台代码主子模块使用说明/image-20220615155255810.png)
### 2.nacos增加配置
jeecg-boot-starter/jeecg-boot-starter-cloud/nacos下的jeecg.yaml,jeecg-dev.yaml,jeecg-gateway-router.json文件配置到对应的namespace下
### 3.配置启动参数
![image-20220615155549651](D:/liujh/project/智平台/智平台代码主子模块使用说明/image-20220615155549651.png)
配置完成后,即启动项目即可
# 拉取项目
1.首先克隆主项目:
git clone http://scm.hollysmart.com/jeecg2.4/jeecg_parent.git
2.进入本地文件夹,克隆后的结果,
![image-20220615160005649](D:/liujh/project/智平台/智平台代码主子模块使用说明/image-20220615160005649.png)
子项目的目录是空,
在根目录下执行命令:
git submodule init; git submodule update;
![image-20220615160428553](D:/liujh/project/智平台/智平台代码主子模块使用说明/image-20220615160428553.png)
代码拉取完以后,配置本地的maven信息,使用公司私服即可,将自己的maven的配置文件改成这个setting.xml
[setting.xml]: "C:\Users\Administrator\Desktop\settings.xml" "setting.xml"
项目启动参考上面的【项目启动】即可
后续的代码更新,与以前没有区别,在子模块中的代码更新时,会通知大家进行更新,更新时只需要在子模块目录下打开git客户端pull代码即可
感谢您的反馈。如果您有关于如何使用 KubeSphere 的具体问题,请在 Slack 上提问。如果您想报告问题或提出改进建议,请在 GitHub 存储库中打开问题。
页面内容