How to add GitHub Package Registry package as a Gradle dependency

血红的双手。 提交于 2019-11-30 21:19:57

First, configure Github Package Registry as a Maven repository in your Gradle build config:

build.gradle.kts:

repositories {
    jcenter()
    maven("https://maven.pkg.github.com/madhead") {
        credentials {
            username = "madhead"
            password = "<token>"
        }
    }
}

You can generate a token in your account settings page.

Now, add a dependency like:

build.gradle.kts:

dependencies {
    implementation("so57323260:so57323260:1.0.0")
    implementation("so57323260:test:1.0.2")
}

Here groupId is the repo's name and artifactId is the name of the published package.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!