Can't use the Scala driver 4.0.0 due a broken dependency

This is mostly a bug report, but I am not sure if there is any workaround.

I am trying to use the new Scala driver version 4.0.0 but after bumping the dependency on my build.sbt file and reloading I got the following error.

sbt.librarymanagement.ResolveException: Error downloading org.mongodb.scala:bson-scala_2.13:4.0.0

Even on the Maven Repository you can see that the it depends on an unexisting dependency org.mongodb.scala » bson-scala_2.13 which you can also see on the published pom.

Do you have an estimated time of a followup release fixing this problem?

Hi @BalmungSan, welcome!

Thanks for reporting the issue. I’m able to reproduce the dependency issue that you’re seeing and opened JAVA-3655. Feel free to watch/up-vote the ticket to receive notification on it.

In the meantime, version 2.8.0 should work for now.

Regards,
Wan.

1 Like

Hi @wan thanks for the quick answer.
I will watch it closely.

BTW, for what I understand, it is not a new dependency, but rather a wrong one.
The failed one is org.mongodb.scala:bson-scala_2.13:4.0.0 however the artifact also depends on org.mongodb.scala:mongo-scala-bson:4.0.0 which feels very similar and that one does exists.

Hi @BalmungSan,

Thanks for reporting, I’ll look to fix and push a new release with a fixed pom in the near future. Looking at the pom file it looks like the build file has produced a duplication for bson:

<dependency>
    <groupId>org.mongodb.scala</groupId>
    <artifactId>bson-scala_2.13</artifactId>
    <version>4.0.0</version>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>org.mongodb.scala</groupId>
    <artifactId>mongo-scala-bson_2.13</artifactId>
    <version>4.0.0</version>
    <scope>compile</scope>
</dependency> 

So for now please update your sbt and ignore the the bson-scala dependency:

 libraryDependencies += "org.mongodb.scala" %% "mongo-scala-driver" % "4.0.0" exclude ("org.mongodb.scala", "bson-scala_2.13")

Ross

2 Likes