Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unable to read from github packages #70

Open
ashwinbhaskar opened this issue May 29, 2022 · 2 comments
Open

[Bug]: Unable to read from github packages #70

ashwinbhaskar opened this issue May 29, 2022 · 2 comments
Assignees
Labels
bug Something isn't working SBT

Comments

@ashwinbhaskar
Copy link

ashwinbhaskar commented May 29, 2022

What happened
I use SBT and I am trying to download the fluvio java client. This is in my build.sbt file

ThisBuild / credentials += Credentials("Artifactory Realm", "maven.pkg.github.com", "my-user-name", "my accees token with read packages role")

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

libraryDependencies += "com.infinyon" % "fluvio-16" % "0.12.11"

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

When I navigate to https://maven.pkg.github.com/infinyon/fluvio-client-java/com.infinyon/fluvio-16/0.12.11/ivys/ivy.xml on my browser. It asks me to enter username and token. After entering it displays this message
maven package "com.infinyon.fluvio-16.0.12.11" does not exist under owner "infinyon"

Expected behavior
Should allow me to download the client because my auth is correct.

Describe the setup

  • Are you using a local Fluvio install? Minikube? Fluvio Cloud? - yes
  • What version of Fluvio are you using? fluvio version

How to reproduce it (as minimally and precisely as possible)
Steps to reproduce the behavior:

  1. Run the commands
sbt new scala/scala3.g8
##Give a name to project, say fluvio-test
cd fluvio-test
  1. Open the file build.sbt and paste the following
val scala3Version = "3.1.2"

ThisBuild / credentials += Credentials("Artifactory Realm", "maven.pkg.github.com", "<username>", "<access-token>")

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

lazy val root = project
  .in(file("."))
  .settings(
    name := "fluvio-test",
    version := "0.1.0-SNAPSHOT",

    scalaVersion := scala3Version,

    libraryDependencies ++= Seq(
      "com.infinyon" % "fluvio-16" % "0.12.11",
      "org.scalameta" %% "munit" % "0.7.29" % Test
    )
  )

  1. Run sbt compile in the root folder of the project.

Additional context
Add any other context about the problem here.

@ashwinbhaskar ashwinbhaskar added the bug Something isn't working label May 29, 2022
@sehz
Copy link

sehz commented May 29, 2022

Thanks for the filing issue. Moving to Java client repo

@sehz sehz transferred this issue from infinyon/fluvio May 29, 2022
@sehz sehz added the SBT label May 29, 2022
@ashwinbhaskar
Copy link
Author

I was able to make this work by using this sbt plugin. Adding the snippet for someone that is stuck like me and would want to use the plugin instead. Add this to your build.sbt file

ThisBuild / resolvers += Resolver.githubPackages("infinyon")

ThisBuild / githubTokenSource := TokenSource.Environment("GITHUB_TOKEN") // Make sure you set the environment variable `GITHUB_TOKEN` before starting sbt

@galibey galibey removed their assignment May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SBT
Projects
None yet
Development

No branches or pull requests

4 participants