The MongoDriverInformation class is part of driver-core and is in the com.mongodb.client package. This is unfortunate as it's the same package that is used for the standard driver CRUD API, e.g. com.mongodb.client.MongoCollection. And it can't just be moved into the driver module because it's also used by driver-async.
This hasn't been a problem because prior to Java 9 it it perfectly legal to split the same package between multiple jar files. But in order to deploy the driver on the module path, even as a set of automatic modules, package splits are forbidden and will result in an error like:
java.lang.module.ResolutionException: Module org.mongodb.driver.client contains package com.mongodb.client, module org.mongodb.driver.core exports package com.mongodb.client to org.mongodb.driver.client
To rectify this situation, MongoDriverInformation must be moved to a different package, and com.mongodb seems suitable.
While this is a breaking change, it is unlikely to affect end-user applications because this class was added only to support wrapping drivers like Reactive Streams and the Scala Driver, and those drivers can easily be updated to refer to the new location of this class. For that reason, we should consider doing this outside of a major release of the driver.
- is depended on by
-
JAVA-2521 Repackage the driver so that packages are no longer divided
- Closed