2022-11-22 12:36:33 +08:00
|
|
|
|
|
2022-11-22 13:19:53 +08:00
|
|
|
|
|
|
|
|
|
# ecology开发环境
|
|
|
|
|
|
|
|
|
|
> 当前项目用于有兴趣一起协同开发的同事一起使用
|
|
|
|
|
>
|
|
|
|
|
> @author youHong.ai
|
2022-11-22 12:36:33 +08:00
|
|
|
|
|
|
|
|
|
## 项目构建启动
|
|
|
|
|
|
2022-11-22 13:19:53 +08:00
|
|
|
|
### 项目拉取配置
|
|
|
|
|
|
|
|
|
|
1. 新建项目文件夹
|
|
|
|
|
|
|
|
|
|
![image-20221122111433147](/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122111433147.png)
|
|
|
|
|
|
|
|
|
|
2. 执行git命令配置名称
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
git config --global user.name "yourName" # yourName 填写拼音,如you Hong.ai
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
3. 克隆项目
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
git clone git@gitee.com:it-xiaoxiong/e9-project-ebu7-dev1.git
|
|
|
|
|
# 或
|
|
|
|
|
git clone https://gitee.com/it-xiaoxiong/e9-project-ebu7-dev1.git
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
![image-20221122112306439](/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122112306439.png)
|
|
|
|
|
|
|
|
|
|
4. 项目导入idea
|
|
|
|
|
|
|
|
|
|
<img src="/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122113730903.png" alt="image-20221122113730903" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
<img src="/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122113814398.png" alt="image-20221122113814398" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
等待pom文件构建完成
|
|
|
|
|
|
|
|
|
|
![image-20221122113916299](/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122113916299.png)
|
|
|
|
|
|
|
|
|
|
5. 设置项目
|
|
|
|
|
|
|
|
|
|
新建lib\classbean文件夹(在lib下面新建classbean)
|
|
|
|
|
|
|
|
|
|
<img src="/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122114236545.png" alt="image-20221122114236545" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
设置项目结构
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img src="/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122113957228.png" alt="image-20221122113957228" style="zoom:33%;" />
|
|
|
|
|
|
|
|
|
|
![image-20221122114029683](/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122114029683.png)
|
|
|
|
|
|
|
|
|
|
![image-20221122114455378](/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122114455378.png)
|
|
|
|
|
|
|
|
|
|
![image-20221122114530103](/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122114530103.png)
|
|
|
|
|
|
|
|
|
|
<img src="/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122114617851.png" alt="image-20221122114617851" style="zoom: 33%;" />
|
|
|
|
|
|
|
|
|
|
如果有下面弹窗点击ok
|
|
|
|
|
|
|
|
|
|
<img src="/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122114642931.png" alt="image-20221122114642931" style="zoom:33%;" />
|
|
|
|
|
|
|
|
|
|
同样的方式将classbena和classbeanLib添加
|
|
|
|
|
|
|
|
|
|
<img src="/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122114743331.png" alt="image-20221122114743331" style="zoom:50%;" />
|
|
|
|
|
|
|
|
|
|
切换到Modules中,点击依赖项,修改sdk版本,看是否将之前的依赖是否存在,不存在点击左上角的加号导入进来
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
![image-20221122114849406](/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122114849406.png)
|
|
|
|
|
|
|
|
|
|
<img src="/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122115008978.png" alt="image-20221122115008978" style="zoom:33%;" />
|
|
|
|
|
|
|
|
|
|
最后点击应用(apply)后点击确认(ok)等待项目构建索引完毕
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 项目配置
|
|
|
|
|
|
|
|
|
|
将你本地demo的weaver.properties文件复制到src/main/resources/web-inf/prop文件夹中
|
|
|
|
|
|
|
|
|
|
<img src="/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122115303606.png" alt="image-20221122115303606" style="zoom:33%;" />
|
|
|
|
|
|
|
|
|
|
修改BaseTest文件中的应用跟路径
|
|
|
|
|
|
|
|
|
|
![image-20221122124437336](/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122124437336.png)
|
|
|
|
|
|
|
|
|
|
修改为当前项目的resource文件的绝对路径,文件路径可以设置也可以不设置,设置的话需要设置到你实际应用的附件地址,即ecology/web-inf/systemfile/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 测试
|
|
|
|
|
|
|
|
|
|
找到BaseTest文件,执行`public void with()`方法,如果正常执行如下即表示成功
|
|
|
|
|
|
|
|
|
|
![image-20221122124724449](/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122124724449.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 使用规范
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
包命名时,需要使用自己的名字作为包名称,如`com.youhong.ai`, `weaver.youhong.ai`
|
|
|
|
|
|
|
|
|
|
业务代码写在个人包下面,通用工具类单独抽出来存放在`ebu7common`包下面,即`src/mian/java/ebu7common`
|
|
|
|
|
|
|
|
|
|
如果有已经部署到客户环境的共有方法和类,不需要改变原有结构,防止出意外,新增的公有方法按照规范进行
|
|
|
|
|
|
|
|
|
|
![image-20221122125200782](/Users/aoey.oct.22/company/Fan_wei/文档/开发环境idea配置/ecology开发环境.assets/image-20221122125200782.png)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
==注意点==
|
|
|
|
|
|
|
|
|
|
> 注意事项
|
|
|
|
|
|
|
|
|
|
* 修改`.gitignore`文件时请注意不要将自己的配置文件(weaver.properties)包含在git管理中,需要排除在外(默认已经排除),已排除的文件尽量不要修改规则
|
|
|
|
|
* 如果项目中需要修改源码,请将涉及到修改源码的文件外出在git管理中,防止影响其他开发人员进行开发或二次修改源码引起的冲突
|
|
|
|
|
* 尽量每天工作完毕提交一次代码,但是需要保证代码能够正常通过编译,每天早上工作前同步一遍代码
|
|
|
|
|
* 提交代码之前先拉取代码到本地
|
|
|
|
|
* 遇到代码冲突时,冲突代码需要与他人沟通后处理
|
|
|
|
|
* maven文件中导如依赖需要注意依赖是否会和应用产生冲突
|
|
|
|
|
* 测试代码中的BaseTest.java属于默认排除文件,请不要将配置规则删除,否则影响他人使用单元测试
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 依赖更换
|
|
|
|
|
|
|
|
|
|
> 当前使用的依赖是Ecology9.00.2206.03的依赖
|
|
|
|
|
|
|
|
|
|
如果需要更改依赖的话,只需要将lib中的jar包更换为所需版本的依赖
|
|
|
|
|
|
|
|
|
|
具体方法如下lib/weaverLib/下的所有jar包和文件对应ecology/web-inf/lib中的jar和文件,只需将其删除并吧ecology/web-inf/lib中的文件拷贝到对应目录中即可
|
|
|
|
|
|
|
|
|
|
lib/classbeanLib/下的jar包对应ecology/classbean下的class文件,具体更换方式需要先进入到ecology/classbean目录中,打开终端(处于当前ecology/classbean目录中),执行一下代码
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
jar -cvf ecology-dev-lib.jar com DBstep weaver
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
进入ecology/web-inf/classes执行如下代码
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
jar -cvf web-inf-class-lib.jar com weaver org
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
将生成的jar包替换掉原来的jar包即可
|