Using a personal library hosted on github as a gradle dependency

I have an android library hosted on github and you need to add it as a dependency to another project without routine cloning the repository and adding it as a module dependency. How do I create my own gradle dependency with a link from github? Thanks!

+4
source share
3 answers

If you put your code on GitHub, then sharing files with JitPack is easy.

Your users just have to add the repository to their build.gradle file:

repositories {
    jcenter()
    maven { url "https://jitpack.io" }
}

and then your GitHub repository as a dependency:

dependencies {
    compile 'com.github.YourUsername:Repo:Release'
}

JitPack maven Maven Central. , . JitPack GitHub . GitHub, .

, Android.

+2

Github maven. " ", , , jCenter, gradle .

+1

, Gradle. , , Maven Central. gradle Maven Central . http://central.sonatype.org/pages/gradle.html#releasing-the-deployment-to-the-central-repository.

After publishing to Maven Central, use the standard gradle dependency declaration.

+1
source

Source: https://habr.com/ru/post/1608031/


All Articles