[JAVA-2520] Add module-info.java for each module Created: 26/May/17 Updated: 30/Mar/22 |
|
| Status: | Backlog |
| Project: | Java Driver |
| Component/s: | Packaging |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Case: | (copied to CRM) |
| Description |
|
Non-automatic Java 9 modules require a module-info.java file for each module in the root of the source tree. This is complicated for a library like the Java driver which targets older JREs. From what I can tell looking at other libraries like SLF4J, we'll need to compile all .java files except module-info.java targeting Java 8, and compile module-info.java targeting Java 9. |
| Comments |
| Comment by Jeffrey Yemin [ 11/Mar/19 ] |
|
It's not the dependency on the JAVA ticket for zstd/snappy, it's the library dependency that we took adding their own module-info. |
| Comment by Ian Whalen (Inactive) [ 11/Mar/19 ] |
|
K. I see zstd as done ( |
| Comment by Jeffrey Yemin [ 11/Mar/19 ] |
|
It's more blocked on the zstd and snappy libs at this point. It depends on |
| Comment by Ian Whalen (Inactive) [ 11/Mar/19 ] |
|
jeff.yemin is this now blocked on |
| Comment by Ian Whalen (Inactive) [ 04/Mar/19 ] |
|
Just an update that it looks like slf4j has done this so now we're just blocked on removing netty. might also be blocked on zstd and snappy libs? jeff.yemin to confirm. |
| Comment by Christoph Strobl [ 14/Jan/19 ] |
|
Support for using just mongodb-driver-core & mongodb-driver-sync along with Spring Data MongoDB requires some breaking changes in Spring Datas public API. |
| Comment by Jeffrey Yemin [ 13/Jan/19 ] |
|
HI muratozkan, Yes we've made progress. See http://mongodb.github.io/mongo-java-driver/3.9/driver/getting-started/installation/ for the automatic module names we've declared. The problem is that, due to some package decisions that were made early on in the driver, there are some jar file combinations where the same package exists in both jar files: in particular mongodb-driver and mongodb-driver-core. Since the 3.7 release, we have given users an option that avoid that problem: the mongodb-driver-sync jar file, whose automatic module name is org.mongodb.driver.sync.client. At this point, I'm not sure if there is a way to get this working with Spring, as I don't know exactly what it depends on. cstrobl, do you have anything you can add here?
In regard to actually adding module-info.java files, we don't intend to do that until all of our dependencies do: in particular, SLF4J, Netty, and snappy-java have not declare their module names yet.
|
| Comment by Murat Ozkan [ 13/Jan/19 ] |
|
Hi, Is there any progress on this issue? Currently, we cannot use jlink in our project with SpringBoot 2.1.2.RELEASE which has the following dependencies (skipping irrelevant ones):
The problem with jlink is this: Error: Modules org.mongodb.driver.core and mongodb.driver export package com.mongodb to module xxxxx There's no module-info.java in any mongodb jars, then automodule generation kicks in. That also fails because the package names in mongodb-driver and mongodb-driver-core are the same. Since there's automodules, we don't have to wait until every other dependency has a module-info.java file. Cheers, Murat
|
| Comment by Jeffrey Yemin [ 14/Dec/17 ] |
|
Currently blocked waiting for downstream dependencies SLF4J and Netty to commit to module names. |
| Comment by Jeffrey Yemin [ 04/Dec/17 ] |
|
IntelliJ is also going to be a problem because module syntax is only allowed when the language level is set to Java 9, which we don't want to for anything else in order to support running on older JDKs. |