整个demo 项目github  https://github.com/lihonghao1017/andoridHotFix

maven地址https://github.com/lihonghao1017/HotFixAndroidMaven

1,创建一个Androidstudio 项目

     注意   apply plugin: 'com.android.library'  不能是application;  applicationId ‘报名’也注释掉  

    需要    apply plugin : 'maven'  

2,创建生成maven文件Task

uploadArchives{    repositories.mavenDeployer {        def mavenRepositoryPath = file(getProperty('aar.hotfix'))//aar.hotfix定义在gradle.properties,为生成maven目录        repository(url: "file://${mavenRepositoryPath.absolutePath}")        pom.project{            groupId "com.lihh.hotfix"            artifactId "hotfix"            version 1.1        }    }}

gradle.property

3,生成maven文件  打开gradle任务管理器   app->upload->uploadArchives  点击uploadArchives  生成maven文件

4,在github上创建maven工程,clone到桌面mavenFirst文件夹, 将生成的maven 文件提交到github

5使用  我的maven地址为https://github.com/lihonghao1017/HotFixAndroidMaven  

     通过maven 访问 需要将github.com改为raw.githubusercontent.com;即https://raw.githubusercontent.com/lihonghao1017/HotFixAndroidMaven  

  

GitHub的raw.githubusercontent.com无法链接

修改Hosts临时解决GitHub的raw.githubusercontent.com无法链接

通过IPAddress.com首页,输入raw.githubusercontent.com查询到真实IP地址
199.232.28.133
C:\Windows\System32\drivers\etc
hosts文件
添加 以下内容并保存即可恢复
199.232.28.133  raw.githubusercontent.com

 

6. 使用项目加入依赖

repositories{    jcenter()    maven {        url "https://raw.githubusercontent.com/lihonghao1017/HotFixAndroidMaven/master"    }}
dependencies {    implementation 'com.lihh.hotfix:hotfix:1.0'}

 

 

更多相关文章

  1. Android学习笔记之mainfest文件中android属性
  2. Android(安卓)Studio-Gradle项目中添加JNI生成文件(.so文件)
  3. android 一个奇怪的bug
  4. Android(安卓)对话框【Dialog】去除白色边框代码
  5. Android(安卓)一个APK文件部署产生多个应用安装的效果
  6. Android(安卓)keytool 生成证书MD5指纹
  7. Android(安卓)Studio 提示错误:No IDEA annotations attached to
  8. Android(安卓)错误 'roundIcon' in package 'android'
  9. android中@+id 与@string的使用

随机推荐

  1. Android Http get post请求
  2. android ListView使用的三种方法汇总(通
  3. android的Log日志打印管理工具类(一)
  4. Android Studio 指定签名证书文件
  5. Android:控件Spinner、getResources、setD
  6. android search...
  7. android去掉layout顶部的阴影(状态栏下边
  8. Android设备电量监控
  9. 一个大型新闻app的骨架(android)
  10. Android HMAC_SHA1 算法简单实现