多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## 一、rayframework平台打包 ### **本地打包** 基于平台工程的ant任务**releaserayframework**; ![](https://img.kancloud.cn/35/29/3529785a60c80cc9c588a200c39ada1e_1366x736.png) 即可得到平台的最新版本核心包; >[info] 用于日常项目中的平台库更新; ### **从github包中获取最新版** ``` <dependency> <groupId>org.ray</groupId> <artifactId>rayframework</artifactId> <version>3.0.1</version> </dependency> ``` 需配置maven的配置文件,增加仓库的设置; 参考:[开发工具/github/发布库包](../%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7/github/%E5%8F%91%E5%B8%83%E5%BA%93%E5%8C%85.md)中的**工程中引用**; ## 二、rayframework工程 ##### **1、生成完整的工程结构** 基于平台工程的ant任务**generaterayframeworkappstructure**; ![](https://img.kancloud.cn/80/91/8091858b9f21cca6a86782a4b3aaaa89_1366x736.png) 执行完毕,在release目录下,会生成一个完整的工程结构; ![](https://img.kancloud.cn/07/f1/07f15fa1b3573b5eb5a3ebf02ade2af1_1210x350.png) >[info] 用于新建工程项目; ##### **2、在eclipse中,导入工程** 将生成的工程目录rayapp(可以随便改名)拷贝到当前工程空间目录; ![](https://img.kancloud.cn/5a/31/5a310ee159614e720a6da5f4ad0cb316_794x402.png) ![](https://img.kancloud.cn/e6/9e/e69e87c4a26d4ed51cf71cbc5e4199b4_1366x736.png) ![](https://img.kancloud.cn/99/d5/99d56e26f3eb930797a50f6e9510af06_525x550.png) ![](https://img.kancloud.cn/41/82/418234ef901a21fc224216669910028a_1366x736.png) ![](https://img.kancloud.cn/98/64/98645bd7a4f1e5be4ded3026efc048fc_653x645.png) ![](https://img.kancloud.cn/8d/1c/8d1c0a1ce612a769c7f19942da25ed9a_1366x736.png) ##### **3、配置maven build** ![](https://img.kancloud.cn/13/17/13176994eee4d5b17262c518a9eaac40_1366x736.png) ![](https://img.kancloud.cn/2d/55/2d5530abd952cb1a9a56eb918fe28e23_800x693.png) 即可执行了(这里默认配置的是appserver打包模式); ![](https://img.kancloud.cn/a2/8a/a28adece47afc193617f5815894f9185_1162x661.png) 如果需要继续配置其他打包模式,则可复制默认的appserver打包模式)配置,在复制的配置基础上,修改参数,即可打包jobserver模式了,同理类推是oauthserver模式和mixserver模式,mixserer是一个把三个服务器合并未一个的模式; ``` # 四种应用类型打包的具体命令配置 clean package -Dmaven.test.skip=true -P appserver clean package -Dmaven.test.skip=true -P jobserver clean package -Dmaven.test.skip=true -P oauthserver clean package -Dmaven.test.skip=true -P mixserver ``` 注意,考虑到工程同时支持appserver及jobserver等模式,需要配置多个,分别带上参数-P appserver、-P jobserver、-P oauthserver及-P mixserver等; ![](https://img.kancloud.cn/f8/f4/f8f462253e04c19a807e0a9e8c3d19c6_1162x661.png) 配置了maven build设置的时候,工程需要执行打包的时候,就会出现选择了; ![](https://img.kancloud.cn/c7/0c/c70c93c092ca384c0787ffcb1bc9ed02_1366x736.png) ![](https://img.kancloud.cn/47/b0/47b07cf1d04152432676d34ca558ae8b_1366x736.png) ## 三、项目化细节 ### **工程目录** 生成工程的时候,输入需要的工程名称; ### **POM文件** ![](https://img.kancloud.cn/ec/c4/ecc4d36f207b8877268ecc6be4e29935_1366x736.png) 只需要改artifactId这个名,一般建议跟工程名一致,即可,如rayapp改为raylucky; ### **工程多项目支持** 如果需要一个工程同时支持维护多个项目,通过application-runtime.properties文件中的配置项目来实现,启用不同的配置文件; ``` rayframework.server.current-project-branch= ``` 举例来说,一个工程有两个项目,分别dev和release ![](https://img.kancloud.cn/2f/5d/2f5d2ccf68103c56453468bbe1603dd7_463x477.png) 那么,如果当前需要打包release的版本,那么,需要把`rayframework.server.current-project-branch`设置为.release,即可;包括直接运行调试和打包的时候,都会自动的发布该选项设定的工程版本;