binance-exchange / binance-java-api

binance-java-api is a lightweight Java library for the Binance API, supporting synchronous and asynchronous requests, as well as event streaming using WebSockets.
MIT License
830 stars 622 forks source link

Gradle: Could not find com.github.binance-exchange:binance-java-api:master-SNAPSHOT. #428

Closed thomasneuteboom closed 2 years ago

thomasneuteboom commented 2 years ago

As of today I can't download binance-java-api via Jitpack and Gradle.

Could not determine the dependencies of task ':compileJava'.
> Could not resolve all task dependencies for configuration ':compileClasspath'.
   > Could not find com.github.binance-exchange:binance-java-api:master-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/github/binance-exchange/binance-java-api/master-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/github/binance-exchange/binance-java-api/master-SNAPSHOT/binance-java-api-master-SNAPSHOT.pom
       - https://jitpack.io/com/github/binance-exchange/binance-java-api/master-SNAPSHOT/maven-metadata.xml
       - https://jitpack.io/com/github/binance-exchange/binance-java-api/master-SNAPSHOT/binance-java-api-master-08d52a49a3-1.pom
     Required by:
         project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

build.gradle.kts:

...
repositories {
    mavenCentral()
    maven {
        url = uri("https://jitpack.io")
    }
}
...
dependencies {
    implementation("com.github.binance-exchange:binance-java-api:master-SNAPSHOT")
}

Any solution for this?

Thanks in advance.

cezary-ptaszek commented 2 years ago

Try this:

...
repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
}
...
dependencies {
    implementation 'com.github.binance-exchange:binance-java-api:master'
}
thomasneuteboom commented 2 years ago

Hey! Thanks for your answer. It works, but unfortunately (and strangely) it pulls and builds an older version of 'master'. I fixed it by defining the latest commit hash like so:

...
repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
}
...
dependencies {
    implementation 'com.github.binance-exchange:binance-java-api:08d52a49a3031e504b0712f823d9aa0b0a1d142b'
}