6

I have a jar out in gitHub package registry called test.jar (version: 1.0.5), the repository name is testRepo, owner name: tejas3108.

I am trying to add this jar as a dependency in my other gradle project, but with correct credentials, I still get this message: Could not GET 'https://maven.pkg.github.com/tejas3108/com.tejas/1.0.5/testRepo-1.0.5.pom'. Received status code 422 from server: Unprocessable Entity. Pasting the same in the browser gives the message: Invalid path for maven file.

How do I successfully add this jar from the github registry to my build.gradle? Here is what I have now:

repositories {
    mavenCentral()
    maven{
        url = "https://maven.pkg.github.com/tejas3108"
        credentials {
            username = "tejas3108"
            password = "<my_github_token>"
        }
    }
}

dependencies {
   compile "com.tejas:testRepo:1.0.5"
}
4

1 回答 1

6

根据文档,URL 应包含存储库名称。所以,在你的情况下,写:

url = "https://maven.pkg.github.com/tejas3108/testRepo"
于 2019-11-16T16:04:51.307 回答