项目构建打包与容器部署

构建打包结构与部署方案.md

project-name-version-[debug|release].tar.gz


#解压到当前文件夹
tar zxvf project-name-version-[debug|release].tar.gz
#解压到特定文件夹 (例如解压到/usr/local/project-name-version-[debug|release])
tar zxvf project-name-version-[debug|release].tar.gz -C /usr/local
#运行
任意环境下运行bin/start.sh
#主配置文件
resources/config.yaml
#主数据文件
data


#虚拟机环境下 执行install.sh安装(推荐) 或 执行start.sh启动(不推荐)
cd project-name-version-[debug|release] && install.sh 安装
#Docker容器下 
cd project-name-version-[debug|release] && start.sh 启动

Gradle依赖的几种写法

#1. 关于依赖包的生命周期(不知道这个词是否合适)

# module内部可见,module外部不可见 google建议优先使用implementation依赖,如果有错则考虑使用api依赖
implementation "commons-dbutils:commons-dbutils:${commonsDbutilsVersion}" 
#api(compile已过时) module内部可见,module外部可见 编译需要的依赖,会打包进相应包中
api "commons-dbutils:commons-dbutils:${commonsDbutilsVersion}"
#runtime 编译时不需要,运行时需要的依赖,会打包进相应包中
runtime "mysql:mysql-connector-java:${mysqlConnectorVersion}"
#compileOnly(providedCompile已废弃)  编译时需要,但由jvm环境或其他系统环境提供,不会打包
#runtimeOnly(providedRuntime已废弃)  运行时需要,但由jvm环境或其他系统环境提供,不会打包

#testApi(testCompile) 编译测试用例时需要,不会被打包
#testImplementation 
#testRuntime 运行测试用例时需要,不会被打包
#debugImplementation(testCompile) 

#2. 关于依赖包相互依赖关系

#exclude 排除webmagic-core中对slf4j-log4j12的依赖,webmagic-core会被打包,但slf4j-log4j12不会打包
#        用于依赖冲突处理
implementation ("com.cetiti.webmagic:webmagic-core:${webmagicVersion}"){
    exclude group: 'org.slf4j', module: 'slf4j-log4j12'
}

#3. 关于依赖包存储位置

# 无仓库支持存储于本地的依赖包
implementation files('libs/ftp4j-1.7.2.jar')  
implementation files('libs/ftp4j-1.7.2.jar','libs/mymap.jar')  
# 依赖其它项目项目
implementation project(':agent-monitor')  #同级子项目
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章