metaplex-foundation / SolanaKT

This is a open source library on kotlin for Solana protocol.
MIT License
71 stars 36 forks source link

Artifact resolving via Jitpack does not work #58

Closed antonyshchenko closed 2 years ago

antonyshchenko commented 3 years ago

Adding dependency to build.gradle

    implementation "com.github.ajamaica.Solana.kt:solana:1.0.0"

results in

      > Could not resolve com.github.ajamaica.Solana.kt:solana:1.0.0.
         > Could not get resource 'https://jitpack.io/com/github/ajamaica/Solana/kt/solana/1.0.0/solana-1.0.0.pom'.
            > Could not GET 'https://jitpack.io/com/github/ajamaica/Solana/kt/solana/1.0.0/solana-1.0.0.pom'. Received status code 401 from server: Unauthorized

Is there any other way to try the library without building it locally?

samdowd commented 2 years ago

As you can see in your error, jitpack is looking for the pom at https://jitpack.io/com/github/ajamaica/Solana/kt/solana/1.0.0/solana-1.0.0.pom.

The pom is actually located at https://jitpack.io/com/github/ajamaica/Solana.kt/1.0.0/Solana.kt-1.0.0.pom.

One problem is the Solana "." kt. Gradle is expanding this as Solana/kt when looking for the pom, but that's not how it's stored. Another problem is the extra /solana/ directory in there.

I was unable to find a configuration that makes the jitpack import properly. I found a method to point to the pom in the correct place, but then it complained that the way I had pointed to it made the package name ajamaica instead of com.github.ajamaica so it still wouldn't build. Would love to know the proper way to import this package.

samdowd commented 2 years ago

For those who try later, I was able to use GitHub Packages instead of Jitpack with the following configuration. Might be worth adding to the readme.

settings.gradle

repositories {
  maven {
     url = "https://maven.pkg.github.com/ajamaica/Solana.kt"
     credentials {
        username = "samdowd"
        password = "[token]"
    }
  }
}

build.gradle

implementation 'com.solana:solana:1.0.0'

The token is a GitHub Personal Access Token with permission read:packages.

samdowd commented 2 years ago

This is closed by the repo name change @ajamaica