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包
创建一个releases包.png
3.复制github链接到jitpack生成
jitpack.png
网友评论