一、准备工作
1、创建一个项目然后按图上的步骤进行

2、或者导入已有的library

二、第二歩
在build中添加

三、在project的build中添加

dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
这是是为了和远程jitpack保持联通
第四步 在library中添加 apply plugin: 'com.github.dcendents.android-maven'


apply plugin: 'com.github.dcendents.android-maven'
现在这个依赖库已经完成了一大半了。
五、将项目上传到你的github上 github上传不会的自行百度
上传成功后就是创建依赖的版本号
1.


如图点击releases 发布管理 填写一下内容
最后一步 进入jitpack页面

填写项目途径,它会自动检测你的依赖包和所有版本,然后点击get it
如果上传成功Log 绿色 失败 红色

接下来就可以在你的项目中使用自己的依赖了

到这里就一样完成了依赖包的所有步骤
网友评论