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

Package does not exist on Maven Central #5

Closed
bringert opened this issue May 6, 2024 · 4 comments
Closed

Package does not exist on Maven Central #5

bringert opened this issue May 6, 2024 · 4 comments

Comments

@bringert
Copy link

bringert commented May 6, 2024

README.md links to https://central.sonatype.com/artifact/com.braintrustdata.api/braintrust-java/0.2.0 which doesn't exist.

README.md also says to use this for Gradle, without any instructions about adding repos, which typically means that it should be on mavenCentral(), which it isn't:

implementation("com.braintrustdata.api:braintrust-java:0.2.0")

It looks like the package has been moved to GitHub Packages instead (https://github.com/braintrustdata/braintrust-java/packages/2062441), but there are no instructions in the README for how to set that up.

@bringert
Copy link
Author

bringert commented May 6, 2024

This can be solved by adding:

allprojects {
    repositories {
        ...
        maven {
            url = uri("https://maven.pkg.github.com/braintrustdata/braintrust-java")
            credentials {
                username = project.findProperty("gpr.user")
                password = project.findProperty("gpr.key")
            }
        }

This requires setting gpr.user to my github username and gpr.key to a github personal access token (classic) with the read:packages scope enabled. But that's a bit of a pain.

@manugoyal
Copy link
Contributor

manugoyal commented May 6, 2024

Thanks for flagging this @bringert! This SDK is extremely preliminary at the moment, so there are plenty of rough edges as you have discovered :)

Regarding this one, we are working with Stainless to get this published to maven central. But in the meantime, as you discovered, you can grab it through github packages. I have created an API token that can read public packages from this account which you are welcome to use.

    maven {
        url = uri("https://maven.pkg.github.com/braintrustdata/braintrust-java")
        credentials {
            // Feel free to use these credentials yourself. The token only has permission to read public packages.
            username = "manugoyal"
            password = "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"
        }
    }

We will update the docs with these instructions!

@manugoyal
Copy link
Contributor

Ok sorry it seems github has just revoked that access token because it's been posted publicly...

Will see if I can find a nicer workaround or get it published to maven central. But in the meantime, using an access key of your own should work.

@manugoyal
Copy link
Contributor

We have finally got this published to maven central! So you should only need something like the following in your gradle config:

repositories {
    // Use Maven Central for resolving dependencies.
    mavenCentral()
}

The package is com.braintrustdata.api:braintrust-java:0.5.0. Hope this works for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants