![c99d4a09ffbb1ae17cedd1994fb5ba6f.png](https://i-blog.csdnimg.cn/blog_migrate/8be99dd0d3c26c8934c2c8c54ff840ba.jpeg)
为了解决什么问题?
一直以来安卓终端会编译一些common的aar包,然后在项目中引用、那么一般使用aar包需要几个步骤呢?
- copy 到项目的 lib 目录下
- 项目中 build.gradle 中声明使用lib位置
- 使用命令进行引用
以上方法除了繁琐之外,还存存在A更换了引用包、B 在使用时需要重新 rebuild 才能使用,否则会报错
相遇
初次是看到有人利用github搭建了一个公有的 maven 仓库、后来就在想能否在 gitlab 实现此功能、此处涉及到 github 是公开的库, gitlab 是私有的库。
实现步骤
一、打包配置发布
//打包发布配置开始
apply plugin: 'maven'
uploadArchives {
repositories.mavenDeployer {
def mavenDirPath = file('../') // 本地存放地址
repository(url: "file://${mavenDirPath.absolutePath}")
pom.project {
groupId "com.amos.modul