Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access private Github package registry via Gradle

Can't access private GitHub package registry

Checked info on "jcenter" how to make custom dependency, but there nothing about private dependency

build.gradle:

repositories{
 jcenter(){
   url "my_custom_package_githubRepository"
 }
}

dependencies{
  compile 'my_custom_dependency'
}

Expect how to get access to private GitHub package registry

like image 673
Serhii Zadorozhnyi Avatar asked Oct 21 '25 11:10

Serhii Zadorozhnyi


1 Answers

Follow this: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#authenticating-to-github-packages Be careful on how you set your id and token.

    repositories {
    maven {
        url = uri("https://maven.pkg.github.com/OWNER/REPOSITORY")
        credentials {
            username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
            password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
        }
    }
}
like image 65
Rodrigo Bautista Avatar answered Oct 23 '25 01:10

Rodrigo Bautista



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!