最新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包

创建一个releases包.png

3.复制github链接到jitpack生成

jitpack.png
上一篇 下一篇

猜你喜欢

热点阅读