Using maven github as the resolver in SBT

Has anyone successfully used a resolver that points to https://maven.pkg.github.com/ with authentication?

I have tried the following

ThisBuild / credentials += Credentials("Artifactory Realm", "Foo", "my-github-user", "my-access-token-with-read-package-permission")

val githubResolverUrl = url("https://maven.pkg.github.com/infinyon/fluvio-client-java")
ThisBuild / resolvers += Resolver.url("Foo", githubResolverUrl)(Resolver.ivyStylePatterns)

But I get get this error
unauthorized: https://maven.pkg.github.com/infinyon/fluvio-client-java/com.infinyon/fluvio-16/0.0.1/ivys/ivy.xml (GitHub Package Registry)

I tried putting the realm, username and password in ~/.ivy2/.credentials. But got the same error.

2 Likes

I did look into this a few months ago, and got it to work somehow. Then I learned there is a plugin which does it easily: https://github.com/djspiewak/sbt-github-packages

2 Likes