So, I have a GitHub project with a Package Registry configured. It has two packages:
Package pages have instructions only for Maven, besides that, the instr
New answer:
GitHub has published the official guide: Configuring Gradle for use with GitHub Packages.
Old answer:
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.