搭建Artifactory包管理仓库

2017/4/26 12:35 下午 posted in  包管理仓库  

1. maven 库管理软件介绍

Sonatype 和 bintray 都提供了可供自己部署的 maven 库管理软件。
Sonatype 提供了免费的sonatype/nexus,bintray 提供了免费的artifactory-oss。

2. 安装及配置

系统环境CentOS release 6.7 (Final)。

这里使用bitnami的应用快速部署服务。

  1. 下载一键安装包
    这里下载针对CentOS系统的jfrog-artifactory-oss的一键安装包。
  2. 安装
    执行下载的rpm包完成安装。
  3. 状态/启动/停止/重启

    # 查看artifactory服务总体的状态、启动、停止、重启
    artifactory-dir/ctlscript.sh status/start/stop/restart
    
    # 查看apache服务的状态、启动、停止、重启
    artifactory-dir/ctlscript.sh status/start/stop/restart apache
    
    # 查看tomcat服务的状态、启动、停止、重启
    artifactory-dir/ctlscript.sh status/start/stop/restart tomcat
    
  4. 配置
    Artifactory基本配置、aar打包上传
    Artifactory安全配置、包pom依赖配置

附:
Bitnami JFrog Artifactory帮助文档

3. JFrog Artifactory中的repository类别

libs-release-local = Your code releases
libs-snapshot-local= Your code snapshots
ext-release-local = Manually deployed 3rd party libs (releases)
ext-snapshot-local = Manually deployed 3rd party libs (shapshots)
plugins-release-local = Your and 3rd party plugins (releases)
plugins-snapshot-local =  Your and 3rd party plugins (snapshots)

参考:
What should be stored in “plugins-release-local” and “plugins-snapshot-local” repository

4. gradle打包上传相关命令

# 打包aar并发布
./gradlew assembleRelease artifactoryPublish

# 清空gradle缓存
./gradlew clean --refresh-dependencies

# 查看依赖树
./gradlew app:dependencies