大飞

大飞 关注TA

挑战一切!

大飞

大飞

关注TA

挑战一切!

  •  世界的顶端
  • 混口饭吃
  • 写了333,609字

最近回复

该文章投稿至Nemo社区   Android  板块 复制链接


Android 自建maven库

发布于 2019/05/29 11:05 19,223浏览 0回复 980

  一.安装免费的nexus 已mac为例

      1.在密令窗口输入 brew install nexus进行安装

      2.启动服务 brew services start nexus

     3.在浏览器输入http://127.0.0.1:8081/nexus/  就可以看到以下界面,默认账号密码admin/admin123

     

     二.配置gradle

        1.创建library

        2.在library的gradle最后一行配置一下信息,与android{} 同级别

uploadArchives {
repositories {
mavenDeployer {
snapshotRepository(url: "http://localhost:8081/nexus/content/repositories/snapshots/") {
authentication(userName: "admin", password: 'admin123')
}
pom.version = '0.1.1-dev-SNAPSHOT'
pom.artifactId = 'yf-utils'
pom.groupId = 'com.yf.android'
pom.name = 'yf-utils'
pom.packaging = 'aar'
}
}
}

     3.运行uploadArchives

     


 执行完成就可以在nuxes 上看到自己的arr包


   4.依赖自己构建的库,添加自己的maven和添加依赖

     




点赞(0)
本文标签
 android
点了个评