Skip to content

Instantly share code, notes, and snippets.

@SebastianAigner
Created March 15, 2025 13:53
Show Gist options
  • Save SebastianAigner/887e65dfdd3682765052372493424662 to your computer and use it in GitHub Desktop.
Save SebastianAigner/887e65dfdd3682765052372493424662 to your computer and use it in GitHub Desktop.
A Better Gradle Registry Snippet
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/OWNER/REPOSITORY")
credentials {
username = project.findProperty("gpr.user") as String? ?: (System.getenv("USERNAME")
?: error("No GitHub Packages Gradle registry username specified."))
password = project.findProperty("gpr.key") as String? ?: (System.getenv("TOKEN")
?: error("No GitHub Packages Gradle registry password specified."))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment