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

GitHub authentication problem #12

Closed
hankur opened this issue Dec 19, 2021 · 8 comments
Closed

GitHub authentication problem #12

hankur opened this issue Dec 19, 2021 · 8 comments
Labels

Comments

@hankur
Copy link

hankur commented Dec 19, 2021

Could not transfer artifact de.exlll:configlib-bukkit:pom:2.2.0 from/to de.exlll (https://maven.pkg.github.com/Exlll/ConfigLib): authentication failed for https://maven.pkg.github.com/Exlll/ConfigLib/de/exlll/configlib-bukkit/2.2.0/configlib-bukkit-2.2.0.pom, status: 401 Unauthorized

@Exlll
Copy link
Owner

Exlll commented Dec 20, 2021

Hi,

you need to login with your username and a token that has the required permissions. You can generate such a token under Settings -> Developer Settings -> Personal access tokens.

@Cobeine
Copy link

Cobeine commented Jan 1, 2022

I cant access it too.

@Exlll
Copy link
Owner

Exlll commented Jan 1, 2022

Currently, there is no way to access a package from the Github Package Registry without authentication. If you want to download a package that is hosted here on Github, you have to define a repository and provide your credentials.

For Gradle (using Kotlin DSL), first go to your .gradle/gradle.properties file and add the following two lines where the token is a Github Token which was generated as I described above:

github.actor=<GITHUB USERNAME>
github.token=<GITHUB TOKEN>

Then, you need to define the repository in your build.gradle.kts and add the dependency:

repositories {
    mavenCentral()
        // ...
        maven {
            url = uri("https://maven.pkg.github.com/Exlll/ConfigLib")
            credentials {
                username = project.findProperty("github.actor") as String?
                        ?: System.getenv("GITHUB_ACTOR")
                password = project.findProperty("github.token") as String?
                        ?: System.getenv("GITHUB_TOKEN")
            }
        }
    }
}

dependencies {
    implementation("de.exlll:configlib-core:2.2.0")
}

For Maven, you basically have to do the same as described here.

@Insprill
Copy link
Contributor

Has there been any progress on alternative solutions?

@Exlll
Copy link
Owner

Exlll commented Aug 1, 2022

@Insprill I submitted a request to codemc.io to get access to Nexus almost a month ago. I guess they haven't had time to review this project. Three other people I asked recommended not using jitpack.io. Now I'm thinking about publishing to Maven Central but I'd prefer having a bit more control over the repository. Have you got any other suggestions?

@Insprill
Copy link
Contributor

Insprill commented Aug 1, 2022

I've only ever used Maven Central, but it's worked great for me. I got approved in a couple of hours and it's very simple to get set up with Gradle and the Nexus Publish Plugin.

@Exlll
Copy link
Owner

Exlll commented Aug 3, 2022

@Insprill Using the latest commit, you should now be able to use jitpack.io.

@Exlll Exlll pinned this issue Aug 4, 2022
@Exlll Exlll changed the title Can't access Maven repo GitHub authentication problem Aug 5, 2022
@Exlll Exlll added the question label Aug 5, 2022
@Exlll Exlll closed this as completed Dec 1, 2023
@Exlll
Copy link
Owner

Exlll commented Feb 24, 2024

This library is now also published to Maven Central.

@Exlll Exlll unpinned this issue Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants