[CONJ-879] Provide a full JPMS module descriptor Created: 2021-05-11 Updated: 2021-08-30 Resolved: 2021-08-30 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | java9, metadata |
| Affects Version/s: | 3.0.0 |
| Fix Version/s: | 3.0.2-rc |
| Type: | New Feature | Priority: | Major |
| Reporter: | Anand Beh | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Compatibility, packaging | ||
| Description |
|
At the moment, for compatibility with the Java Platform Module System (JPMS), MariaDB-Connector provides an Automatic-Module-Name entry in the manifest. This suits basic usage in a modular application. A full module descriptor, i.e. a module-info.java file, will allow full usage in a modular application. Complete module descriptors are a requirement for realizing further gains in JPMS most notably the jlink tool. Whereas Automatic-Module-Name is the bare minimum, a true module descriptor means full support. Strictly speaking, adding a module descriptor is backwards compatible, even with JDK 8. However, there are some tools which ignore the specification and scan for module descriptors, even inside META-INF/versions/. These tools have been updated by now - the bugs surfaced around 2017-2018 - so it may not be an issue for the majority of users. For this reason, I thought that adding a full module-info as part of 3.0.x would make the most sense - a module-info file is technically backwards compatible, but for matters of practicality, it would help users to have it introduced in the 3.x release. |
| Comments |
| Comment by Diego Dupin [ 2021-07-27 ] | |
|
adding
can easy be done for module-info, that will have to wait, there is some optional third party library which are not yet modularized. | |
| Comment by Anand Beh [ 2021-07-29 ] | |
|
Diego, thanks. Would you mind telling me what these optional libraries are? I can report the issues to their bug trackers. | |
| Comment by Anand Beh [ 2021-07-29 ] | |
|
Regarding com.amazonaws:aws-java-sdk-rds, I discovered here that they do not plan to add an Automatic-Module-Name for version 1. However, they've added it for version 2. For MariaDB-Connector, there are 2 options in order to achieve a full module descriptor: 1. Compile the descriptor with AWS-SDK version 1. Even though there is no Automatic-Module-Name in AWS-SDK version 1, it is safe to rely on filename-based modules. This works because it is the stated policy of AWS-SDK that they will not add Automatic-Module-Name for version 1. This won't break compatibility, becase anyone using JPMS will either not use AWS-SDK or will be careful not to change the name of the jar file. JPMS needs to be explicitly enabled, so this doesn't affect anyone on the classpath. OR 2. Change the MariaDB-Connector codebase to use version 2 of AWS-SDK: https://github.com/aws/aws-sdk-java-v2. Version 2 has an Automatic-Module-Name. However, this may require more work, I don't know how much. | |
| Comment by Diego Dupin [ 2021-08-25 ] | |
|
right, re-opening issue. |