Open chavu opened 2 years ago
Since JCenter is deprecated I switched to GitHub packages for lack of a better solution. Unfortunately it requires authentication to download packages. I didn't document this in the README, and ideally you shouldn't have to authenticate, but that's how GitHub packages works. Below are the GitHub docs on how to get past this issue:
You need an access token to publish, install, and delete packages.
You can use a personal access token (PAT) to authenticate to GitHub Packages or the GitHub API. When you create a personal access token, you can assign the token different scopes depending on your needs. For more information about packages-related scopes for a PAT, see "About permissions for GitHub Packages."
..
Groovy
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")
}
}
}
Kotlin
repositories {
maven {
url = uri("https://maven.pkg.github.com/OWNER/REPOSITORY")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
}
}
I'm getting the rror below. WHat credentials shoudl I use?
-------------ERROR MSG--------------------------- Could not GET 'https://maven.pkg.github.com/timrs2998/pdf-builder/com/github/timrs2998/pdf-builder/1.9.0/pdf-builder-1.9.0.pom'. Received status code 401 from server: Unauthorized Disable Gradle 'offline mode' and sync project