最新Android library 上传到 jitpack库
2021-04-20 本文已影响0人
wenju
1.在library的gradle添加如下代码
apply plugin: 'maven-publish'
android{
...
// Because the components are created only during the afterEvaluate phase, you must
// configure your publications using the afterEvaluate() lifecycle method.
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
// Applies the component for the release build variant.
from components.release
// You can then customize attributes of the publication as shown below.
groupId = 'com.example.library'
artifactId = 'final'
version = '1.0.0'
}
}
}
}
}
2.上传到github,创建一个releases包
![](https://img.haomeiwen.com/i14042736/f51c71b4ab4a66c1.png)
3.复制github链接到jitpack生成
![](https://img.haomeiwen.com/i14042736/f2ed962aa2e75d1d.png)