HamaWhiteGG / langchain-java

Java version of LangChain, while empowering LLM for Big Data.
Apache License 2.0
551 stars 107 forks source link

Dependency convergence errors when adding langchain-java as a Maven dependency #129

Closed bdanielby closed 11 months ago

bdanielby commented 1 year ago

Thanks for this great library! When importing it as a dependency in Maven, we observe the following dependency convergence errors between direct dependencies of langchain-java and indirect ones. We'd be very grateful if you could find a consistent choice of dependencies or use <exclusion>-tags in your pom.xml to avoid the convergence errors. Thank you very much in advance:

Dependency convergence error for io.netty:netty-resolver-dns:jar:4.1.77.Final paths to dependency are:

<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-org.redisson:redisson:jar:3.17.3:compile
      +-io.netty:netty-resolver-dns:jar:4.1.77.Final:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-io.netty:netty-resolver-dns:jar:4.1.43.Final:compile

[ERROR]
Dependency convergence error for org.apache.commons:commons-collections4:jar:4.3 paths to dependency are:
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-io.milvus:milvus-sdk-java:jar:2.2.9:compile
      +-org.apache.commons:commons-collections4:jar:4.3:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-org.apache.commons:commons-collections4:jar:4.4:compile

[ERROR]
Dependency convergence error for io.netty:netty-resolver:jar:4.1.77.Final paths to dependency are:
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-org.redisson:redisson:jar:3.17.3:compile
      +-io.netty:netty-transport:jar:4.1.77.Final:compile
        +-io.netty:netty-resolver:jar:4.1.77.Final:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-org.redisson:redisson:jar:3.17.3:compile
      +-io.netty:netty-resolver:jar:4.1.77.Final:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-org.redisson:redisson:jar:3.17.3:compile
      +-io.netty:netty-handler:jar:4.1.77.Final:compile
        +-io.netty:netty-resolver:jar:4.1.77.Final:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-io.netty:netty-resolver:jar:4.1.43.Final:compile

[ERROR]
Dependency convergence error for io.reactivex.rxjava2:rxjava:jar:2.0.0 paths to dependency are:
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-io.github.hamawhitegg:openai-client:jar:0.2.0:compile
      +-com.squareup.retrofit2:adapter-rxjava2:jar:2.9.0:compile
        +-io.reactivex.rxjava2:rxjava:jar:2.0.0:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-io.reactivex.rxjava2:rxjava:jar:2.2.21:compile

[ERROR]
Dependency convergence error for org.apache.httpcomponents:httpcore:jar:4.4.15 paths to dependency are:
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-com.google.api-client:google-api-client:jar:2.2.0:compile
      +-com.google.http-client:google-http-client-apache-v2:jar:1.42.3:compile
        +-org.apache.httpcomponents:httpcore:jar:4.4.15:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-com.google.api-client:google-api-client:jar:2.2.0:compile
      +-org.apache.httpcomponents:httpcore:jar:4.4.16:compile

[ERROR]
Dependency convergence error for org.apache.httpcomponents:httpclient:jar:4.5.13 paths to dependency are:
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-com.google.api-client:google-api-client:jar:2.2.0:compile
      +-com.google.http-client:google-http-client-apache-v2:jar:1.42.3:compile
        +-org.apache.httpcomponents:httpclient:jar:4.5.13:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-com.google.api-client:google-api-client:jar:2.2.0:compile
      +-org.apache.httpcomponents:httpclient:jar:4.5.14:compile

[ERROR]
Dependency convergence error for io.projectreactor:reactor-core:jar:3.4.13 paths to dependency are:
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-org.redisson:redisson:jar:3.17.3:compile
      +-io.projectreactor:reactor-core:jar:3.4.13:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-io.projectreactor:reactor-core:jar:3.5.8:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-io.projectreactor.addons:reactor-adapter:jar:3.5.1:compile
      +-io.projectreactor:reactor-core:jar:3.5.4:compile

[ERROR]
Dependency convergence error for org.reactivestreams:reactive-streams:jar:1.0.3 paths to dependency are:
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-io.github.hamawhitegg:openai-client:jar:0.2.0:compile
      +-com.squareup.retrofit2:adapter-rxjava2:jar:2.9.0:compile
        +-org.reactivestreams:reactive-streams:jar:1.0.3:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-org.redisson:redisson:jar:3.17.3:compile
      +-org.reactivestreams:reactive-streams:jar:1.0.3:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-org.redisson:redisson:jar:3.17.3:compile
      +-io.reactivex.rxjava3:rxjava:jar:3.1.6:compile
        +-org.reactivestreams:reactive-streams:jar:1.0.4:compile

[ERROR]
Dependency convergence error for com.google.http-client:google-http-client-gson:jar:1.42.0 paths to dependency are:
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-com.google.api-client:google-api-client:jar:2.2.0:compile
      +-com.google.oauth-client:google-oauth-client:jar:1.34.1:compile
        +-com.google.http-client:google-http-client-gson:jar:1.42.0:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-com.google.api-client:google-api-client:jar:2.2.0:compile
      +-com.google.http-client:google-http-client-gson:jar:1.42.3:compile

[ERROR]
Dependency convergence error for org.apache.commons:commons-text:jar:1.6 paths to dependency are:
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-io.milvus:milvus-sdk-java:jar:2.2.9:compile
      +-org.apache.commons:commons-text:jar:1.6:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-org.apache.commons:commons-text:jar:1.10.0:compile

[ERROR]
Dependency convergence error for com.google.http-client:google-http-client:jar:1.42.0 paths to dependency are:
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-com.google.api-client:google-api-client:jar:2.2.0:compile
      +-com.google.oauth-client:google-oauth-client:jar:1.34.1:compile
        +-com.google.http-client:google-http-client:jar:1.42.0:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-com.google.api-client:google-api-client:jar:2.2.0:compile
      +-com.google.http-client:google-http-client-apache-v2:jar:1.42.3:compile
        +-com.google.http-client:google-http-client:jar:1.42.3:compile
and
<our project>
  +-io.github.hamawhitegg:langchain-core:jar:0.2.0:compile
    +-com.google.api-client:google-api-client:jar:2.2.0:compile
      +-com.google.http-client:google-http-client:jar:1.42.3:compile
HamaWhiteGG commented 11 months ago

Thank you very much for your detailed description. My optimization strategy is as follows:

  1. Set the scope of milvus-sdk-java and redisson to "provided."
  2. Remove netty-resolver and netty-resolver-dns.
  3. Resolve conflicts through exclusions.

Currently, the only remaining conflict is within google-api-client itself. I hope that google-api-client resolves the issue on its own, or I can also set its scope to "provided."

image